示例#1
0
        public void StartChat()
        {
            ControlChat chatNewComponent = FindObjectOfType <ControlChat>();

            chatNewComponent.UserName = this.idInput.text.Trim();
            chatNewComponent.Connect();
            enabled = false;

            PlayerPrefs.SetString(GUI_PlayerOptions.UserNamePlayerPref, chatNewComponent.UserName);
        }
示例#2
0
        public void Start()
        {
            this.chatNewComponent = FindObjectOfType <ControlChat>();


            string prefsName = PlayerPrefs.GetString(GUI_PlayerOptions.UserNamePlayerPref);

            if (!string.IsNullOrEmpty(prefsName))
            {
                this.idInput.text = prefsName;
            }
        }
示例#3
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject); //Kill the whole tree
     }
 }