Пример #1
0
 public static void ShowEditor()
 {
     if (_Inst == null)
     {
         _Inst = EditorWindow.GetWindow <TimelineWindow>();
         _Inst.titleContent = new GUIContent("Timeline");
         _Inst.minSize      = new Vector2(250f, 200f);
     }
 }
Пример #2
0
        void OnGUI()
        {
            _Inst = this;
            Rect rect = Rect.zero;

            rect.x = 1f;
            rect.y = 1f;
            drawTitle(rect);
            pos = new Vector2(2f, 25f);

            treeRect.x = pos.x;
            treeRect.y = pos.y;
            Rect sposition = new Rect(pos.x, pos.y, position.width - 5f, position.height - 30f);

            scrollPos = GUI.BeginScrollView(sposition, scrollPos, treeRect);
            pos       = drawTree(pos);
            GUI.EndScrollView();
            drawEvent();
            //treeRect.height += treeRect.height;
        }
Пример #3
0
        void drawRoot(GTimelineStyle root)
        {
            string rName = "保存-" + root.name;

            if (rootNode.isChange)
            {
                rName += "*";
            }
            if (GUILayout.Button(rName, GUILayout.MinHeight(30f)))
            {
                TimelineWindow.Save(root);
            }
            EditorGUILayout.BeginHorizontal();
            // root.name = EditorGUILayout.TextField(root.name);
            root.UpdateMode = (AnimatorUpdateMode)EditorGUILayout.EnumPopup(root.UpdateMode);
            GUILayout.Label("帧率:", EditorStyles.label);
            root.FrameRate = EditorGUILayout.IntField(root.FrameRate);
            GUILayout.Label("总帧数:", EditorStyles.label);
            root.End = EditorGUILayout.IntField(root.End);
            GUILayout.Label("t:" + root.LengthTime + "s", GUILayout.Width(30f));
            EditorGUILayout.EndHorizontal();
        }