// Update is called once per frame public override void OnInspectorGUI() { mAnimAction.mActionName = EditorGUILayout.TextField("ActionName", mAnimAction.mActionName); if (AraleEditorTool.DrawHeader("action-info", "ACTION-INFO")) { AraleEditorTool.BeginContents(); for (int i = 0; i < mAnimAction.actions.Count; ++i) { drawActionInspector(i); } GUILayout.Space(10); if (GUILayout.Button("添加", GUILayout.Width(80))) { onAddClick(); } AraleEditorTool.EndContents(); } }
void drawActionInspector(int idx) { AnimAction.Action action = mAnimAction.actions[idx]; if (AraleEditorTool.DrawHeader("" + idx + ":" + action.mType, "ACTION" + idx)) { AraleEditorTool.BeginContents(); action.mType = (AnimAction.ActionType)EditorGUILayout.EnumPopup("类型", action.mType); action.mMask = (AnimAction.ActionMask)EditorGUILayout.EnumMaskField("过滤器", action.mMask); action.mEnable = EditorGUILayout.Toggle("是否可用", action.mEnable); switch (action.mType) { case AnimAction.ActionType.Event: drawEventAction(action); break; case AnimAction.ActionType.Move: drawMoveAction(action); break; case AnimAction.ActionType.Scale: drawScaleAction(action); break; case AnimAction.ActionType.Rotate: drawRotateAction(action); break; case AnimAction.ActionType.Alpha: drawAlphaAction(action); break; default: break; } if (GUILayout.Button("删除", GUILayout.Width(80))) { onDelClick(idx); } AraleEditorTool.EndContents(); } }