Esempio 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();
        }
Esempio 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();
            }
        }