示例#1
0
        public override bool OnInspectorDraw(PInspectorCore insp, params object[] arg)
        {
            FireFxTreeDebuger d = arg.Length > 0 ? arg[0] as FireFxTreeDebuger : null;

            switch (insp.propertyName)
            {
            case "anim":
                DrawAnim(d, insp as Insp_TextInput);
                return(true);

            case "paramName":
                DrawParameter(d, insp as Insp_TextInput);
                return(true);

            case "paramValue":
                return(DrawParamValue(insp as Insp_Float));

            case "paramType":
                return(animTarget == AnimatorTarget.Host);

            case "bone":
                DrawBone(d, insp as Insp_TextInput);
                return(true);

            case "autoBlock":
                return(actionType != AnimatorActionType.Play);
            }
            return(false);
        }
示例#2
0
        public override bool OnInspectorDraw(PInspectorCore insp, params object[] arg)
        {
            FireFxTreeDebuger d = arg.Length > 0 ? arg[0] as FireFxTreeDebuger : null;

            if (insp.propertyName == "boneName")
            {
                DrawBone(d, insp as Insp_TextInput);
                return(true);
            }
            return(false);
        }
        public override void OnInspectorGUI()
        {
            EditorGUI.BeginChangeCheck();
            _debuger.hero = (GameObject)EditorGUILayout.ObjectField("Host", _debuger.hero, typeof(GameObject), true);
            if (EditorGUI.EndChangeCheck())
            {
                UpdateHost();
            }
            EditorGUI.BeginChangeCheck();
            _listDrawer.Draw(serializedObject);
            FireFxCanvas canvas = TreeCenter.currCanvas as FireFxCanvas;

            if (canvas != null)
            {
                TreeCell main = TreeCenter.selection.main;
                if (main != null)
                {
                    EditStyles.DrawHorizontalSeperator();
                    GUILayout.Label("Current Cell : " + main.cellType, EditStyles.boldLabel);
                    PInspectorCore[] ps = main.GetProperties();
                    PInspectorCore.BeginLabelWidth(ps);
                    EditorGUI.BeginChangeCheck();
                    GUILayout.BeginHorizontal();
                    GUILayout.Label("Name", GUILayout.Width(PInspectorCore.labelWidth));
                    main.editName = EditorGUILayout.DelayedTextField(main.editName);
                    GUILayout.EndHorizontal();
                    if (EditorGUI.EndChangeCheck())
                    {
                        PPaintCenter.RepaintClients();
                    }
                    PInspectorCore.useLabelString = TreeCenter.useChn;
                    for (int i = 0; i < ps.Length; i++)
                    {
                        if (!main.OnInspectorDraw(ps[i], _debuger) && !ps[i].hideInInspector)
                        {
                            ps[i].Draw();
                        }
                        main.AfterInspectorDraw(ps[i]);
                    }
                    PInspectorCore.useLabelString = false;
                    PInspectorCore.EndLabelWidth();
                }
                if (Application.isPlaying)
                {
                    if (main != null)
                    {
                        EditStyles.DrawHorizontalSeperator();
                    }
                    GUILayout.Space(10);
                    GUILayout.BeginHorizontal();
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("Play", GUILayout.Width(100)))
                    {
                        _debuger.Play(canvas);
                    }
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();
                }
            }
            if (EditorGUI.EndChangeCheck())
            {
                EditorUtility.SetDirty(_debuger);
            }
        }