Example #1
0
    public void SessionCharacterList()
    {
        if (characterList.alpha == 1f)
        {
            HideCharacterList();
            return;
        }

        CharacterSelector[] characters = listCharacters.GetComponentsInChildren <CharacterSelector>();
        for (int i = 0; i < characters.Length; i++)
        {
            Destroy(characters[i].gameObject);
        }

        characterList.alpha          = 1f;
        characterList.blocksRaycasts = true;
        characterList.interactable   = true;

        for (int i = 0; i < sessionData.Content_Lobby.characters.Count; i++)
        {
            Content_Lobby     character       = sessionData.Content_Lobby.characters[i];
            CharacterSelector characterSelect = Instantiate(characterSample, listCharacters);
            characterSelect.name         = "Character_" + character.ID_Character;
            characterSelect.id_Character = character.ID_Character;
            characterSelect.SetVisual(character.ID_Token);
        }

        //SAMPLES
        for (int i = 0; i < 4; i++)// 4 samples enemy
        {
            EnemySelector enemySelect = Instantiate(enemySample, listCharacters);
            enemySelect.name = "Ennemy_" + i;
            enemySelect.SetVisual(i);
        }
        ItemSelector chestSelect = Instantiate(itemSample, listCharacters);

        chestSelect.name = "Chest";
        chestSelect.SetVisual(0);
    }