Exemple #1
0
 private void Update()
 {
     // If the color has changed (via the inspector), call SetColor on the color sync component.
     if (_name != _previousName)
     {
         _nameSync.SetName(_name);
         _previousName = _name;
     }
 }
        public void Update()
        {
            if (!_realtimeView.isOwnedLocally)
            {
                return;
            }

            _realtimeTransform.RequestOwnership();

            if (_nameSync == null || _nameInputField == null)
            {
                _nameSync       = GameObject.FindObjectOfType <NameSync>();
                _nameInputField = GameObject.FindObjectOfType <TMP_InputField>();
            }
            else
            {
                _nameSync.SetName(_nameInputField.text);
            }
        }