コード例 #1
0
ファイル: FightBoss.cs プロジェクト: CreepingG/MyTaiwu
        static void OnGUI(UnityModManager.ModEntry modEntry)
        {
            if (DateFile.instance == null || DateFile.instance.mianActorId <= 0)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label("存档未加载");
                GUILayout.EndHorizontal();
                return;
            }
            bool flag;
            int  tmp;

            GUILayout.BeginHorizontal();
            GUILayout.Label("ID(2001-2009):", GUILayout.Width(100));
            if (int.TryParse(GUILayout.TextField(PresetActorId.ToString()), out tmp))
            {
                PresetActorId = tmp;
                GUILayout.Label(DateFile.instance.GetActorName(PresetActorId));
            }
            if (GUILayout.Button("开战"))
            {
                CallBattle();
            }
            if (GUILayout.Button("逃跑(不要在战斗准备界面使用)"))
            {
                EndBattle();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("游戏难度(0-3):", GUILayout.Width(100));
            if (int.TryParse(GUILayout.TextField(DateFile.instance.enemyBorn.ToString(), GUILayout.Width(150)), out tmp) &&
                tmp >= 0 && tmp <= 3)
            {
                DateFile.instance.enemyBorn = tmp;
            }

            GUILayout.FlexibleSpace();

            GUILayout.Label("世界进度(0-36):", GUILayout.Width(100));
            if (int.TryParse(GUILayout.TextField(XXLevel.ToString(), GUILayout.Width(150)), out tmp))
            {
                XXLevel = tmp;
            }

            GUILayout.FlexibleSpace();

            settings.keepLevel = GUILayout.Toggle(settings.keepLevel, "保持世界进度", GUILayout.Width(150));
            settings.poison    = GUILayout.Toggle(settings.poison, "带毒", GUILayout.Width(150));
            GUILayout.EndHorizontal();
        }
コード例 #2
0
        static void OnGUI(UnityModManager.ModEntry modEntry)
        {
            bool flag;
            int  tmp;

            GUILayout.BeginHorizontal();
            GUILayout.Label("ID(2001-2009)");
            flag = int.TryParse(GUILayout.TextField(PresetActorId.ToString()), out tmp);
            if (flag)
            {
                PresetActorId = tmp;
            }
            GUILayout.Label("姓名");
            GUILayout.TextField(ActorName);
            GUILayout.Label("难度(0-3)");
            flag = int.TryParse(GUILayout.TextField(Difficulty.ToString()), out tmp);
            if (flag)
            {
                Difficulty = tmp;
            }
            GUILayout.Label("次序(0-6)");
            flag = int.TryParse(GUILayout.TextField(XXLevel.ToString()), out tmp);
            if (flag)
            {
                XXLevel = tmp;
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            flag = GUILayout.Button("属性");
            if (flag)
            {
                var boss = Boss.Get();
                Print(boss.name);
                Print(boss.allData.ToString());
            }

            flag = GUILayout.Button("开战");
            if (flag)
            {
                CallBattle();
            }

            flag = GUILayout.Button("找错人了,告辞");
            if (flag)
            {
                EndBattle();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            flag = GUILayout.Button("剑冢数据");
            if (flag)
            {
                bp.SaveAll();
            }

            flag = GUILayout.Button("物品数据");
            if (flag)
            {
                ip.SaveAll();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            flag = GUILayout.Button("某物");
            if (flag)
            {
                Show(ip.One(PresetActorId)[1]);
            }
            flag = GUILayout.Button("建筑");
            if (flag)
            {
                var instance    = SingletonObject.getInstance <DynamicSetSprite>();
                var gsInfoAsset = (GetSpritesInfoAsset)typeof(DynamicSetSprite).GetField("gsInfoAsset", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(instance);
                foreach (var kvp in DateFile.instance.basehomePlaceDate)
                {
                    int icon = int.Parse(kvp.Value[98]);
                    Show(icon + "\t" + gsInfoAsset.GetSpriteName("buildingSprites", icon), limit: false);
                }
            }
            flag = GUILayout.Button("图片名");
            if (flag)
            {
                var dynamicSetSprite = SingletonObject.getInstance <DynamicSetSprite>();
                var gsInfoAsset      = (GetSpritesInfoAsset)typeof(DynamicSetSprite)
                                       .GetField("gsInfoAsset", BindingFlags.NonPublic | BindingFlags.Instance)
                                       .GetValue(dynamicSetSprite);
                var commonNameGroup = (Dictionary <string, string[]>) typeof(GetSpritesInfoAsset)
                                      .GetField("commonNameGroup", BindingFlags.NonPublic | BindingFlags.Instance)
                                      .GetValue(gsInfoAsset);
                foreach (var typ in commonNameGroup)
                {
                    Main.Logger.Log($"{typ.Key}:");
                    for (int i = 0; i < typ.Value.Length; i++)
                    {
                        Main.Logger.Log($"\t[{i}] = \"{typ.Value[i]}\"");
                    }
                    Main.Logger.Log("");
                }
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginVertical();
            GUILayout.TextArea(showText);
            GUILayout.EndVertical();
        }