예제 #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);
        }
    }
예제 #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;
    }