Exemplo n.º 1
0
    private void OnEnable()
    {
        foreach (Transform child in optionContainer.transform)
        {
            Destroy(child.gameObject);
        }

        options.Clear();

        foreach (ChatChannel channel in chatChannels.GetChannels())
        {
            ChatFilterOption option = Instantiate(optionPrefab, optionContainer);
            option.Init(channel);
            options.Add(option);
        }
    }
Exemplo n.º 2
0
    private void Update()
    {
        if (chatCreated)
        {
            return;
        }

        //TODO: This should probably be converted to an Initialize() method and simply called after the player is spawned.
        NetworkIdentity player = ClientScene.localPlayer;

        if (player == null)
        {
            return;
        }

        sender = player.gameObject;
        CreateChatWindow(new ChatTabData("All", chatChannels.GetChannels(), false, null), null, Vector2.zero);
        chatCreated = true;
    }