リファクタ
This commit is contained in:
parent
763ffbb92e
commit
2cfa5e34d1
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using MyGame.Scripts;
|
||||
using UniRx;
|
||||
using UniRx.Diagnostics;
|
||||
using UniRx.Triggers;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
|
@ -29,10 +30,6 @@ public class PopcornGameManager : MonoBehaviour
|
|||
[SerializeField] private ThermoMeter thermoMeter;
|
||||
[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 CompositeDisposable compositeDisposable = new CompositeDisposable();
|
||||
|
||||
|
|
@ -87,14 +84,6 @@ public class PopcornGameManager : MonoBehaviour
|
|||
});
|
||||
}
|
||||
|
||||
#if DEVELOPMENT_BUILD || UNITY_EDITOR
|
||||
resetButton.OnClickAsObservable().Subscribe(_ =>
|
||||
{
|
||||
TransitionManager.Instance.UnloadScene(GameScenes.CookingResults);
|
||||
ResetGame();
|
||||
}).AddTo(this);
|
||||
#endif
|
||||
|
||||
#if UNITY_EDITOR
|
||||
this.UpdateAsObservable()
|
||||
.Where(_ => Input.GetKeyDown(KeyCode.R))
|
||||
|
|
@ -112,9 +101,8 @@ public class PopcornGameManager : MonoBehaviour
|
|||
|
||||
cornManager.Result
|
||||
.SkipLatestValueOnSubscribe()
|
||||
// .DistinctUntilChanged()
|
||||
.Materialize()
|
||||
.Subscribe(x => { Debug.Log(x); }).AddTo(this);
|
||||
.Debug("Result")
|
||||
.Subscribe(x => { }).AddTo(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -131,19 +119,6 @@ public class PopcornGameManager : MonoBehaviour
|
|||
// フライパン設定
|
||||
gameView.SetPan(panData.GetPrefab());
|
||||
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);
|
||||
compositeDisposable.Clear();
|
||||
cornManager.Result.SkipLatestValueOnSubscribe()
|
||||
|
|
|
|||
|
|
@ -49,10 +49,10 @@ public class ThermalControl : MonoBehaviour
|
|||
{
|
||||
condition.AddTo(this);
|
||||
#if UNITY_EDITOR
|
||||
condition.Subscribe(x =>
|
||||
{
|
||||
Debug.Log($"cond :{x} temp: {temperature}");
|
||||
}).AddTo(this);
|
||||
// condition.Subscribe(x =>
|
||||
// {
|
||||
// Debug.Log($"cond :{x} temp: {temperature}");
|
||||
// }).AddTo(this);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
@ -161,6 +161,18 @@ public class ThermalControl : MonoBehaviour
|
|||
|
||||
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;
|
||||
deadZone = panData.deadZone;
|
||||
baseIncreaseSpeed = panData.baseIncreaseSpeed;
|
||||
|
|
|
|||
Loading…
Reference in New Issue