コメントとDispose追加
This commit is contained in:
parent
9bdb0e20db
commit
a960f2170a
|
|
@ -41,6 +41,7 @@ public class CornManager : MonoBehaviour
|
|||
cornArray = new Corn[cornSpawnCount];
|
||||
result.AddTo(this);
|
||||
cornGrowSpeed.AddTo(this);
|
||||
compositeDisposable.AddTo(this);
|
||||
}
|
||||
|
||||
public void RespawnCorn()
|
||||
|
|
@ -63,6 +64,7 @@ public class CornManager : MonoBehaviour
|
|||
cornArray[i] = corn;
|
||||
corn.SetCornProperty(baseCornPopTime, cornBurntDuration);
|
||||
|
||||
// 進行速度の変更時、コーン速度変更
|
||||
cornGrowSpeed.TakeWhile(_ => !isCompleted).Subscribe(x =>
|
||||
{
|
||||
// コーンが弾けた後はRedの場合のみ焦げ進行する
|
||||
|
|
@ -80,6 +82,7 @@ public class CornManager : MonoBehaviour
|
|||
.FirstOrDefault()
|
||||
.Subscribe(_ =>
|
||||
{
|
||||
// ThermalCondition.Hot以外では焦げ進行なし
|
||||
if (!isHot)
|
||||
{
|
||||
corn.ChangeGrowSpeed(0f);
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ public class PopcornGameManager : MonoBehaviour
|
|||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
compositeDisposable.AddTo(this);
|
||||
|
||||
thermalControl.Condition.Subscribe(x =>
|
||||
{
|
||||
cornManager.ChangeGrowSpeed(x);
|
||||
|
|
|
|||
Loading…
Reference in New Issue