Beispiel #1
0
 /// <summary>Open (if closed) or close (if opened) this item's branch immediately without activation modes</summary>
 public void OpenCloseBranchImmediately()
 {
     TSSItemBase.Activate(this, ActivationMode.openCloseBranchImmediately);
 }
Beispiel #2
0
        private void DrawControlPanel()
        {
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();

            if (SelectedItemsStateIsIdentical(item.state))
            {
                switch (item.state)
                {
                case ItemState.closed:
                    GUI.color = Color.red;
                    EditorGUILayout.LabelField(closedState, EditorStyles.boldLabel, TSSEditorUtils.max80pxWidth);
                    break;

                case ItemState.opening:
                    GUI.color = Color.yellow;
                    EditorGUILayout.LabelField(openingState, EditorStyles.boldLabel, TSSEditorUtils.max80pxWidth);
                    break;

                case ItemState.opened:
                    GUI.color = Color.green;
                    EditorGUILayout.LabelField(openedState, EditorStyles.boldLabel, TSSEditorUtils.max80pxWidth);
                    break;

                case ItemState.closing:
                    GUI.color = Color.yellow;
                    EditorGUILayout.LabelField(closingState, EditorStyles.boldLabel, TSSEditorUtils.max80pxWidth);
                    break;

                case ItemState.slave:
                    GUI.color = Color.cyan;
                    EditorGUILayout.LabelField(timelineState, EditorStyles.boldLabel, TSSEditorUtils.max80pxWidth);
                    break;
                }
            }
            else
            {
                GUI.color = Color.grey;
                EditorGUILayout.LabelField(mixedState, EditorStyles.boldLabel, TSSEditorUtils.max80pxWidth);
            }

            GUI.color = TSSEditorUtils.redColor;
            if (GUILayout.Button(TSSEditorTextures.itemRecordClose, EditorStyles.miniButtonLeft, TSSEditorUtils.fixedLineHeight, TSSEditorUtils.max40pxWidth))
            {
                Undo.RecordObject(item, "[TSS Item] recording closed state");
                item.Capture(ItemKey.closed); InvokeItemMethod("CloseImmediately");
            }

            GUI.color = TSSEditorUtils.greenColor;
            if (GUILayout.Button(TSSEditorTextures.itemRecordOpen, EditorStyles.miniButtonRight, TSSEditorUtils.fixedLineHeight, TSSEditorUtils.max40pxWidth))
            {
                Undo.RecordObject(item, "[TSS Item] recording closed state");
                item.Capture(ItemKey.opened); InvokeItemMethod("OpenImmediately");
            }

            GUI.color = TSSEditorUtils.redColor;
            if (GUILayout.Button(TSSEditorTextures.itemClose, EditorStyles.miniButtonLeft, TSSEditorUtils.fixedLineHeight, TSSEditorUtils.max40pxWidth))
            {
                Undo.RecordObject(item, "[TSS Item] to closed state");
                if (Application.isPlaying)
                {
                    InvokeItemMethod("CloseBranch");
                }
                else
                {
                    InvokeItemMethod("CloseBranchImmediately");
                }
            }

            GUI.color = TSSEditorUtils.greenColor;
            if (GUILayout.Button(TSSEditorTextures.itemOpen, EditorStyles.miniButtonRight, TSSEditorUtils.fixedLineHeight, TSSEditorUtils.max40pxWidth))
            {
                Undo.RecordObject(item, "[TSS Item] to opened state");
                if (Application.isPlaying)
                {
                    InvokeItemMethod("OpenBranch");
                }
                else
                {
                    InvokeItemMethod("OpenBranchImmediately");
                }
            }

            GUI.color = Color.white;

            if (item != TSSTimeLineEditor.item && GUILayout.Button(openOnTimeLineButton, TSSEditorUtils.fixedLineHeight, TSSEditorUtils.max80pxWidth))
            {
                EditorWindow window = EditorWindow.GetWindow(typeof(TSSTimeLineEditor), false);
                if (TSSTimeLineEditor.item == null)
                {
                    TSSTimeLineEditor.mode = TSSTimeLineEditor.Mode.open;
                }
                TSSTimeLineEditor.item   = item;
                window.titleContent.text = "TSS TimeLine";
                item.state = ItemState.slave;
            }

            if (item == TSSTimeLineEditor.item && GUILayout.Button(takeOfTimeLineButton, TSSEditorUtils.fixedLineHeight, TSSEditorUtils.max80pxWidth))
            {
                TSSTimeLineEditor.item = null;
                TSSItemBase.Activate(item, ActivationMode.closeBranchImmediately);
            }

            EditorGUILayout.EndHorizontal();

            GUILayout.Space(3);

            EditorGUILayout.BeginVertical();

            GUILayout.Space(3);

            EditorGUI.BeginDisabledGroup(item.parentChainMode);

            EditorGUILayout.BeginHorizontal();
            DrawItemProperty(item, "openDelay");
            DrawItemProperty(item, "closeDelay");
            EditorGUILayout.EndHorizontal();

            EditorGUI.EndDisabledGroup();

            EditorGUILayout.BeginHorizontal();
            DrawItemProperty(item, "openDuration");
            DrawItemProperty(item, "closeDuration");
            EditorGUILayout.EndHorizontal();

            bool ignoreChilds = item.ignoreChilds && ValuesIsIdentical(GetSelectedItemsValues <bool>("ignoreChilds"));

            //if (ignoreChilds || item.childItems.Count == 0) { EditorGUILayout.EndVertical(); return; }

            EditorGUILayout.BeginHorizontal();
            DrawItemProperty(item, "openChildBefore");
            DrawItemProperty(item, "closeChildBefore");
            EditorGUILayout.EndHorizontal();

            bool chainMode = false;

            EditorGUILayout.BeginHorizontal();
            DrawItemProperty(item, "childChainMode");
            chainMode = (item.childChainMode && ValuesIsIdentical(GetSelectedItemsValues <bool>("childChainMode")));
            if (chainMode)
            {
                DrawItemProperty(item, "brakeChainDelay");
            }
            EditorGUILayout.EndHorizontal();

            if (chainMode)
            {
                EditorGUILayout.BeginHorizontal();
                DrawItemProperty(item, "chainOpenDelay");
                DrawItemProperty(item, "chainCloseDelay");
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                DrawItemProperty(item, "firstChildOpenDelay");
                DrawItemProperty(item, "firstChildCloseDelay");
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                DrawItemProperty(item, "chainOpenDirection");
                DrawItemProperty(item, "chainCloseDirection");
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndVertical();
        }
Beispiel #3
0
 /// <summary>Open (if closed) or close (if opened) this item's branch without activation modes</summary>
 public void OpenCloseBranch()
 {
     TSSItemBase.Activate(this, ActivationMode.openCloseBranch);
 }
Beispiel #4
0
 /// <summary>Close only this item immediately without activation mode</summary>
 public void CloseImmediately()
 {
     TSSItemBase.Activate(this, ActivationMode.closeImmediately);
 }
Beispiel #5
0
 /// <summary>Open (if closed) or close (if opened) only this item without activation modes</summary>
 public void OpenCloseSingle()
 {
     TSSItemBase.Activate(this, ActivationMode.openClose);
 }
Beispiel #6
0
 /// <summary>Open only this item without activation mode</summary>
 public void OpenSinge()
 {
     TSSItemBase.Activate(this, ActivationMode.open);
 }
Beispiel #7
0
 /// <summary>Activate item with specified activation mode</summary>
 /// <param name="mode">activation mode</param>
 public void Activate(ActivationMode mode)
 {
     TSSItemBase.Activate(this, mode);
 }
Beispiel #8
0
 /// <summary>Close item with close activation mode (CloseBranch as default)</summary>
 public void Close()
 {
     TSSItemBase.Activate(this, activationClose);
 }
Beispiel #9
0
 /// <summary>Open item with open activation mode (OpenBranch as default)</summary>
 public void Open()
 {
     TSSItemBase.Activate(this, activationOpen);
 }