Merge branch 'develop' of bitbucket.org:usaya/popcorn into develop
This commit is contained in:
commit
4c41e7bc25
|
|
@ -10,7 +10,8 @@ AnimatorState:
|
|||
m_Name: CornWait
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_Transitions:
|
||||
- {fileID: 5154816746081122088}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
|
|
@ -34,7 +35,19 @@ AnimatorController:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: corn
|
||||
serializedVersion: 5
|
||||
m_AnimatorParameters: []
|
||||
m_AnimatorParameters:
|
||||
- m_Name: CornGrow
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
- m_Name: CornBurn
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 0}
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
|
|
@ -59,13 +72,13 @@ AnimatorStateMachine:
|
|||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -6451913813719917424}
|
||||
m_Position: {x: 280, y: 60, z: 0}
|
||||
m_Position: {x: 270, y: 40, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 6341160211334192665}
|
||||
m_Position: {x: 280, y: 150, z: 0}
|
||||
m_Position: {x: 380, y: 120, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 7193984417312256253}
|
||||
m_Position: {x: 280, y: 240, z: 0}
|
||||
m_Position: {x: 270, y: 230, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
|
|
@ -76,6 +89,56 @@ AnimatorStateMachine:
|
|||
m_ExitPosition: {x: 800, y: 120, z: 0}
|
||||
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
|
||||
m_DefaultState: {fileID: -6451913813719917424}
|
||||
--- !u!1101 &3570958320764608268
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: CornBurn
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 7193984417312256253}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.3181818
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &5154816746081122088
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: CornGrow
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 6341160211334192665}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &6341160211334192665
|
||||
AnimatorState:
|
||||
serializedVersion: 5
|
||||
|
|
@ -86,7 +149,8 @@ AnimatorState:
|
|||
m_Name: CornGrow
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_Transitions:
|
||||
- {fileID: 3570958320764608268}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
|
|
@ -128,3 +192,17 @@ AnimatorState:
|
|||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1109 &8788699130245483641
|
||||
AnimatorTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 6341160211334192665}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 1
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ GameObject:
|
|||
- component: {fileID: 7195010600253370228}
|
||||
- component: {fileID: 8932234855615206969}
|
||||
m_Layer: 0
|
||||
m_Name: corn
|
||||
m_Name: Corn
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
@ -71,6 +71,9 @@ MonoBehaviour:
|
|||
cornSeedSprite: {fileID: 21300000, guid: 97ac0328246620745b8881e07f709ce7, type: 3}
|
||||
cornSimpleSprite: {fileID: 21300000, guid: 041ad2539ff56d945ab2da4be6a02f04, type: 3}
|
||||
cornBurntSprite: {fileID: 21300000, guid: a9d669186411b2b4da1511f59a91b4c9, type: 3}
|
||||
effectBurnt: {fileID: 3984349228049242719, guid: 02298b5aac4434a4c81aec58ad2caa9d,
|
||||
type: 3}
|
||||
animator: {fileID: 5972257590091015193}
|
||||
--- !u!50 &7195010600253370228
|
||||
Rigidbody2D:
|
||||
serializedVersion: 4
|
||||
|
|
|
|||
|
|
@ -4815,7 +4815,7 @@ ParticleSystemRenderer:
|
|||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_SortingOrder: 1
|
||||
m_RenderMode: 0
|
||||
m_SortMode: 0
|
||||
m_MinParticleSize: 0
|
||||
|
|
|
|||
|
|
@ -17,10 +17,14 @@ public enum CornCondition
|
|||
[RequireComponent(typeof(Rigidbody2D))]
|
||||
public class Corn : MonoBehaviour
|
||||
{
|
||||
private static readonly int HashCornGrow = Animator.StringToHash("CornGrow");
|
||||
private static readonly int HashCornBurn = Animator.StringToHash("CornBurn");
|
||||
[SerializeField] private SpriteRenderer spriteRenderer;
|
||||
[SerializeField] private Sprite cornSeedSprite;
|
||||
[SerializeField] private Sprite cornSimpleSprite;
|
||||
[SerializeField] private Sprite cornBurntSprite;
|
||||
[SerializeField] private GameObject effectBurnt;
|
||||
[SerializeField] private Animator animator;
|
||||
|
||||
private Rigidbody2D rigidbody;
|
||||
private float cornPopTime;
|
||||
|
|
@ -112,17 +116,19 @@ public class Corn : MonoBehaviour
|
|||
{
|
||||
spriteRenderer.sprite = cornSimpleSprite;
|
||||
rigidbody.AddForce(popSpeed * new Vector2(Random.value * 2 - 1, Random.value * 2 - 1), ForceMode2D.Impulse);
|
||||
animator.SetTrigger(HashCornGrow);
|
||||
}
|
||||
|
||||
private void CornBurnt()
|
||||
{
|
||||
spriteRenderer.sprite = cornBurntSprite;
|
||||
animator.SetTrigger(HashCornBurn);
|
||||
Instantiate(effectBurnt, transform);
|
||||
}
|
||||
|
||||
private void CornSpilled()
|
||||
{
|
||||
GetComponent<Collider2D>().enabled = false;
|
||||
// アニメーション消す
|
||||
}
|
||||
|
||||
public void SetCornProperty(float popTime, float burntDuration)
|
||||
|
|
@ -133,7 +139,6 @@ public class Corn : MonoBehaviour
|
|||
|
||||
public void ChangeGrowSpeed(float speed)
|
||||
{
|
||||
Debug.Log($"{speed:F}");
|
||||
cornGrowSpeed = speed;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ public class CornManager : MonoBehaviour
|
|||
|
||||
cornGrowSpeed.Subscribe(x =>
|
||||
{
|
||||
Debug.Log($"corn: {corn.Condition.Value} isHot: {isHot}");
|
||||
// コーンが弾けた後はRedの場合のみ焦げ進行する
|
||||
if (corn.Condition.Value == CornCondition.Simple && !isHot)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,15 +33,12 @@ public class ThermalControl : MonoBehaviour
|
|||
|
||||
private float duration = 0.3f;
|
||||
|
||||
private readonly ReactiveProperty<ThermalCondition> condition = new ReactiveProperty<ThermalCondition>(ThermalCondition.Cold);
|
||||
public IReadOnlyReactiveProperty<ThermalCondition> Condition => condition;
|
||||
private ReactiveProperty<ThermalCondition> condition;
|
||||
|
||||
public void Initialize()
|
||||
private void Start()
|
||||
{
|
||||
temperature = 0f;
|
||||
condition = new ReactiveProperty<ThermalCondition>(ThermalCondition.Cold);
|
||||
thermoMeter.SetScale(coldValue, hotValue);
|
||||
|
||||
condition.AddTo(this);
|
||||
condition.DistinctUntilChanged().Subscribe(x =>
|
||||
{
|
||||
Debug.Log($"cond :{x} temp: {temperature}");
|
||||
|
|
@ -71,7 +68,7 @@ public class ThermalControl : MonoBehaviour
|
|||
condition.Value = GetCondition();
|
||||
}
|
||||
|
||||
public ThermalCondition GetCondition()
|
||||
private ThermalCondition GetCondition()
|
||||
{
|
||||
if (temperature <= coldValue)
|
||||
{
|
||||
|
|
@ -83,4 +80,11 @@ public class ThermalControl : MonoBehaviour
|
|||
}
|
||||
return ThermalCondition.Yellow;
|
||||
}
|
||||
|
||||
public void ResetMeter()
|
||||
{
|
||||
temperature = 0f;
|
||||
temperatureSpeed = 0f;
|
||||
thermoMeter.SetScale(coldValue, hotValue);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,30 +25,29 @@ public class PopcornGameManager : MonoBehaviour
|
|||
gameResultText.text = "";
|
||||
// startingGuide.SetActive(true);
|
||||
isProgress = false;
|
||||
cornManager.Initialize();
|
||||
thermalControl.Initialize();
|
||||
|
||||
thermalControl.Condition.DistinctUntilChanged().Subscribe(x =>
|
||||
thermalControl.Condition.Subscribe(x =>
|
||||
{
|
||||
cornManager.ChangeGrowSpeed(x);
|
||||
}).AddTo(this);
|
||||
|
||||
GameReset();
|
||||
ResetGame();
|
||||
|
||||
// タップ後スタート
|
||||
GameStart();
|
||||
StartGame();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
}
|
||||
|
||||
private void GameReset()
|
||||
private void ResetGame()
|
||||
{
|
||||
cornManager.GenerateCorn();
|
||||
thermalControl.ResetMeter();
|
||||
cornManager.RespawnCorn();
|
||||
}
|
||||
|
||||
private void GameStart()
|
||||
private void StartGame()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue