Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            gF = (GuiFader_v2)target;
            wo = gF.winOptions;
            if (wo != null)
            {
                ShowPropertiesBox(new string[] { "backGround", "guiPanel", "guiMask" }, true);
                woSP = serializedObject.FindProperty("winOptions");
                if (woSP != null)
                {
                    BeginBox();

                    ShowProperties(new SerializedProperty[] {
                        woSP.FindPropertyRelative("instantiatePosition")
                    }, true);

                    if (wo.instantiatePosition == Position.CustomPosition)
                    {
                        EditorGUI.indentLevel += 1;
                        ShowProperties(new SerializedProperty[] {
                            woSP.FindPropertyRelative("position"),
                            // woSP.FindPropertyRelative("rectPosition")
                        }, true);
                        EditorGUI.indentLevel -= 1;
                    }

                    EditorGUILayout.Space();
                    EditorGUILayout.Space();

                    ShowProperties(new SerializedProperty[] {
                        woSP.FindPropertyRelative("inAnim"), woSP.FindPropertyRelative("inEase")
                    }, true);

                    switch (wo.inAnim)
                    {
                    case WinAnimType.AlphaFade:
                        ShowProperties(new SerializedProperty[] {
                            woSP.FindPropertyRelative("inFadeAnim")
                        }, true);
                        break;

                    case WinAnimType.Move:
                        if (wo.inMoveAnim.toPosition == Position.CustomPosition)
                        {
                            ShowProperties(new SerializedProperty[] {
                                woSP.FindPropertyRelative("inMoveAnim")
                            }, true);
                        }
                        else
                        {
                            SerializedProperty inAnSP = woSP.FindPropertyRelative("inMoveAnim");
                            ShowProperties(new SerializedProperty[] {
                                inAnSP.FindPropertyRelative("toPosition"),
                                inAnSP.FindPropertyRelative("time"),
                            },

                                           true);
                        }

                        break;

                    case WinAnimType.Scale:
                        ShowProperties(new SerializedProperty[] {
                            woSP.FindPropertyRelative("inScaleAnim")
                        }, true);
                        break;
                    }
                    EndBox();

                    EditorGUILayout.Space();
                    BeginBox();
                    ShowProperties(new SerializedProperty[] {
                        woSP.FindPropertyRelative("outAnim"), woSP.FindPropertyRelative("outEase")
                    }, true);

                    switch (wo.outAnim)
                    {
                    case WinAnimType.AlphaFade:
                        ShowProperties(new SerializedProperty[] {
                            woSP.FindPropertyRelative("outFadeAnim")
                        }, true);
                        break;

                    case WinAnimType.Move:
                        if (wo.outMoveAnim.toPosition == Position.CustomPosition)
                        {
                            ShowProperties(new SerializedProperty[] {
                                woSP.FindPropertyRelative("outMoveAnim")
                            }, true);
                        }
                        else
                        {
                            SerializedProperty outAnSP = woSP.FindPropertyRelative("outMoveAnim");
                            ShowProperties(new SerializedProperty[] {
                                outAnSP.FindPropertyRelative("toPosition"),
                                outAnSP.FindPropertyRelative("time"),
                            },
                                           true);
                        }
                        break;

                    case WinAnimType.Scale:
                        ShowProperties(new SerializedProperty[] {
                            woSP.FindPropertyRelative("outScaleAnim")
                        }, true);
                        break;
                    }
                    EndBox();
                }
            }
            // DrawDefaultInspector();

            serializedObject.ApplyModifiedProperties();
        }