void Awake() { if (_player != null) { _player = gameObject.GetComponentInParent <RealmYouTubeVideoPlayer> (); } Debug.Assert(_player != null, "Player is missing"); _player.OnPlay += OnVideoPlay; _ui = gameObject.GetComponent <RealmPlayPauseButtonUI> (); _buttonHandler = gameObject.GetComponent <RealmButtonWithClickMeter> (); _buttonHandler.OnClick.AddListener(OnClick); }
protected override void Init() { base.Init(); if (_player != null) { _player = gameObject.GetComponentInParent <RealmYouTubeVideoPlayer> (); } Debug.Assert(_player != null, "Player is missing"); if (_player != null) { _player.OnMute += OnPlayerMute; } _ui = gameObject.GetComponent <RealmMuteButtonUI> (); }