public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            int countAll, countActive;

            GUILayout.Label("ObjectPool State: Active/All", EditorStyles.boldLabel);
            ActionNodeAction.GetObjectPoolInfo(out countActive, out countAll);
            GUILayout.Label(string.Format("ActionNode: {0}/{1}", countActive, countAll));
            ActionNodeInterval.GetObjectPoolInfo(out countActive, out countAll);
            GUILayout.Label(string.Format("IntervalNode: {0}/{1}", countActive, countAll));
            ActionNodeCondition.GetObjectPoolInfo(out countActive, out countAll);
            GUILayout.Label(string.Format("ConditionNode: {0}/{1}", countActive, countAll));
            ActionSequence.GetObjectPoolInfo(out countActive, out countAll);
            GUILayout.Label(string.Format("Sequence: {0}/{1}", countActive, countAll));

            //Showing ActionSequences in progress
            ActionSequenceSystem actionSequenceSystem = target as ActionSequenceSystem;

            GUILayout.Label(string.Format("Sequence Count: {0}", actionSequenceSystem.ListSequence.Count), EditorStyles.boldLabel);
            for (int i = 0; i < actionSequenceSystem.ListSequence.Count; i++)
            {
                if (!actionSequenceSystem.ListSequence[i].isFinshed)
                {
                    GUILayout.Box(string.Format("{0} id: {1}\n Loop:{2}/{3}", i, actionSequenceSystem.ListSequence[i].id,
                                                actionSequenceSystem.ListSequence[i].cycles, actionSequenceSystem.ListSequence[i].loopTime), "TextArea");
                }
            }

            Repaint();
        }
示例#2
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            int countAll, countActive;

            GUILayout.Label("ObjectPool State: Active/All", EditorStyles.boldLabel);
            ActionNodeAction.GetObjectPoolInfo(out countActive, out countAll);
            GUILayout.Label(string.Format("ActionNode: {0}/{1}", countActive, countAll));
            ActionNodeInterval.GetObjectPoolInfo(out countActive, out countAll);
            GUILayout.Label(string.Format("IntervalNode: {0}/{1}", countActive, countAll));
            ActionNodeWaitFor.GetObjectPoolInfo(out countActive, out countAll);
            GUILayout.Label(string.Format("ConditionNode: {0}/{1}", countActive, countAll));
            ActionNodeSetActive.GetObjectPoolInfo(out countActive, out countAll);
            GUILayout.Label(string.Format("HideNode: {0}/{1}", countActive, countAll));
            ActionSequence.GetObjectPoolInfo(out countActive, out countAll);
            GUILayout.Label(string.Format("Sequence: {0}/{1}", countActive, countAll));

            //Showing ActionSequences in progress
            ActionSequenceSystem actionSequenceSystem = target as ActionSequenceSystem;

            GUILayout.Label(string.Format("Sequence Count: {0}", actionSequenceSystem.ListSequenceAlive.Count), EditorStyles.boldLabel);
            for (int i = 0; i < actionSequenceSystem.ListSequenceAlive.Count; i++)
            {
                ActionSequence sequence = actionSequenceSystem.ListSequenceAlive[i];

                //if (!sequence.isFinshed)
                //{
                if (sequence.loopTime == 0) //It's a delayer
                {
                    GUILayout.Box(string.Format("  ID: {0}\n  Time({1:F2})", sequence.id, sequence.timeAxis), "TextArea");
                }
                else if (sequence.loopTime < 0) //It's a infinite looper
                {
                    GUILayout.Box(string.Format("  ID: {0}\n  Time({1:F2})   Loop({2}/{3})   Node[{4}]", sequence.id, sequence.timeAxis,
                                                sequence.cycles, sequence.loopTime, sequence.nodes.Count), "TextArea");
                }
                else //It's a count looper
                {
                    GUILayout.Box(string.Format("  ID: {0}\n  Time({1:F2})   Loop({2}/{3})   Node[{4}]", sequence.id, sequence.timeAxis,
                                                sequence.cycles, sequence.loopTime + 1, sequence.nodes.Count), "TextArea");
                }

                //}
            }

            Repaint();
        }
 /// <summary>
 /// 增加一个运行节点
 /// </summary>
 /// <param name="interval">时间间隔</param>
 /// <returns></returns>
 public ActionSequence Interval(float interval)
 {
     nodes.Add(ActionNodeInterval.Get(interval));
     return(this);
 }