Esempio n. 1
0
 void drawRotateGUI()
 {
     AraleEditorTool.BeginContents();
     EditorGUILayout.BeginHorizontal();
     if (GUILayout.Button(mAIBone.xMin == 0 ? "xMin" : mAIBone.xMin.ToString(), GUILayout.Width(80)))
     {
         mAIBone.xMin = mAIBone.transform.localRotation.eulerAngles.x;
     }
     if (GUILayout.Button(mAIBone.xMax == 0 ? "xMax" : mAIBone.xMax.ToString(), GUILayout.Width(80)))
     {
         mAIBone.xMax = mAIBone.transform.localRotation.eulerAngles.x;
     }
     EditorGUILayout.EndHorizontal();
     EditorGUILayout.BeginHorizontal();
     if (GUILayout.Button(mAIBone.yMin == 0 ? "yMin" : mAIBone.yMin.ToString(), GUILayout.Width(80)))
     {
         mAIBone.yMin = mAIBone.transform.localRotation.eulerAngles.y;
     }
     if (GUILayout.Button(mAIBone.yMax == 0 ? "yMax" : mAIBone.yMax.ToString(), GUILayout.Width(80)))
     {
         mAIBone.yMax = mAIBone.transform.localRotation.eulerAngles.y;
     }
     EditorGUILayout.EndHorizontal();
     EditorGUILayout.BeginHorizontal();
     if (GUILayout.Button(mAIBone.zMin == 0 ? "zMin" : mAIBone.zMin.ToString(), GUILayout.Width(80)))
     {
         mAIBone.zMin = mAIBone.transform.localRotation.eulerAngles.z;
     }
     if (GUILayout.Button(mAIBone.zMax == 0 ? "zMax" : mAIBone.zMax.ToString(), GUILayout.Width(80)))
     {
         mAIBone.zMax = mAIBone.transform.localRotation.eulerAngles.z;
     }
     EditorGUILayout.EndHorizontal();
     AraleEditorTool.EndContents();
 }
Esempio n. 2
0
 void drawLengthGUI()
 {
     AraleEditorTool.BeginContents();
     EditorGUILayout.BeginHorizontal();
     if (GUILayout.Button(mAIBone.length > 0?"解锁":"锁定", GUILayout.Width(80)))
     {
         onLockLengthClick();
     }
     EditorGUILayout.LabelField("length", GUILayout.Width(30));
     mAIBone.length = EditorGUILayout.FloatField(mAIBone.length);
     EditorGUILayout.LabelField("min", GUILayout.Width(30));
     mAIBone.minLength = EditorGUILayout.FloatField(mAIBone.minLength);
     EditorGUILayout.LabelField("max", GUILayout.Width(30));
     mAIBone.maxLength = EditorGUILayout.FloatField(mAIBone.maxLength);
     mAIBone.length    = Mathf.Clamp(mAIBone.length, mAIBone.minLength, mAIBone.maxLength);
     EditorGUILayout.EndHorizontal();
     AraleEditorTool.EndContents();
 }
 // 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();
     }
 }
Esempio n. 4
0
    public override void OnInspectorGUI()
    {
        AraleEditorTool.BeginContents();
        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("设置为根", GUILayout.Width(80)))
        {
            onRootClick();
        }
        if (GUILayout.Button("骨骼分裂", GUILayout.Width(80)))
        {
            onDivideClick();
        }
        EditorGUILayout.EndHorizontal();
        AraleEditorTool.EndContents();

        drawLengthGUI();
        drawRotateGUI();
        refreshSceneView();
    }
        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();
            }
        }