クリア後コーン処理を追加
This commit is contained in:
parent
c866583f4a
commit
f7c7dacdd6
|
|
@ -26,6 +26,7 @@ public class CornManager : MonoBehaviour
|
|||
|
||||
private Corn[] cornArray;
|
||||
private bool isHot;
|
||||
private bool isCompleted;
|
||||
private List<IObservable<CornCondition>> cornConditions = new List<IObservable<CornCondition>>();
|
||||
private readonly ReactiveProperty<float> cornGrowSpeed = new FloatReactiveProperty(0f);
|
||||
private readonly CompositeDisposable compositeDisposable = new CompositeDisposable();
|
||||
|
|
@ -43,6 +44,7 @@ public class CornManager : MonoBehaviour
|
|||
|
||||
public void RespawnCorn()
|
||||
{
|
||||
isCompleted = false;
|
||||
compositeDisposable.Clear();
|
||||
cornConditions.Clear();
|
||||
for (int i = 0; i < cornArray.Length; i++)
|
||||
|
|
@ -60,7 +62,7 @@ public class CornManager : MonoBehaviour
|
|||
cornArray[i] = corn;
|
||||
corn.SetCornProperty(baseCornPopTime, cornBurntDuration);
|
||||
|
||||
cornGrowSpeed.Subscribe(x =>
|
||||
cornGrowSpeed.Where(_ => !isCompleted).Subscribe(x =>
|
||||
{
|
||||
// コーンが弾けた後はRedの場合のみ焦げ進行する
|
||||
if (corn.Condition.Value == CornCondition.Simple && !isHot)
|
||||
|
|
@ -91,6 +93,8 @@ public class CornManager : MonoBehaviour
|
|||
.FirstOrDefault(x => !x.Contains(CornCondition.Seed))
|
||||
.Subscribe(x =>
|
||||
{
|
||||
isCompleted = true;
|
||||
cornGrowSpeed.Value = 0f;
|
||||
if (x.Count(c => c == CornCondition.Simple) == x.Count) // すべてのコーンがPopped
|
||||
{
|
||||
result.SetValueAndForceNotify(CornResult.Perfect);
|
||||
|
|
|
|||
Loading…
Reference in New Issue