Exemplo n.º 1
0
        public override void Populate()
        {
            EnabledPanels = new Dictionary <Type, bool>();

            var audioSub = GetComponentInParent <AudioSubpanel>();
            var videoSub = GetComponentInParent <VideoSubpanel>();


            if (audioSub)
            {
                AudioSubPanel        = audioSub;
                AudioSubPanel.Slider = Slider;

                if (Time != null)
                {
                    AudioSubPanel.Time = Time;
                }

                // TODO:: Make this happen dynamically by checking property of parent.
                EnabledPanels.Add(typeof(AudioSubpanel), true);
            }
            if (videoSub)
            {
                VideoSubPanel = videoSub;

                if (Time != null)
                {
                    // Time?
                }

                if (FullScreenVideoToggle != null)
                {
                    // The controls are on a video, set them active.
                    if (VideoSubPanel.FullScreen != null)
                    {
                        VideoSubPanel.FullScreen.GetComponentInChildren <VideoControls>().VideoSubpanel = VideoSubPanel;
                        FullScreenVideoToggle.SetActive(true);
                    }
                }

                VideoSubPanel.time = Time;

                //TODO:: Make this happen dynamically by checking property of parent.
                EnabledPanels.Add(typeof(VideoSubpanel), true);
            }


            // Open Hook.
            if (OnOpen != null)
            {
                OnOpen();
            }

            base.Populate();
        }
Exemplo n.º 2
0
        protected override void Awake()
        {
            base.Awake();

            m_subpanel = GetComponentInChildren <AudioSubpanel>();
            m_subpanel.PlaybackCompleted.AddListener(m_subpanel_PlaybackCompleted);

            if (PlaybackCompleted == null)
            {
                PlaybackCompleted = new UnityEvent();
            }
        }