Esempio n. 1
0
        private IEnumerator LoadChatLogAsset()
        {
            yield return(AssetBundleLoader.LoadUIAsset(CHAT_LOG_ASSET, "PlayerChatCanvas", true, playerChatGameObject =>
            {
                playerChat = playerChatGameObject.AddComponent <PlayerChat>();
            }));

            yield return(playerChat.SetupChatComponents());
        }
Esempio n. 2
0
        public PlayerChatManager()
        {
            if (chat == null)
            {
                chat = new GameObject().AddComponent <PlayerChat>();
            }

            if (chatEntry == null)
            {
                chatEntry = new GameObject().AddComponent <PlayerChatEntry>();
            }
        }
Esempio n. 3
0
        public PlayerChat()
        {
            if (instance != null)
            {
                throw new Exception($"There must only be one {nameof(PlayerChat)} instance.");
            }
            instance = this;

            chatLog            = new GameObject().AddComponent <PlayerChatLog>();
            chatLog.Manager    = this;
            inputField         = new GameObject().AddComponent <PlayerChatInputField>();
            inputField.Manager = this;
        }
Esempio n. 4
0
 public PlayerChat()
 {
     if (NitroxEnvironment.IsNormal && instance != null)
     {
         throw new Exception($"There must only be one {nameof(PlayerChat)} instance.");
     }
     instance = this;
     chatLog  = new Lazy <PlayerChatLog>(() =>
     {
         PlayerChatLog chatlog = new GameObject().AddComponent <PlayerChatLog>();
         chatlog.Manager       = this;
         return(chatlog);
     });
     inputField = new Lazy <PlayerChatInputField>(() =>
     {
         PlayerChatInputField inputfield = new GameObject().AddComponent <PlayerChatInputField>();
         inputfield.Manager = this;
         return(inputfield);
     });
 }