|
@@ -9,21 +9,13 @@ namespace Game
|
|
|
{
|
|
|
public class GameCore : RdSingletonStateMachine<GameState, GameCore>
|
|
|
{
|
|
|
- [RdReset] public GameState pendingState;
|
|
|
+ [RdReset] public GameState pendingState, battleState, liftState, endState;
|
|
|
|
|
|
- [RdReset] public GameState battleState;
|
|
|
+ [RdReset] public GamePlayer localPlayer, antiPlayer;
|
|
|
|
|
|
- [RdReset] public GameState liftState;
|
|
|
+ [RdReset] public int winPlayerId, diamond;
|
|
|
|
|
|
- [RdReset] public GameState endState;
|
|
|
-
|
|
|
- [RdReset] public GamePlayer localPlayer;
|
|
|
-
|
|
|
- [RdReset] public GamePlayer antiPlayer;
|
|
|
-
|
|
|
- [RdReset] public int winPlayerId;
|
|
|
-
|
|
|
- [RdReset] public int diamond;
|
|
|
+ // 存储组件的容器
|
|
|
|
|
|
[RdReset] public Dictionary<int, CockActionComp> cockActionComps;
|
|
|
|
|
@@ -31,13 +23,13 @@ namespace Game
|
|
|
|
|
|
[RdReset] public Dictionary<int, MasterActionComp> masterDict;
|
|
|
|
|
|
- [RdReset] public GameObject parent;
|
|
|
+ // 需要用到的GameObject
|
|
|
|
|
|
- [RdReset] public BattleMainComp battleMainComp;
|
|
|
+ [RdReset] public GameObject parent, camera, resultPanel;
|
|
|
|
|
|
- [RdReset] public GameObject camera;
|
|
|
+ [RdReset] public BattleMainComp battleMainComp;
|
|
|
|
|
|
- [RdReset] public GameObject resultPanel;
|
|
|
+ // 游戏运行数据
|
|
|
|
|
|
[RdReset] public LinkedList<BattleDetailObj> battleDetailObjs;
|
|
|
|
|
@@ -47,10 +39,8 @@ namespace Game
|
|
|
|
|
|
[RdReset(2)] public int liftTimes;
|
|
|
|
|
|
- [RdReset] public bool inBattleState = false;
|
|
|
-
|
|
|
[RdReset(true)] public bool showResultPanel = true;
|
|
|
-
|
|
|
+
|
|
|
public GameCore()
|
|
|
{
|
|
|
}
|
|
@@ -96,12 +86,6 @@ namespace Game
|
|
|
Start();
|
|
|
}
|
|
|
|
|
|
- public override void TransitionToState(GameState nextState)
|
|
|
- {
|
|
|
- inBattleState = nextState == battleState;
|
|
|
- base.TransitionToState(nextState);
|
|
|
- }
|
|
|
-
|
|
|
protected override void Start()
|
|
|
{
|
|
|
TransitionToState(pendingState);
|