赤ゲージ(Hot)でコーンが完成した場合焦げるように変更
This commit is contained in:
parent
011233265f
commit
ac9711f083
|
|
@ -36,6 +36,7 @@ public class Corn : MonoBehaviour
|
||||||
private float cornGrowSpeed;
|
private float cornGrowSpeed;
|
||||||
private float cornSpillSpeed;
|
private float cornSpillSpeed;
|
||||||
private float cornPopSpeed;
|
private float cornPopSpeed;
|
||||||
|
private bool isHot;
|
||||||
|
|
||||||
public IReadOnlyReactiveProperty<CornCondition> Condition => condition;
|
public IReadOnlyReactiveProperty<CornCondition> Condition => condition;
|
||||||
private readonly ReactiveProperty<CornCondition> condition = new ReactiveProperty<CornCondition>(CornCondition.Seed);
|
private readonly ReactiveProperty<CornCondition> condition = new ReactiveProperty<CornCondition>(CornCondition.Seed);
|
||||||
|
|
@ -118,14 +119,22 @@ public class Corn : MonoBehaviour
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
|
if (condition.Value == CornCondition.Burnt) return;
|
||||||
cornGrowTime += Time.deltaTime * cornGrowSpeed;
|
cornGrowTime += Time.deltaTime * cornGrowSpeed;
|
||||||
if (cornGrowTime >= cornBurntTime)
|
if (cornGrowTime >= cornBurntTime)
|
||||||
{
|
{
|
||||||
condition.Value = CornCondition.Burnt;
|
condition.Value = CornCondition.Burnt;
|
||||||
}
|
}
|
||||||
else if (cornGrowTime >= cornPopTime)
|
if (cornGrowTime >= cornPopTime && condition.Value == CornCondition.Seed)
|
||||||
{
|
{
|
||||||
condition.Value = CornCondition.Simple;
|
if (isHot)
|
||||||
|
{
|
||||||
|
condition.Value = CornCondition.Burnt;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
condition.Value = CornCondition.Simple;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -157,4 +166,9 @@ public class Corn : MonoBehaviour
|
||||||
{
|
{
|
||||||
cornGrowSpeed = speed;
|
cornGrowSpeed = speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ChangeHotStatus(bool status)
|
||||||
|
{
|
||||||
|
isHot = status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@ public class CornManager : MonoBehaviour
|
||||||
public void RespawnCorn()
|
public void RespawnCorn()
|
||||||
{
|
{
|
||||||
cornGrowSpeed.Value = 0f;
|
cornGrowSpeed.Value = 0f;
|
||||||
|
isHot = false;
|
||||||
missCount.Value = 0;
|
missCount.Value = 0;
|
||||||
isCompleted = false;
|
isCompleted = false;
|
||||||
compositeDisposable.Clear();
|
compositeDisposable.Clear();
|
||||||
|
|
@ -146,6 +147,7 @@ public class CornManager : MonoBehaviour
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
corn.ChangeGrowSpeed(x);
|
corn.ChangeGrowSpeed(x);
|
||||||
|
corn.ChangeHotStatus(isHot);
|
||||||
}).AddTo(compositeDisposable);
|
}).AddTo(compositeDisposable);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue