private void OnEnable() { _display = GetComponentInChildren <MeshRenderer>(); _linkedEntity = GetComponent <LinkedEntityComponent>(); _player = FindObjectOfType <AuthoritativePlayer>(); _player.SelectedDroneChanged += OnSelectedDroneChanged; // Setup initial material. _defaultMaterial = _display.sharedMaterial; if (IsOwned) { _display.sharedMaterial = _playerMaterial; } }
private void OnEnable() { _connector = FindObjectOfType <UnityClientConnector>(); _player = FindObjectOfType <AuthoritativePlayer>(); }