using System.Collections; using System.Collections.Generic; using UnityEngine; [System.Serializable] public class BaseHero { public string name; // name of Unit_Hero // Unit Stats public float MaxHP; public float currentHP; public float MaxMP; public float currentMP; public float MaxAP; public float currentAP; public int Vit; public int Str; public int Int; public int Dex; public int Mnd; public int Speed; public int CastingSpeed; }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class HeroStateMachine : MonoBehaviour { public BaseHero Hero; BaseHero() { this.Speed = 0; return this.Speed; } public enum TurnState { PROCESSING, ADDTOLIST, WAITING, SELECTING, ACTION, DEAD } public TurnState CurrentState; //Used for CT private float current_CT = 0f; private float Max_CT = 100f; // Start is called before the first frame update void Start() { CurrentState = TurnState.PROCESSING; } // Update is called once per frame void Update() { switch(CurrentState) { case (TurnState.PROCESSING): CTCounter(); break; case (TurnState.ADDTOLIST): break; case (TurnState.WAITING): break; case (TurnState.SELECTING): break; case (TurnState.ACTION): break; case (TurnState.DEAD): break; } } void CTCounter() //Turn count to 100 like FFT { current_CT = current_CT + Speed; float calc_CT = current_CT / Max_CT; if(current_CT >= Max_CT) { CurrentState = TurnState.ADDTOLIST; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)