リファクタ
This commit is contained in:
parent
763ffbb92e
commit
2cfa5e34d1
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using MyGame.Scripts;
|
using MyGame.Scripts;
|
||||||
using UniRx;
|
using UniRx;
|
||||||
|
using UniRx.Diagnostics;
|
||||||
using UniRx.Triggers;
|
using UniRx.Triggers;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
|
|
@ -28,10 +29,6 @@ public class PopcornGameManager : MonoBehaviour
|
||||||
[SerializeField] private ThermalControl thermalControl;
|
[SerializeField] private ThermalControl thermalControl;
|
||||||
[SerializeField] private ThermoMeter thermoMeter;
|
[SerializeField] private ThermoMeter thermoMeter;
|
||||||
[SerializeField] private CornManager cornManager;
|
[SerializeField] private CornManager cornManager;
|
||||||
|
|
||||||
#if DEVELOPMENT_BUILD || UNITY_EDITOR
|
|
||||||
[SerializeField] private Button resetButton;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private readonly ReactiveProperty<GameState> state = new ReactiveProperty<GameState>(GameState.Guide);
|
private readonly ReactiveProperty<GameState> state = new ReactiveProperty<GameState>(GameState.Guide);
|
||||||
private readonly CompositeDisposable compositeDisposable = new CompositeDisposable();
|
private readonly CompositeDisposable compositeDisposable = new CompositeDisposable();
|
||||||
|
|
@ -86,14 +83,6 @@ public class PopcornGameManager : MonoBehaviour
|
||||||
cornManager.SetCornsActive(true);
|
cornManager.SetCornsActive(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEVELOPMENT_BUILD || UNITY_EDITOR
|
|
||||||
resetButton.OnClickAsObservable().Subscribe(_ =>
|
|
||||||
{
|
|
||||||
TransitionManager.Instance.UnloadScene(GameScenes.CookingResults);
|
|
||||||
ResetGame();
|
|
||||||
}).AddTo(this);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
this.UpdateAsObservable()
|
this.UpdateAsObservable()
|
||||||
|
|
@ -112,9 +101,8 @@ public class PopcornGameManager : MonoBehaviour
|
||||||
|
|
||||||
cornManager.Result
|
cornManager.Result
|
||||||
.SkipLatestValueOnSubscribe()
|
.SkipLatestValueOnSubscribe()
|
||||||
// .DistinctUntilChanged()
|
.Debug("Result")
|
||||||
.Materialize()
|
.Subscribe(x => { }).AddTo(this);
|
||||||
.Subscribe(x => { Debug.Log(x); }).AddTo(this);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -131,19 +119,6 @@ public class PopcornGameManager : MonoBehaviour
|
||||||
// フライパン設定
|
// フライパン設定
|
||||||
gameView.SetPan(panData.GetPrefab());
|
gameView.SetPan(panData.GetPrefab());
|
||||||
thermalControl.SetPanData(panData);
|
thermalControl.SetPanData(panData);
|
||||||
#if UNITY_EDITOR
|
|
||||||
Debug.Log($@"
|
|
||||||
name = {panData.Name}
|
|
||||||
panFactor = {panData.panFactor}
|
|
||||||
deadZone = {panData.deadZone}
|
|
||||||
baseIncreaseSpeed = {panData.baseIncreaseSpeed}
|
|
||||||
coldIncreaseSpeed = {panData.coldIncreaseSpeed}
|
|
||||||
hotIncreaseSpeed = {panData.hotIncreaseSpeed}
|
|
||||||
maxDecreaseSpeed = {panData.maxDecreaseSpeed}
|
|
||||||
yellowSize = {panData.yellowSize}
|
|
||||||
randomRange = {panData.randomRange}
|
|
||||||
");
|
|
||||||
#endif
|
|
||||||
cornManager.SetCornsActive(true);
|
cornManager.SetCornsActive(true);
|
||||||
compositeDisposable.Clear();
|
compositeDisposable.Clear();
|
||||||
cornManager.Result.SkipLatestValueOnSubscribe()
|
cornManager.Result.SkipLatestValueOnSubscribe()
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,10 @@ public class ThermalControl : MonoBehaviour
|
||||||
{
|
{
|
||||||
condition.AddTo(this);
|
condition.AddTo(this);
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
condition.Subscribe(x =>
|
// condition.Subscribe(x =>
|
||||||
{
|
// {
|
||||||
Debug.Log($"cond :{x} temp: {temperature}");
|
// Debug.Log($"cond :{x} temp: {temperature}");
|
||||||
}).AddTo(this);
|
// }).AddTo(this);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -161,6 +161,18 @@ public class ThermalControl : MonoBehaviour
|
||||||
|
|
||||||
public void SetPanData(PanData panData)
|
public void SetPanData(PanData panData)
|
||||||
{
|
{
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
Debug.Log($@"SetPanData
|
||||||
|
name = {panData.Name}
|
||||||
|
panFactor = {panData.panFactor}
|
||||||
|
deadZone = {panData.deadZone}
|
||||||
|
baseIncreaseSpeed = {panData.baseIncreaseSpeed}
|
||||||
|
coldIncreaseSpeed = {panData.coldIncreaseSpeed}
|
||||||
|
hotIncreaseSpeed = {panData.hotIncreaseSpeed}
|
||||||
|
maxDecreaseSpeed = {panData.maxDecreaseSpeed}
|
||||||
|
yellowSize = {panData.yellowSize}
|
||||||
|
randomRange = {panData.randomRange}");
|
||||||
|
#endif
|
||||||
panFactor = panData.panFactor;
|
panFactor = panData.panFactor;
|
||||||
deadZone = panData.deadZone;
|
deadZone = panData.deadZone;
|
||||||
baseIncreaseSpeed = panData.baseIncreaseSpeed;
|
baseIncreaseSpeed = panData.baseIncreaseSpeed;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue