コード例 #1
0
    public override void OnInspectorGUI()
    {
        Predator3rdPersonalUnit PlayerPredatorUnit = this.target as Predator3rdPersonalUnit;

        if (UseBaseInspector = EditorGUILayout.BeginToggleGroup("Base Inspector", UseBaseInspector))
        {
            base.OnInspectorGUI();
        }
        EditorGUILayout.EndToggleGroup();

        if (UseAdvancedInspector = EditorGUILayout.BeginToggleGroup("Advanced Inspector", UseAdvancedInspector))
        {
            PlayerPredatorUnit = (Predator3rdPersonalUnit)EditorCommon.EditBasicUnitProperty(PlayerPredatorUnit);
            if (GUILayout.Button("Save change"))
            {
                EditorUtility.SetDirty(PlayerPredatorUnit.gameObject);
            }
            //Edit Idle Data
            if (EnableEditIdleData = EditorGUILayout.BeginToggleGroup("---Edit Idle Data", EnableEditIdleData))
            {
                PlayerPredatorUnit.IdleData = EditorCommon.EditIdleData(PlayerPredatorUnit.gameObject, PlayerPredatorUnit.IdleData);
            }
            EditorGUILayout.EndToggleGroup();

            //Edit Move Data
            if (EnableEditMoveData = EditorGUILayout.BeginToggleGroup("---Edit Move Data", EnableEditMoveData))
            {
                PlayerPredatorUnit.MoveData = EditorCommon.EditMoveData(PlayerPredatorUnit.gameObject, PlayerPredatorUnit.MoveData);
            }
            EditorGUILayout.EndToggleGroup();

            //Edit Jump Data
            if (EnableEditJumpData = EditorGUILayout.BeginToggleGroup("---Edit Jump Data", EnableEditJumpData))
            {
                PlayerPredatorUnit.JumpData = EditJumpData(PlayerPredatorUnit.gameObject, PlayerPredatorUnit.JumpData);
            }
            EditorGUILayout.EndToggleGroup();

            //Edit PredatorPlayerAttackData array
            if (EnableEditAttackData = EditorGUILayout.BeginToggleGroup("---Edit Predator Attack Data", EnableEditAttackData))
            {
                PlayerPredatorUnit.PredatorAttackData = EditPredatorPlayerAttackDataArray(PlayerPredatorUnit, PlayerPredatorUnit.PredatorAttackData);
            }
            EditorGUILayout.EndToggleGroup();

            //Edit attack basic variables
            if (EnableEditCombatData = EditorGUILayout.BeginToggleGroup("---Edit attack variables", EnableEditCombatData))
            {
                PlayerPredatorUnit.RushRadius = EditorGUILayout.FloatField(new GUIContent("Rush radius:", "Inside rush radius, predator rush to the target"), PlayerPredatorUnit.RushRadius);
//				PlayerPredatorUnit.AttackAnimationLayer = EditorGUILayout.IntField ("Attack animation layer:", PlayerPredatorUnit.AttackAnimationLayer);
                PlayerPredatorUnit.CombatCoolDown = EditorGUILayout.FloatField("common combat cooldown:", PlayerPredatorUnit.CombatCoolDown);
                //Edit attack animation array
//				if (EnableEditAttackAnimation = EditorGUILayout.BeginToggleGroup ("    ----- Edit attack animation string array ----", EnableEditAttackAnimation)) {
//					PlayerPredatorUnit.AttackAnimations = EditorCommon.EditStringArray ("All attack animation:",
//				                                                                    PlayerPredatorUnit.AttackAnimations,
//				                                                                    EditorCommon.GetAnimationNames (PlayerPredatorUnit.gameObject));
//				}
//				EditorGUILayout.EndToggleGroup ();

                //Edit default combat - left claw
                if (EnableEditDefaultLeftClawCombat = EditorGUILayout.BeginToggleGroup("  ---Edit default combat : left claw", EnableEditDefaultLeftClawCombat))
                {
                    PlayerPredatorUnit.DefaultCombat_LeftClaw = Editor_Predator3rdPersonalUnit.EditCombat(
                        "Edit default left claw combat:",
                        PlayerPredatorUnit,
                        PlayerPredatorUnit.DefaultCombat_LeftClaw);
                    PlayerPredatorUnit.DefaultCombat_LeftClaw.userInput = UserInputType.Button_Left_Claw_Tap;
                }
                EditorGUILayout.EndToggleGroup();

                //Edit default combat - right claw
                if (EnableEditDefaultRightClawCombat = EditorGUILayout.BeginToggleGroup("  ---Edit default combat : right claw", EnableEditDefaultRightClawCombat))
                {
                    PlayerPredatorUnit.DefaultCombat_RightClaw = Editor_Predator3rdPersonalUnit.EditCombat(
                        "Edit default right claw combat:",
                        PlayerPredatorUnit,
                        PlayerPredatorUnit.DefaultCombat_RightClaw);
                    PlayerPredatorUnit.DefaultCombat_RightClaw.userInput = UserInputType.Button_Right_Claw_Tap;
                }
                EditorGUILayout.EndToggleGroup();

                //Edit default combat - dual claw
                if (EnableEditDefaultDualClawCombat = EditorGUILayout.BeginToggleGroup("  ---Edit default combat : dual claw", EnableEditDefaultDualClawCombat))
                {
                    PlayerPredatorUnit.DefaultCombat_DualClaw = Editor_Predator3rdPersonalUnit.EditCombat(
                        "Edit default dual claw combat:",
                        PlayerPredatorUnit,
                        PlayerPredatorUnit.DefaultCombat_DualClaw);
                    PlayerPredatorUnit.DefaultCombat_DualClaw.userInput = UserInputType.Button_Dual_Claw_Tap;
                }
                EditorGUILayout.EndToggleGroup();

                //Edit ComboCombat Data
                if (EnableEditComboCombatData = EditorGUILayout.BeginToggleGroup("    ---Edit ComboCombat Data---", EnableEditComboCombatData))
                {
                    PlayerPredatorUnit.ComboCombat = Editor_Predator3rdPersonalUnit.EditComboCombatData(
                        PlayerPredatorUnit,
                        PlayerPredatorUnit.ComboCombat);
                }
                EditorGUILayout.EndToggleGroup();
            }
            EditorGUILayout.EndToggleGroup();

            //Edit Effect Data
            if (EnableEditEffectData = EditorGUILayout.BeginToggleGroup("---Edit Effect Data---", EnableEditEffectData))
            {
                PlayerPredatorUnit.EffectData = EditPlayerEffectDataArray(PlayerPredatorUnit.gameObject,
                                                                          PlayerPredatorUnit.EffectData);
            }
            EditorGUILayout.EndToggleGroup();
            //Edit Audio Data
            if (EnableEditAudioData = EditorGUILayout.BeginToggleGroup("---Edit Audio Data---", EnableEditAudioData))
            {
                PlayerPredatorUnit.AudioData = EditAudioDataArray(PlayerPredatorUnit.gameObject,
                                                                  PlayerPredatorUnit.AudioData);
            }
            EditorGUILayout.EndToggleGroup();
        }
        EditorGUILayout.EndToggleGroup();
    }