示例#1
0
 void OnGUI() //calls the drawing code for a specific mode
 {
     if (activeState != null)
     {
         activeState.ShowIt();
     }
 }
示例#2
0
 private void OnGUI()
 {
     if (activeState != null)
     {
         activeState.ShowIt();
     }
 }
示例#3
0
    void Start()
    {
        gameStateMachine_Ref = this;

        if (canvas_Ref == null)
        {
            if (transform.GetChild(0).gameObject != null)
            {
                canvas_Ref = transform.GetChild(0).gameObject;
            }
            else
            {
                Debug.Log("GameStateMachine is missing a reference to the Canvas");
            }
        }

        if (gameState == null)
        {
            gameState = new BeginState(this);
        }

        if (bordersParent_Ref == null)
        {
            if (GameObject.Find("BordersParent") != null)
            {
                bordersParent_Ref = GameObject.Find("BordersParent");
            }
            else
            {
                Debug.Log("GameStateMachine is missing a reference to BordersParent");
            }
        }

        if (playerInfoOne_Ref == null)
            Debug.Log("GameStateMachine is missing a reference to playerOneInfo");
        
        if (playerInfoTwo_Ref == null)
            Debug.Log("GameStateMachine is missing a reference to playerTwoInfo");

        playerOneSpawner_Ref.GetComponent<Spawner>().PlayerParent = playerOneParent_Ref;
        playerTwoSpawner_Ref.GetComponent<Spawner>().PlayerParent = playerTwoParent_Ref;

        gameState.ShowIt();

        playerOneBlocksCollected = new bool[playerOneSpawner_Ref.GetComponent<Spawner>().groups.Length];
        playerTwoBlocksCollected = new bool[playerTwoSpawner_Ref.GetComponent<Spawner>().groups.Length];

       if(gamesPlayedBeforeRefill == 0) { gamesPlayedBeforeRefill = 28; }
        inGameUIManager_Ref.UpdatePlayerStatus(WhoIsInTheLead());
    }
示例#4
0
 public void ChangeState(IStateBase newState)
 {
     gameState = newState;
     gameState.ShowIt();
 }