Example #1
0
    private void Awake()
    {
        zoneSelectorPlayer = Instantiate(zoneSelectorPrefab).GetComponent <ZoneSelector>();
        zoneSelectorTarget = Instantiate(zoneSelectorPrefab).GetComponent <ZoneSelector>();
        GameObject obj = Instantiate(characterInfoPanelPrefab);

        characterInfoPanel = obj.GetComponent <CharacterInfoPanel>();
        characterInfoPanel.Hide();
    }
Example #2
0
 public ScriptAllCharacterInfo(LAYOUT_TYPE type, string name, GameLayout layout)
     :
     base(type, name, layout)
 {
     mInfoPanelList = new CharacterInfoPanel[GameDefine.MAX_PLAYER_COUNT];
     for (int i = 0; i < GameDefine.MAX_PLAYER_COUNT; ++i)
     {
         mInfoPanelList[i] = new CharacterInfoPanel();
     }
 }
Example #3
0
 public void Awake()
 {
     if (instance == null)
     {
         //...set this one to be it...
         instance = this;
     }
     //...otherwise...
     else if (instance != this)
     {
         //...destroy this one because it is a duplicate.
         Destroy(gameObject);
     }
     activeCharacter = null;
     gameObject.SetActive(false);
 }
Example #4
0
    private void SpawnAllCharacters()
    {
        CharacterInfoPanel instanciate = (CharacterInfoPanel)FindObjectOfType(typeof(CharacterInfoPanel));

        if (instanciate)
        {
            instanciate.gameObject.SetActive(false);
            for (int i = 0; i < Characters.Count; i++)
            {
                CharacterInfoPanel healthPanel = Instantiate(instanciate, instanciate.transform.position + new Vector3(i * 100, 0, 0),
                                                             Quaternion.identity, gameHUD.transform.parent);
                healthPanel.gameObject.SetActive(true);

                Characters[i].instance =
                    Instantiate(characterPrefab, spawnPoint.position, spawnPoint.rotation) as GameObject;
                Characters[i].Setup();
                Characters[i].SetupHealthPanel(healthPanel);
            }
        }
    }