Ejemplo n.º 1
0
    void AddMemberToGrid(GameObject partyObject, Character normalCharacter)
    {
        GameObject characterPrefab          = Instantiate(CharacterSmallPrefab) as GameObject;
        CharacterSmallController controller = characterPrefab.GetComponent <CharacterSmallController>();

        controller.character = normalCharacter;
        controller.Name.text = normalCharacter.name;
        controller.Ready.gameObject.SetActive(false);
        controller.transform.parent = partyObject.transform;
    }
Ejemplo n.º 2
0
 private void renderCharacters()
 {
     foreach (Transform child in GridCharactersSmall.transform)
     {
         // DESTROY ALL CHILDREN
         GameObject.Destroy(child.gameObject);
     }
     foreach (Character normalCharacter in allCharacters)
     {
         GameObject characterPrefab          = Instantiate(CharacterPrefab) as GameObject;
         CharacterSmallController controller = characterPrefab.GetComponent <CharacterSmallController>();
         controller.character = normalCharacter;
         controller.Name.text = normalCharacter.name;
         if (readyCharacters.Contains(normalCharacter))
         {
             controller.Ready.gameObject.SetActive(true);
         }
         else
         {
             controller.Ready.gameObject.SetActive(false);
         }
         controller.transform.parent = GridCharactersSmall.transform;
     }
 }