private void Awake() { frontState = new FrontState(this); backState = new BackState(this); rightState = new RightState(this); leftState = new LeftState(this); }
void Awake() { Title = this.transform.FindChild("Vault Background").gameObject; Shop = this.transform.FindChild("Shop Background").gameObject; Settings = this.transform.FindChild("Settings Background").gameObject; Selectiion = this.transform.FindChild("Game Selection").gameObject; Test = this.transform.FindChild("Test Control Center").gameObject; VaultDoor = this.transform.FindChild("Vault Door").gameObject; currentState = FrontState.ShopScreen; nextState = FrontState.TitleScreen; }
private void Awake() { if (GetComponent <SpriteRenderer>().material == null) { GetComponent <SpriteRenderer>().material = material; } PlayerState = new PlayerState(); PlayerState = PlayerState.waiting; GroundState = new GroundState(); FrontState = new FrontState(); JumpState = new JumpState(); TeamID = -1; Hp = 3; }
// Start is called before the first frame update void Start() { gameManager = (GameManager)FindObjectOfType(typeof(GameManager)); heartsManager = (HeartsManager)FindObjectOfType(typeof(HeartsManager)); audioManager = (AudioManager)FindObjectOfType(typeof(AudioManager)); frontState = new FrontState(this); backState = new BackState(this); flippingState = new FlippingState(this); backFlippingState = new BackFlippingState(this); hideAwayState = new HideAwayState(this); actualState = backState; }
void Update() { if (currentState != nextState) { ClearAll(); switch (nextState) { case FrontState.TitleScreen: { Title.SetActive(true); Title.GetComponent <TitleSetUp>().RefreshTitle(); break; } case FrontState.SelectionScreen: { Selectiion.SetActive(true); Selectiion.GetComponent <GameSelectionControl>().RefreshSelector(); break; } case FrontState.SettingScreen: { Settings.SetActive(true); Settings.GetComponent <SettingControl>().RefreshSettings(); break; } case FrontState.ShopScreen: { Shop.SetActive(true); break; } case FrontState.TestControlCenter: { Test.SetActive(true); break; } default: break; } currentState = nextState; } }
public void SetNextState(FrontState state) { nextState = state; }