Esempio n. 1
0
        public void OnDrawElement(Rect rect, int index, bool isactive, bool isfocused)
        {
            if (index > playlistVideos.Count)
            {
                return;
            }
            entity = playlistVideos[index];

            rect.y     += 2;
            rect.x     += 12;
            rect.width -= 12;
            Rect _rect = new Rect(rect.x, rect.y, 100, EditorGUIUtility.singleLineHeight);

            entity.isCollapsed = EditorGUI.Foldout(_rect, entity.isCollapsed, "Title", true);
            _rect.x           += 80;
            _rect.width        = rect.width - 80;
            entity.videoTitle  = EditorGUI.TextField(_rect, entity.videoTitle);

            if (!entity.isCollapsed)
            {
                return;
            }

            rect.y += EditorGUIUtility.singleLineHeight * 1.25f;
            _rect   = new Rect(rect.x, rect.y, 100, EditorGUIUtility.singleLineHeight);

            EditorGUI.LabelField(_rect, "Video Url");
            _rect.x        += 80;
            _rect.width     = rect.width - 80;
            entity.videoUrl = EditorGUI.TextField(_rect, entity.videoUrl);

            rect.y += EditorGUIUtility.singleLineHeight * 1.25f;
            _rect   = new Rect(rect.x, rect.y, 100, EditorGUIUtility.singleLineHeight);

            EditorGUI.LabelField(_rect, "Thumbnail Url");
            _rect.x            += 80;
            _rect.width         = rect.width - 80;
            entity.thumbnailUrl = EditorGUI.TextField(_rect, entity.thumbnailUrl);

            rect.y += EditorGUIUtility.singleLineHeight * 1.25f;
            _rect   = new Rect(rect.x, rect.y, 100, EditorGUIUtility.singleLineHeight);

            EditorGUI.LabelField(_rect, "Start");
            _rect.x    += 80;
            _rect.width = rect.width - 80;
            entity.introEndInSeconds = EditorGUI.IntField(_rect, entity.introEndInSeconds);

            rect.y += EditorGUIUtility.singleLineHeight * 1.25f;
            _rect   = new Rect(rect.x, rect.y, 100, EditorGUIUtility.singleLineHeight);

            EditorGUI.LabelField(_rect, "End");
            _rect.x    += 80;
            _rect.width = rect.width - 80;
            entity.creditsStartInSeconds = EditorGUI.IntField(_rect, entity.creditsStartInSeconds);
        }
Esempio n. 2
0
        public float OnHeightElement(int index)
        {
            if (index > playlistVideos.Count)
            {
                return(EditorGUIUtility.singleLineHeight * 1.25f);
            }
            entity = playlistVideos[index];

            if (!entity.isCollapsed)
            {
                return(EditorGUIUtility.singleLineHeight * 1.25f);
            }

            return(EditorGUIUtility.singleLineHeight * 6.25f);
        }