Пример #1
0
 public void ShowCharacterSelect()
 {
     _csUI.gameObject.SetActive(true);
     _gridUI.gameObject.SetActive(false);
     _battleUI.gameObject.SetActive(false);
     _csUI.Init();
 }
Пример #2
0
    void Start()
    {
        combatQueue = new Character[6];

        CUI     = GameObject.Find("CombatUI").GetComponent <CombatUI> ();
        tCursor = GameObject.Find("TargetCursors").GetComponent <TargetCursor> ();
        GameObject[] CharUI  = new GameObject[3];
        GameObject[] EnemyUI = new GameObject[3];
        Player       = new Character[3];
        Enemy        = new Character[3];
        playerSelect = new Button [3];
        enemySelect  = new Button [3];

        // his block sets up the the characters and character select buttons
        for (int i = 0; i < 3; i++)
        {
            // set up the Character select buttons
            CharacterSelectUI PlayerSUI = GameObject.Find("Player" + i).GetComponent <CharacterSelectUI> ();
            CharacterSelectUI EnemySUI  = GameObject.Find("Enemy" + i).GetComponent <CharacterSelectUI> ();
            PlayerSUI.Init(this);
            EnemySUI.Init(this);

            // Set up the players
            Player[i] = GameObject.Find("Character" + i).GetComponent <Character>();
            Enemy [i] = GameObject.Find("Character" + (i + 3)).GetComponent <Character> ();
            Player [i].Init(this, PlayerSUI);
            Enemy [i].Init(this, EnemySUI);

            playerSelect [i] = GameObject.Find("Player" + i).GetComponent <Button> ();
            enemySelect [i]  = GameObject.Find("Enemy" + i).GetComponent <Button> ();

            // Set up each character's UI
            CharUI [i] = GameObject.Find("CharacterUI" + i);
            CharUI [i].GetComponent <CharacterUI> ().Init(Player [i]);
            EnemyUI [i] = GameObject.Find("CharacterUI" + (i + 3));
            EnemyUI [i].GetComponent <CharacterUI> ().Init(Enemy [i]);

            // Set the character's positions to the buttons
            Player[i].transform.position = new Vector3(playerSelect [i].transform.position.x, playerSelect [i].transform.position.y, 98);
            Enemy [i].transform.position = new Vector3(enemySelect [i].transform.position.x, enemySelect [i].transform.position.y, 98);
        }
        // Get the action buttons and set them up
        Button[] action = new Button[5];
        action [0] = GameObject.Find("ThrowButton").GetComponent <Button> ();
        action [1] = GameObject.Find("CatchButton").GetComponent <Button> ();
        action [2] = GameObject.Find("Skill1Button").GetComponent <Button> ();
        action [3] = GameObject.Find("Skill2Button").GetComponent <Button> ();
        action [4] = GameObject.Find("Skill3Button").GetComponent <Button> ();
        for (int i = 0; i < action.Length; i++)
        {
            action [i].GetComponent <ButtonsUI> ().CM = this;
        }

        // Get text components and the end buttons
        combatAction = GameObject.Find("CombatAction").GetComponent <Text> ();
        combatLog    = GameObject.Find("CombatLog").GetComponentInChildren <CombatLog> ();
        //ballsCaught = new System.Collections.Generic.List<bool>();

        // This sets up the character's healthbars and sets their allies and enemies internally
        for (int i = 0; i < 3; i++)
        {
            for (int j = 0; j < 3; j++)
            {
                Player [i].allies [j]  = Player [j];
                Player [i].enemies [j] = Enemy [j];
                Enemy [i].allies [j]   = Enemy [j];
                Enemy [i].enemies [j]  = Player [j];
            }
        }
        AI = gameObject.GetComponentInChildren <EnemyAI> ();
    }