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