Example #1
0
        public void DrawActions()
        {
            var actions = state.FsmActions <XFsmActionComponent>();

            if (null != actions)
            {
                for (int pos = 0; pos < actions.Count; pos++)
                {
                    //  TODO loop in state.actions.Count

                    if (CreateSpaceButton((actions[pos] as XFsmActionComponent).name))
                    {
                        if (actionID == pos)
                        {
                            actionID = -1;
                        }
                        else
                        {
                            actionID = pos;
                        }
                    }
                    if (pos == actionID)
                    {
                        DrawProperty(new SerializedObject(actions[actionID] as XFsmActionComponent));
                        if (CreateSpaceButton("Delete"))
                        {
                            actions.RemoveAt(actionID);
                            actionID = -1;
                        }
                    }
                }
            }
        }