예제 #1
0
 private void Awake()
 {
     frontState = new FrontState(this);
     backState  = new BackState(this);
     rightState = new RightState(this);
     leftState  = new LeftState(this);
 }
예제 #2
0
    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;
    }
예제 #3
0
파일: Model.cs 프로젝트: AaronXue0/Escape
 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;
 }
예제 #4
0
    // 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;
    }
예제 #5
0
    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;
        }
    }
예제 #6
0
 public void SetNextState(FrontState state)
 {
     nextState = state;
 }