Ejemplo n.º 1
0
        public override void OnGUI(PlayerDef Data)
        {
            base.OnGUI(Data);

            foldout_AttributeGrow = EditorGUILayout.Foldout(foldout_AttributeGrow, "成长率");
            if (foldout_Attribute)
            {
                EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(Screen.width - 16));
                EditorGUILayout.Space();
                EditorGUILayout.BeginVertical();

                Data.DefaultAttributeGrow.HP              = EditorGUILayout.IntSlider("HP", Data.DefaultAttributeGrow.HP, 0, RPGEditorGlobal.MAX_ATTRIBUTE_HP);
                Data.DefaultAttributeGrow.PhysicalPower   = EditorGUILayout.IntSlider("物理攻击", Data.DefaultAttributeGrow.PhysicalPower, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                Data.DefaultAttributeGrow.MagicalPower    = EditorGUILayout.IntSlider("魔法攻击", Data.DefaultAttributeGrow.MagicalPower, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                Data.DefaultAttributeGrow.Skill           = EditorGUILayout.IntSlider("技术", Data.DefaultAttributeGrow.Skill, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                Data.DefaultAttributeGrow.Speed           = EditorGUILayout.IntSlider("速度", Data.DefaultAttributeGrow.Speed, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                Data.DefaultAttributeGrow.Intel           = EditorGUILayout.IntSlider("智力", Data.DefaultAttributeGrow.Intel, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                Data.DefaultAttributeGrow.PhysicalDefense = EditorGUILayout.IntSlider("物理防御", Data.DefaultAttributeGrow.PhysicalDefense, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                Data.DefaultAttributeGrow.MagicalDefense  = EditorGUILayout.IntSlider("魔法防御", Data.DefaultAttributeGrow.MagicalDefense, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                Data.DefaultAttributeGrow.BodySize        = EditorGUILayout.IntSlider("体格", Data.DefaultAttributeGrow.BodySize, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                Data.DefaultAttributeGrow.Movement        = EditorGUILayout.IntSlider("移动", Data.DefaultAttributeGrow.Movement, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MOVEMENT);

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            RPGEditorGUI.DynamicArrayView(ref weaponCount, ref Data.DefaultWeapons, "初始武器", "武器", RPGData.WeaponNameList.ToArray(), EnumTables.GetSequentialArray(RPGData.WeaponNameList.Count), 5);
            RPGEditorGUI.DynamicArrayView(ref skillCount, ref Data.DefaultSkills, "初始技能", "技能", 10);

            Data.DeadSpeech  = EditorGUILayout.TextField("战败话语", Data.DeadSpeech);
            Data.LeaveSpeech = EditorGUILayout.TextField("战败话语", Data.LeaveSpeech);
        }
Ejemplo n.º 2
0
 public void OnGUI()
 {
     EditorGUILayout.BeginHorizontal();
     {
         selected = RPGEditorGUI.MenuHorizontal(selected, MenuItems);
     }
     EditorGUILayout.EndHorizontal();
     EditorGUILayout.Space();
     if (windows.Count == 0)
     {
         return;
     }
     windows[selected].OnGUI();
     GUILayout.FlexibleSpace();
 }
Ejemplo n.º 3
0
        public override void OnInspectorGUI()
        {
            Rect blockLabelRect = new Rect(120, 5, 120, 55);

            EditorGUI.LabelField(blockLabelRect, new GUIContent("章节"), RPGEditorGUI.Head1Style);

            if (chapter.Icon != null)
            {
                EditorGUI.DrawPreviewTexture(new Rect(5, 5, 37, 37), chapter.Icon.texture);
            }

            chapter.CommonProperty.ID          = EditorGUILayout.IntField(guiContent_ID, chapter.CommonProperty.ID);
            chapter.CommonProperty.Name        = EditorGUILayout.TextField(guiContent_Name, chapter.CommonProperty.Name);
            chapter.CommonProperty.Description = EditorGUILayout.TextField(guiContent_Desc, chapter.CommonProperty.Description);

            chapter.Icon           = (Sprite)EditorGUILayout.ObjectField("图标", chapter.Icon, typeof(Sprite), false);
            chapter.TeamIndex      = EditorGUILayout.IntSlider("所属队伍", chapter.TeamIndex, 0, ConstTable.TEAM_COUNT - 1);
            chapter.MaxPlayerCount = EditorGUILayout.IntSlider("最大出场人数", chapter.MaxPlayerCount, 1, ConstTable.CONST_MAX_BATTLE_PLAYER_COUNT);
            string[] displayPlayerNames = RPGData.PlayerNameList.ToArray();
            int[]    valuePlayerNames   = EnumTables.GetSequentialArray(RPGData.PlayerNameList.Count);
            RPGEditorGUI.DynamicArrayView(ref forceInvolveCount, ref chapter.ForceInvolve, "强制出场人数", "强制出场人物", displayPlayerNames, valuePlayerNames, chapter.MaxPlayerCount);

            chapter.Weather     = (EnumWeather)EditorGUILayout.EnumPopup("默认天气", chapter.Weather);
            chapter.Preparation = EditorGUILayout.Toggle("是否有准备画面", chapter.Preparation);
            chapter.BrokeWallHP = EditorGUILayout.IntField("破坏墙壁的HP", chapter.BrokeWallHP);
            WinConditionInspectorGUI(chapter.WinCondition);
            FailConditionInspectorGUI(chapter.FailCondition);

            foldout_BGM = EditorGUILayout.Foldout(foldout_BGM, "BGM设定");
            if (foldout_BGM)
            {
                for (int i = 0; i < bgmType.Length; i++)
                {
                    chapter.BGMSetting[i] = EditorGUILayout.IntPopup(bgmType[i], chapter.BGMSetting[i], AudioPreviewWindow.BGMList, EnumTables.GetSequentialArray(AudioPreviewWindow.BGMList.Length));
                }
            }
            RPGEditorGUI.DynamicArrayView(ref weaponRoomCount, ref chapter.WeaponRoom, "武器屋", "武器", RPGData.WeaponNameList.ToArray(), EnumTables.GetSequentialArray(RPGData.WeaponNameList.Count));
            RPGEditorGUI.DynamicArrayView(ref propRoomCount, ref chapter.PropRoom, "道具屋", "道具", RPGData.PropNameList.ToArray(), EnumTables.GetSequentialArray(RPGData.PropNameList.Count));

            chapter.Event = (SLGChapter)EditorGUILayout.ObjectField("章节事件", chapter.Event, typeof(SLGChapter), false);

            if (GUI.changed)
            {
                EditorUtility.SetDirty(target);
            }
        }
Ejemplo n.º 4
0
 public void ShowPlayList(List <string> clips)
 {
     scroll[0] = RPGEditorGUI.BeginScrollView(scroll[0], GUILayout.Width(150));
     {
         for (int i = 0; i < clips.Count; i++)
         {
             string fileName = System.IO.Path.GetFileNameWithoutExtension(clips[i]);
             if (GUILayout.Button(fileName, RPGEditorGUI.RichLabelStyle, GUILayout.Width(120)))
             {
                 curSong = fileName;
                 AudioUtil.StopAllClips();
                 AudioUtil.PlayClip(AssetDatabase.LoadAssetAtPath <AudioClip>(clips[i]));
             }
         }
     }
     RPGEditorGUI.EndScrollView();
 }
Ejemplo n.º 5
0
 void OnGUI()
 {
     EditorGUILayout.BeginHorizontal();
     if (GUILayout.Button("刷新数据", GUILayout.Width(120)))
     {
         RPGData.LoadDefAssetAtPath <EnemyDef>(ref EnemyDefList, EnemyDefEditor.DIRECTORY_PATH, "asset");
     }
     EditorGUILayout.Space();
     if (GUILayout.Button("确定", GUILayout.Width(120)))
     {
         if (!IsValidUnit())
         {
             EditorUtility.DisplayDialog("无效坐标", "插入的坐标已经存在或格式不正确", "OK");
             return;
         }
         if (!m_bMedify)
         {
             UnitSetting.Units.Add(unit);
         }
         else
         {
             EnemyUnitSetting.EnemyUnit previousUnit = UnitSetting.GetUnit(new Vector2Int(previousX, previousY));
             int i = UnitSetting.Units.IndexOf(previousUnit);
             if (i >= 0)
             {
                 UnitSetting.Units.RemoveAt(i);
                 UnitSetting.Units.Insert(i, new EnemyUnitSetting.EnemyUnit(unit.Coord, unit.Enemy));
             }
         }
         Close();
     }
     EditorGUILayout.Space();
     if (GUILayout.Button("取消", GUILayout.Width(120)))
     {
         Close();
     }
     EditorGUILayout.EndHorizontal();
     EditorGUILayout.Space();
     EditorGUILayout.BeginHorizontal();
     ShowEnemyDefList();
     RPGEditorGUI.DrawVerticalLine(2, Color.black);
     ShowEnemyDefContent();
     EditorGUILayout.EndHorizontal();
     Undo.RecordObject(UnitSetting, "EnemyUnitSetting");
 }
Ejemplo n.º 6
0
 public override void OnInspectorGUI()
 {
     _target.Camp  = (EnumCharacterCamp)EditorGUILayout.EnumPopup("阵营", _target.Camp);
     _target.ID    = EditorGUILayout.IntField("人物ID", _target.ID);
     _target.Coord = EditorGUILayout.Vector2IntField("坐标", _target.Coord);
     if (_target.Camp == EnumCharacterCamp.Enemy)
     {
         RPGEditorGUI.DynamicArrayView(ref weaponCount, ref _target.Items, "初始武器", "武器", RPGData.WeaponNameList.ToArray(), EnumTables.GetSequentialArray(RPGData.WeaponNameList.Count), 5);
     }
     _target.UseDefaultAttribute = EditorGUILayout.Toggle("使用默认属性", _target.UseDefaultAttribute);
     if (!_target.UseDefaultAttribute)
     {
         CharacterDefEditor.CharacterAttributeInspector(ref _target.Attribute, ref foldOut);
     }
     if (GUI.changed)
     {
         serializedObject.ApplyModifiedProperties();
     }
 }
Ejemplo n.º 7
0
        public static int MenuHorizontal(int selected, string[] menuItems, params GUILayoutOption[] options)
        {
            if (selected >= menuItems.Length || selected < 0)
            {
                selected = 0;
            }
            EditorGUILayout.BeginHorizontal(MenuBoxStyle, options);
            {
                GUILayout.Space(20);

                for (int i = 0; i < menuItems.Length; i++)
                {
                    if (string.IsNullOrEmpty(menuItems[i]))
                    {
                        GUILayout.Space(15); continue;
                    }

                    if (menuItems[i][0] == '-')
                    {
                        if (menuItems[i].Length > 1)
                        {
                            GUILayout.Label(menuItems[i].Substring(1), RPGEditorGUI.MenuHeadStyle);
                        }
                        else
                        {
                            RPGEditorGUI.DrawVerticalLine(1, RPGEditorGUI.DividerColor, 5, 5);
                        }
                        continue;
                    }

                    if (GUILayout.Toggle((i == selected), menuItems[i], RPGEditorGUI.ButtonStyle))
                    {
                        selected = i;
                    }
                }

                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();
            return(selected);
        }
Ejemplo n.º 8
0
        public void OnGUI()
        {
            EditorGUILayout.BeginHorizontal();
            {
                selected = RPGEditorGUI.MenuHorizontal(selected, MenuItems);
            }
            EditorGUILayout.EndHorizontal();

            scroll[1] = EditorGUILayout.BeginScrollView(scroll[1]);
            {
                switch (selected)
                {
                case 0: ShowContent(bgmNameList); break;

                case 1: ShowContent(bgsNameList); break;

                case 2: ShowContent(meNameList); break;

                case 3: ShowContent(seNameList); break;
                }
                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndScrollView();
        }
Ejemplo n.º 9
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            /*Rect blockLabelRect = new Rect(60, 5, 120, 55);
             * EditorGUI.LabelField(blockLabelRect, new GUIContent("人物"), RPGEditorGUI.Head1Style);
             *
             * if (player.Portrait != null)
             *  EditorGUI.DrawPreviewTexture(new Rect(5, 5, 37, 37), player.Portrait.texture);
             *
             * player.CommonProperty.ID = EditorGUILayout.IntField(guiContent_ID, player.CommonProperty.ID);
             * player.CommonProperty.Name = EditorGUILayout.TextField(guiContent_Name, player.CommonProperty.Name);
             * player.CommonProperty.Description = EditorGUILayout.TextField(guiContent_Desc, player.CommonProperty.Description);
             *
             * player.Portrait = (Sprite)EditorGUILayout.ObjectField("图标", player.Portrait, typeof(Sprite), false);
             * player.BattleModel = EditorGUILayout.ObjectField("人物模型", player.BattleModel, typeof(GameObject), true) as GameObject;
             * player.CharacterImportance = (EnumCharacterImportance)EditorGUILayout.EnumPopup("重要性", player.CharacterImportance);
             * player.Career = EditorGUILayout.IntPopup("职业", player.Career, RPGData.CareerNameList.ToArray(), EnumTables.GetSequentialArray(RPGData.CareerNameList.Count));
             * player.DefaultLevel = EditorGUILayout.IntSlider("初始等级", player.DefaultLevel, 1, 40);
             *
             * foldout_Attribute = EditorGUILayout.Foldout(foldout_Attribute, "初始属性");
             * if (foldout_Attribute)
             * {
             *  EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(Screen.width - 16));
             *  EditorGUILayout.Space();
             *  EditorGUILayout.BeginVertical();
             *
             *  player.DefaultAttribute.HP = EditorGUILayout.IntSlider("HP", player.DefaultAttribute.HP, 0, RPGEditorGlobal.MAX_ATTRIBUTE_HP);
             *  player.DefaultAttribute.PhysicalPower = EditorGUILayout.IntSlider("物理攻击", player.DefaultAttribute.PhysicalPower, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
             *  player.DefaultAttribute.MagicalPower = EditorGUILayout.IntSlider("魔法攻击", player.DefaultAttribute.MagicalPower, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
             *  player.DefaultAttribute.Skill = EditorGUILayout.IntSlider("技术", player.DefaultAttribute.Skill, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
             *  player.DefaultAttribute.Speed = EditorGUILayout.IntSlider("速度", player.DefaultAttribute.Speed, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
             *  player.DefaultAttribute.Lucky = EditorGUILayout.IntSlider("智力", player.DefaultAttribute.Lucky, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
             *  player.DefaultAttribute.PhysicalDefense = EditorGUILayout.IntSlider("物理防御", player.DefaultAttribute.PhysicalDefense, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
             *  player.DefaultAttribute.MagicalDefense = EditorGUILayout.IntSlider("魔法防御", player.DefaultAttribute.MagicalDefense, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
             *  player.DefaultAttribute.Movement = EditorGUILayout.IntSlider("移动", player.DefaultAttribute.Movement, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MOVEMENT);
             *
             *  EditorGUILayout.EndVertical();
             *  EditorGUILayout.EndHorizontal();
             * }*/

            foldout_AttributeGrow = EditorGUILayout.Foldout(foldout_AttributeGrow, "成长率");
            if (foldout_Attribute)
            {
                EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(Screen.width - 16));
                EditorGUILayout.Space();
                EditorGUILayout.BeginVertical();

                player.DefaultAttributeGrow.HP              = EditorGUILayout.IntSlider("HP", player.DefaultAttributeGrow.HP, 0, RPGEditorGlobal.MAX_ATTRIBUTE_HP);
                player.DefaultAttributeGrow.PhysicalPower   = EditorGUILayout.IntSlider("物理攻击", player.DefaultAttributeGrow.PhysicalPower, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                player.DefaultAttributeGrow.MagicalPower    = EditorGUILayout.IntSlider("魔法攻击", player.DefaultAttributeGrow.MagicalPower, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                player.DefaultAttributeGrow.Skill           = EditorGUILayout.IntSlider("技术", player.DefaultAttributeGrow.Skill, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                player.DefaultAttributeGrow.Speed           = EditorGUILayout.IntSlider("速度", player.DefaultAttributeGrow.Speed, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                player.DefaultAttributeGrow.Intel           = EditorGUILayout.IntSlider("智力", player.DefaultAttributeGrow.Intel, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                player.DefaultAttributeGrow.PhysicalDefense = EditorGUILayout.IntSlider("物理防御", player.DefaultAttributeGrow.PhysicalDefense, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                player.DefaultAttributeGrow.MagicalDefense  = EditorGUILayout.IntSlider("魔法防御", player.DefaultAttributeGrow.MagicalDefense, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                player.DefaultAttributeGrow.BodySize        = EditorGUILayout.IntSlider("体格", player.DefaultAttributeGrow.BodySize, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MISC);
                player.DefaultAttributeGrow.Movement        = EditorGUILayout.IntSlider("移动", player.DefaultAttributeGrow.Movement, 0, RPGEditorGlobal.MAX_ATTRIBUTE_MOVEMENT);

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            RPGEditorGUI.DynamicArrayView(ref weaponCount, ref player.DefaultWeapons, "初始武器", "武器", RPGData.WeaponNameList.ToArray(), EnumTables.GetSequentialArray(RPGData.WeaponNameList.Count), 5);
            RPGEditorGUI.DynamicArrayView(ref skillCount, ref player.DefaultSkills, "初始技能", "技能", 10);

            player.DeadSpeech  = EditorGUILayout.TextField("战败话语", player.DeadSpeech);
            player.LeaveSpeech = EditorGUILayout.TextField("战败话语", player.LeaveSpeech);

            if (GUI.changed)
            {
                EditorUtility.SetDirty(target);
            }
        }
Ejemplo n.º 10
0
        public override void OnInspectorGUI()
        {
            Rect blockLabelRect = new Rect(45, 5, 120, 16);

            EditorGUI.LabelField(blockLabelRect, new GUIContent("武器"), RPGEditorGUI.CenterLabelStyle);
            //EditorGUI.InspectorTitlebar(new Rect(5, 5, 128, 128),true , new Object[] { Resources.Load("CharIcon/0_0") },true );
            if (wea.Icon != null)
            {
                EditorGUI.DrawPreviewTexture(new Rect(5, 5, 37, 37), wea.Icon.texture);
            }

            wea.CommonProperty.ID          = EditorGUILayout.IntField(guiContent_ID, wea.CommonProperty.ID);
            wea.CommonProperty.Name        = EditorGUILayout.TextField(guiContent_Name, wea.CommonProperty.Name);
            wea.CommonProperty.Description = EditorGUILayout.TextField(guiContent_Desc, wea.CommonProperty.Description);

            wea.Icon        = (Sprite)EditorGUILayout.ObjectField("图标", wea.Icon, typeof(Sprite), false);
            wea.WeaponType  = (EnumWeaponType)EditorGUILayout.EnumPopup("武器类型", wea.WeaponType);
            wea.WeaponLevel = (EnumWeaponLevel)EditorGUILayout.EnumPopup("武器等级", wea.WeaponLevel);
            wea.SinglePrice = EditorGUILayout.IntField("单价", wea.SinglePrice);
            wea.UseNumber   = EditorGUILayout.IntField("使用次数", wea.UseNumber);
            //根据枚举类型决定该以何种形式呈现
            foldout_Range = EditorGUILayout.Foldout(foldout_Range, "武器攻击范围");
            if (foldout_Range)
            {
                EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(Screen.width - 16));
                EditorGUILayout.Space();
                EditorGUILayout.BeginVertical();

                wea.RangeType.SelectType  = (EnumSelectEffectRangeType)EditorGUILayout.EnumPopup("选择范围类型", wea.RangeType.SelectType);
                wea.RangeType.EffectType  = (EnumSelectEffectRangeType)EditorGUILayout.EnumPopup("生效范围类型", wea.RangeType.EffectType);
                wea.RangeType.SelectRange = EditorGUILayout.Vector2IntField("选择距离", wea.RangeType.SelectRange);
                wea.RangeType.EffectRange = EditorGUILayout.Vector2IntField("生效距离", wea.RangeType.EffectRange);

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            //////////
            wea.Weight = EditorGUILayout.IntField("重量", wea.Weight);
            wea.Power  = EditorGUILayout.IntField("威力", wea.Power);
            wea.Hit    = EditorGUILayout.IntField("命中率", wea.Hit);
            wea.Crit   = EditorGUILayout.IntField("必杀率", wea.Crit);

            RPGEditorGUI.DynamicArrayView(ref dedicatedCharacterCount, ref wea.DedicatedCharacter, "专用人物", "人物");
            string[] display = RPGData.CareerNameList.ToArray();
            int[]    value   = EnumTables.GetSequentialArray(RPGData.CareerNameList.Count);
            RPGEditorGUI.DynamicArrayView(ref dedicatedJobCount, ref wea.DedicatedJob, "专用职业", "职业", display, value);
            RPGEditorGUI.DynamicArrayView(ref careerEffectCount, ref wea.CareerEffect, "克制职业", "职业", display, value);

            //Log.Write(EnumTables.MaskFieldIdentify(wea.CareerEffect, 0), EnumTables.MaskFieldIdentify(wea.CareerEffect, 1), EnumTables.MaskFieldIdentify(wea.CareerEffect, 2), EnumTables.MaskFieldIdentify(wea.CareerEffect, 3));
            //Log.Write(EnumTables.MaskFieldSetTrue(2, 1));
            //Log.Write(EnumTables.MaskFieldSetFalse(2, 0));

            wea.SuperEffect     = EditorGUILayout.MaskField(guiContent_SuperEffect, wea.SuperEffect, new string[] { "必杀", "不可反击", "狂乱", "吸血" });
            wea.AttackEffect    = (EnumWeaponAttackEffectType)EditorGUILayout.EnumPopup("特殊攻击效果", wea.AttackEffect);
            wea.ImportantWeapon = EditorGUILayout.Toggle(guiContent_ImportantWeapon, wea.ImportantWeapon);
            wea.NoExchange      = EditorGUILayout.Toggle(guiContent_NoExchange, wea.NoExchange);

            foldout_AdditionalAttribute = EditorGUILayout.Foldout(foldout_AdditionalAttribute, "人物属性修正");
            if (foldout_AdditionalAttribute)
            {
                EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(Screen.width - 16));
                EditorGUILayout.Space();
                EditorGUILayout.BeginVertical();

                wea.AdditionalAttribute.HP              = EditorGUILayout.IntSlider("HP", wea.AdditionalAttribute.HP, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                wea.AdditionalAttribute.PhysicalPower   = EditorGUILayout.IntSlider("物理攻击", wea.AdditionalAttribute.PhysicalPower, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                wea.AdditionalAttribute.MagicalPower    = EditorGUILayout.IntSlider("魔法攻击", wea.AdditionalAttribute.MagicalPower, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                wea.AdditionalAttribute.Skill           = EditorGUILayout.IntSlider("技术", wea.AdditionalAttribute.Skill, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                wea.AdditionalAttribute.Speed           = EditorGUILayout.IntSlider("速度", wea.AdditionalAttribute.Speed, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                wea.AdditionalAttribute.Intel           = EditorGUILayout.IntSlider("智力", wea.AdditionalAttribute.Intel, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                wea.AdditionalAttribute.PhysicalDefense = EditorGUILayout.IntSlider("物理防御", wea.AdditionalAttribute.PhysicalDefense, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                wea.AdditionalAttribute.MagicalDefense  = EditorGUILayout.IntSlider("魔法防御", wea.AdditionalAttribute.MagicalDefense, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                wea.AdditionalAttribute.Movement        = EditorGUILayout.IntSlider("移动", wea.AdditionalAttribute.Movement, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            foldout_AdditionalAttiburteGrow = EditorGUILayout.Foldout(foldout_AdditionalAttiburteGrow, "成长率修正");
            //人物成长率修正
            if (foldout_AdditionalAttiburteGrow)
            {
                EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(Screen.width - 16));
                EditorGUILayout.Space();
                EditorGUILayout.BeginVertical();

                wea.AdditionalAttributeGrow.HP              = EditorGUILayout.IntSlider("HP成长率", wea.AdditionalAttributeGrow.HP, 0, RPGEditorGlobal.MAX_ADDGROW);
                wea.AdditionalAttributeGrow.PhysicalPower   = EditorGUILayout.IntSlider("物理攻击成长率", wea.AdditionalAttributeGrow.PhysicalPower, 0, RPGEditorGlobal.MAX_ADDGROW);
                wea.AdditionalAttributeGrow.MagicalPower    = EditorGUILayout.IntSlider("魔法攻击成长率", wea.AdditionalAttributeGrow.MagicalPower, 0, RPGEditorGlobal.MAX_ADDGROW);
                wea.AdditionalAttributeGrow.Skill           = EditorGUILayout.IntSlider("技术成长率", wea.AdditionalAttributeGrow.Skill, 0, RPGEditorGlobal.MAX_ADDGROW);
                wea.AdditionalAttributeGrow.Speed           = EditorGUILayout.IntSlider("速度成长率", wea.AdditionalAttributeGrow.Speed, 0, RPGEditorGlobal.MAX_ADDGROW);
                wea.AdditionalAttributeGrow.Intel           = EditorGUILayout.IntSlider("智力成长率", wea.AdditionalAttributeGrow.Intel, 0, RPGEditorGlobal.MAX_ADDGROW);
                wea.AdditionalAttributeGrow.PhysicalDefense = EditorGUILayout.IntSlider("物理防御成长率", wea.AdditionalAttributeGrow.PhysicalDefense, 0, RPGEditorGlobal.MAX_ADDGROW);
                wea.AdditionalAttributeGrow.MagicalDefense  = EditorGUILayout.IntSlider("魔法防御成长率", wea.AdditionalAttributeGrow.MagicalDefense, 0, RPGEditorGlobal.MAX_ADDGROW);
                wea.AdditionalAttributeGrow.Movement        = EditorGUILayout.IntSlider("移动成长率", wea.AdditionalAttributeGrow.Movement, 0, RPGEditorGlobal.MAX_ADDGROW);

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            if (GUI.changed)
            {
                EditorUtility.SetDirty(target);
            }
        }
Ejemplo n.º 11
0
        public override void OnInspectorGUI()
        {
            //在最开始写Label会显示在最上面
            Rect blockLabelRect = new Rect(45, 5, 120, 16);

            EditorGUI.LabelField(blockLabelRect, new GUIContent("道具"), RPGEditorGUI.CenterLabelStyle);
            //EditorGUI.InspectorTitlebar(new Rect(5, 5, 128, 128),true , new Object[] { Resources.Load("CharIcon/0_0") },true );
            if (props.Icon != null)
            {
                EditorGUI.DrawPreviewTexture(new Rect(5, 5, 37, 37), props.Icon.texture);
            }
            props.CommonProperty.ID          = EditorGUILayout.IntField(guiContent_ID, props.CommonProperty.ID);
            props.CommonProperty.Name        = EditorGUILayout.TextField(guiContent_Name, props.CommonProperty.Name);
            props.CommonProperty.Description = EditorGUILayout.TextField(guiContent_Desc, props.CommonProperty.Description);

            props.Icon        = (Sprite)EditorGUILayout.ObjectField("图标", props.Icon, typeof(Sprite), false);
            props.SinglePrice = EditorGUILayout.IntField("单价", props.SinglePrice);
            props.UseNumber   = EditorGUILayout.IntField("使用次数", props.UseNumber);

            props.PropsEffect = (EnumPropsEffectType)EditorGUILayout.EnumPopup("道具效果", props.PropsEffect);
            props.Power       = EditorGUILayout.IntField("值", props.Power);

            string[] display = RPGData.CareerNameList.ToArray();
            int[]    value   = EnumTables.GetSequentialArray(RPGData.CareerNameList.Count);
            RPGEditorGUI.DynamicArrayView(ref dedicatedCharacterCount, ref props.DedicatedCharacter, "专用人物", "人物", display, value);
            RPGEditorGUI.DynamicArrayView(ref dedicatedJobCount, ref props.DedicatedJob, "专用职业", "职业", display, value);
            props.EquipItem      = EditorGUILayout.Toggle("是否可以装备", props.EquipItem);
            props.ImportantProps = EditorGUILayout.Toggle(guiContent_ImportantWeapon, props.ImportantProps);
            props.NoExchange     = EditorGUILayout.Toggle(guiContent_NoExchange, props.NoExchange);
            props.Sellable       = EditorGUILayout.Toggle("是否可以出售", props.Sellable);

            foldout_AdditionalAttribute = EditorGUILayout.Foldout(foldout_AdditionalAttribute, "人物属性修正");
            if (foldout_AdditionalAttribute)
            {
                EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(Screen.width - 16));
                EditorGUILayout.Space();
                EditorGUILayout.BeginVertical();

                props.AdditionalAttribute.HP              = EditorGUILayout.IntSlider("HP", props.AdditionalAttribute.HP, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                props.AdditionalAttribute.PhysicalPower   = EditorGUILayout.IntSlider("物理攻击", props.AdditionalAttribute.PhysicalPower, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                props.AdditionalAttribute.MagicalPower    = EditorGUILayout.IntSlider("魔法攻击", props.AdditionalAttribute.MagicalPower, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                props.AdditionalAttribute.Skill           = EditorGUILayout.IntSlider("技术", props.AdditionalAttribute.Skill, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                props.AdditionalAttribute.Speed           = EditorGUILayout.IntSlider("速度", props.AdditionalAttribute.Speed, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                props.AdditionalAttribute.Intel           = EditorGUILayout.IntSlider("智力", props.AdditionalAttribute.Intel, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                props.AdditionalAttribute.PhysicalDefense = EditorGUILayout.IntSlider("物理防御", props.AdditionalAttribute.PhysicalDefense, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                props.AdditionalAttribute.MagicalDefense  = EditorGUILayout.IntSlider("魔法防御", props.AdditionalAttribute.MagicalDefense, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                props.AdditionalAttribute.BodySize        = EditorGUILayout.IntSlider("体格", props.AdditionalAttribute.BodySize, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);
                props.AdditionalAttribute.Movement        = EditorGUILayout.IntSlider("移动", props.AdditionalAttribute.Movement, 0, RPGEditorGlobal.MAX_ADDATTIBUTE);

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            foldout_AdditionalAttiburteGrow = EditorGUILayout.Foldout(foldout_AdditionalAttiburteGrow, "成长率修正");
            //人物成长率修正
            if (foldout_AdditionalAttiburteGrow)
            {
                EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(Screen.width - 16));
                EditorGUILayout.Space();
                EditorGUILayout.BeginVertical();

                props.AdditionalAttributeGrow.HP              = EditorGUILayout.IntSlider("HP成长率", props.AdditionalAttributeGrow.HP, 0, RPGEditorGlobal.MAX_ADDGROW);
                props.AdditionalAttributeGrow.PhysicalPower   = EditorGUILayout.IntSlider("物理攻击成长率", props.AdditionalAttributeGrow.PhysicalPower, 0, RPGEditorGlobal.MAX_ADDGROW);
                props.AdditionalAttributeGrow.MagicalPower    = EditorGUILayout.IntSlider("魔法攻击成长率", props.AdditionalAttributeGrow.MagicalPower, 0, RPGEditorGlobal.MAX_ADDGROW);
                props.AdditionalAttributeGrow.Skill           = EditorGUILayout.IntSlider("技术成长率", props.AdditionalAttributeGrow.Skill, 0, RPGEditorGlobal.MAX_ADDGROW);
                props.AdditionalAttributeGrow.Speed           = EditorGUILayout.IntSlider("速度成长率", props.AdditionalAttributeGrow.Speed, 0, RPGEditorGlobal.MAX_ADDGROW);
                props.AdditionalAttributeGrow.Intel           = EditorGUILayout.IntSlider("智力成长率", props.AdditionalAttributeGrow.Intel, 0, RPGEditorGlobal.MAX_ADDGROW);
                props.AdditionalAttributeGrow.PhysicalDefense = EditorGUILayout.IntSlider("物理防御成长率", props.AdditionalAttributeGrow.PhysicalDefense, 0, RPGEditorGlobal.MAX_ADDGROW);
                props.AdditionalAttributeGrow.MagicalDefense  = EditorGUILayout.IntSlider("魔法防御成长率", props.AdditionalAttributeGrow.MagicalDefense, 0, RPGEditorGlobal.MAX_ADDGROW);
                props.AdditionalAttributeGrow.BodySize        = EditorGUILayout.IntSlider("体格成长率", props.AdditionalAttributeGrow.BodySize, 0, RPGEditorGlobal.MAX_ADDGROW);
                props.AdditionalAttributeGrow.Movement        = EditorGUILayout.IntSlider("移动成长率", props.AdditionalAttributeGrow.Movement, 0, RPGEditorGlobal.MAX_ADDGROW);

                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
            }
            if (GUI.changed)
            {
                EditorUtility.SetDirty(target);
            }
        }