/// <summary> /// Start is called before the first frame update /// </summary> void Start() { dungeon = new DungeonManager(); // ステートマシンの遷移テーブルを構築 stateMachine = new IceMilkTea.Core.ImtStateMachine <GameScene>(this); stateMachine.AddTransition <InState, PlayerMoveState>((int)StateEventId.In); stateMachine.AddTransition <InState, PlayerMoveState>((int)StateEventId.InToPlayerMove); stateMachine.AddTransition <PlayerMoveState, WaitSelectState>((int)StateEventId.PlayerMoveToWaitSelect); stateMachine.AddTransition <WaitSelectState, OutState>((int)StateEventId.IdleToOut); stateMachine.AddTransition <OutState, InState>((int)StateEventId.OutToIn); stateMachine.SetStartState <InState>(); }
/// <summary> /// Start is called before the first frame update /// </summary> void Start() { stateMachine = new IceMilkTea.Core.ImtStateMachine <Battler>(this); stateMachine.AddAnyTransition <IdleState>((int)StateEventId.Idle); stateMachine.AddTransition <IdleState, AttackState>((int)StateEventId.Attack); stateMachine.AddTransition <IdleState, DamageState>((int)StateEventId.Damage); stateMachine.AddTransition <IdleState, WinState>((int)StateEventId.Win); stateMachine.AddTransition <IdleState, LoseState>((int)StateEventId.Lose); stateMachine.AddTransition <WinState, LeaveState>((int)StateEventId.Leave); stateMachine.SetStartState <EnterState>(); stepTime = 0.0f; stepSpriteIndex = 1; speed = 3.0f; }
public static Main Create() { var main = new Main(); var stateMachine = new IceMilkTea.Core.ImtStateMachine <Main, EventTrigger>(main); stateMachine.AddTransition <Start, Initial>(EventTrigger.Next); stateMachine.AddTransition <Initial, SelectEnv>(EventTrigger.Next); stateMachine.AddTransition <SelectEnv, MyAccount>(EventTrigger.Next); stateMachine.AddTransition <SelectMode, SelectMode>(EventTrigger.Continue); stateMachine.AddTransition <SelectMode, SelectEnv>(EventTrigger.MODE_SelectEnv); stateMachine.AddTransition <SelectMode, MyAccount>(EventTrigger.MODE_MyAccount); stateMachine.AddTransition <SelectMode, GiveMeFriends>(EventTrigger.MODE_GiveMeFriends); stateMachine.AddTransition <SelectMode, ApproveFriendRequests>(EventTrigger.MODE_ApproveFriendRequests); stateMachine.AddTransition <SelectMode, RecentPlayers>(EventTrigger.MODE_RecentPlayers); stateMachine.AddTransition <SelectMode, CreateActors>(EventTrigger.MODE_CreateActors); stateMachine.AddTransition <SelectMode, SessionKeep>(EventTrigger.MODE_SessionKeep); stateMachine.AddTransition <SelectMode, CreateAccounts>(EventTrigger.MODE_CreateAccounts); stateMachine.AddTransition <SelectEnv, SelectEnv>(EventTrigger.Continue); stateMachine.AddTransition <MyAccount, SelectMode>(EventTrigger.Next); stateMachine.AddTransition <MyAccount, SelectEnv>(EventTrigger.Continue); stateMachine.AddTransition <GiveMeFriends, SelectMode>(EventTrigger.Next); stateMachine.AddTransition <ApproveFriendRequests, SelectMode>(EventTrigger.Next); stateMachine.AddTransition <RecentPlayers, SelectMode>(EventTrigger.Next); stateMachine.AddTransition <CreateActors, SelectMode>(EventTrigger.Next); stateMachine.AddTransition <SessionKeep, SelectMode>(EventTrigger.Next); stateMachine.AddTransition <CreateAccounts, SelectMode>(EventTrigger.Next); stateMachine.SetStartState <Start>(); main.StateMachine = stateMachine; return(main); }
/// <summary> /// Start is called before the first frame update /// </summary> void Start() { popupDamageManager = new PopupTextManager(CanvasGameObject); // プレハブから Player を生成 var playerPrefab = (GameObject)Resources.Load("Prefabs/Player/BattlePlayer"); battlePlayer = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity); battlePlayer.SetActive(false); var enemyPrefab = (GameObject)Resources.Load("Prefabs/Enemy/BattleEnemy"); battleEnemy = Instantiate(enemyPrefab, Vector3.zero, Quaternion.identity); battleEnemy.SetActive(false); FadeManager.Blackout(); FadeManager.FadeIn(); stateMachine = new IceMilkTea.Core.ImtStateMachine <BattleScene>(this); stateMachine.AddTransition <WaitState, BattleState>((int)StateEventId.Start); stateMachine.AddTransition <BattleState, TurnChangeState>((int)StateEventId.TurnChange); stateMachine.AddTransition <TurnChangeState, BattleState>((int)StateEventId.Battle); stateMachine.AddTransition <TurnChangeState, WinState>((int)StateEventId.Win); stateMachine.AddTransition <TurnChangeState, LoseState>((int)StateEventId.Lose); stateMachine.AddTransition <WinState, LeaveState>((int)StateEventId.Leave); stateMachine.SetStartState <WaitState>(); var playerBattlerScript = battlePlayer.GetComponent <Battler>(); var enemyBattlerScript = battleEnemy.GetComponent <Battler>(); var param = (BattleSceneParam)SceneParam; playerBattlerScript.Status = param.PlayerStatus; enemyBattlerScript.Status = Database.EnemyDatabase.GetStatus(param.EncountId); turnTypes = TurnTypes.Player; }