コード例 #1
0
        public static void Enemies(Rect fullArea, Rect leftArea, Rect mainArea)
        {
            var list = Rm_RPGHandler.Instance.Repositories.Enemies.AllEnemies;

            GUI.Box(leftArea, "", "backgroundBox");
            GUI.Box(mainArea, "", "backgroundBoxMain");

            GUILayout.BeginArea(PadRect(leftArea, 0, 0));
            RPGMakerGUI.ListArea(list, ref selectedCharInfo, Rm_ListAreaType.Enemies, false, true);
            GUILayout.EndArea();


            GUILayout.BeginArea(mainArea);
            RPGMakerGUI.Title("Enemies");
            if (selectedCharInfo != null)
            {
                RPGMakerGUI.BeginScrollView();
                if (RPGMakerGUI.Foldout(ref mainInfoFoldout, "Main Info"))
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.BeginVertical(GUILayout.MaxWidth(85));
                    selectedCharInfo.Image = RPGMakerGUI.ImageSelector("", selectedCharInfo.Image,
                                                                       ref selectedCharInfo.ImagePath);

                    GUILayout.EndVertical();
                    GUILayout.BeginVertical(GUILayout.ExpandWidth(true));
                    selectedCharInfo.ID   = RPGMakerGUI.TextField("ID: ", selectedCharInfo.ID);
                    selectedCharInfo.Name = RPGMakerGUI.TextField("Name: ", selectedCharInfo.Name);
                    GUILayout.BeginHorizontal();
                    gameObject = RPGMakerGUI.PrefabSelector("Enemy Prefab:", gameObject, ref selectedCharInfo.CharPrefabPath);
                    gameObject = RPGMakerGUI.PrefabGeneratorButton(Rmh_PrefabType.Enemy, gameObject, ref selectedCharInfo.CharPrefabPath, null, selectedCharInfo.ID);
                    GUILayout.EndHorizontal();

                    Rme_Combatants.CombatantDetails(selectedCharInfo);
                    GUILayout.Space(5);

                    GUILayout.EndVertical();
                    GUILayout.EndHorizontal();
                }
                if (mainInfoFoldout)
                {
                    RPGMakerGUI.EndFoldout();
                }

                Rme_Combatants.Projectile(selectedCharInfo);
                Rme_Combatants.Animations(selectedCharInfo);
                Rme_Combatants.CombatStats(selectedCharInfo);
                Rme_Combatants.Loot(selectedCharInfo);

                RPGMakerGUI.EndScrollView();
            }
            else
            {
                EditorGUILayout.HelpBox("Add or select a new field to customise Enemy Characters.", MessageType.Info);
            }
            GUILayout.EndArea();
        }
コード例 #2
0
        public static void NPCs(Rect fullArea, Rect leftArea, Rect mainArea)
        {
            var list = Rm_RPGHandler.Instance.Repositories.Interactable.AllNpcs;

            GUI.Box(leftArea, "", "backgroundBox");
            GUI.Box(mainArea, "", "backgroundBoxMain");

            GUILayout.BeginArea(PadRect(leftArea, 0, 0));
            RPGMakerGUI.ListArea(list, ref selectedNPCInfo, Rm_ListAreaType.NPCs, false, true);
            GUILayout.EndArea();

            GUILayout.BeginArea(mainArea);
            RPGMakerGUI.Title("NPCs");
            if (selectedCharInfo != null)
            {
                RPGMakerGUI.BeginScrollView();
                if (RPGMakerGUI.Foldout(ref mainInfoFoldout, "Main Info"))
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.BeginVertical(GUILayout.MaxWidth(85));
                    selectedCharInfo.Image = RPGMakerGUI.ImageSelector("", selectedCharInfo.Image,
                                                                       ref selectedCharInfo.ImagePath);

                    GUILayout.EndVertical();
                    GUILayout.BeginVertical(GUILayout.ExpandWidth(true));
                    RPGMakerGUI.TextField("ID: ", selectedCharInfo.ID);
                    selectedCharInfo.Name = RPGMakerGUI.TextField("Name: ", selectedCharInfo.Name);
                    GUILayout.BeginHorizontal();
                    gameObject = RPGMakerGUI.PrefabSelector("NPC Prefab:", gameObject, ref selectedCharInfo.CharPrefabPath);
                    gameObject = RPGMakerGUI.PrefabGeneratorButton(Rmh_PrefabType.NPC, gameObject, ref selectedCharInfo.CharPrefabPath, null, selectedCharInfo.ID);
                    GUILayout.EndHorizontal();


                    if (GUILayout.Button("Open Interaction Window", "genericButton", GUILayout.MaxHeight(30)))
                    {
                        var trees        = Rm_RPGHandler.Instance.Nodes.DialogNodeBank.NodeTrees;
                        var existingTree = trees.FirstOrDefault(t => t.ID == selectedCharInfo.ID);
                        if (existingTree == null)
                        {
                            existingTree      = NodeWindow.GetNewTree(NodeTreeType.Dialog);
                            existingTree.ID   = selectedCharInfo.ID;
                            existingTree.Name = selectedCharInfo.Name;
                            trees.Add(existingTree);
                        }

                        DialogNodeWindow.ShowWindow(selectedCharInfo.ID);
                        selectedNPCInfo.Interaction.ConversationNodeId = existingTree.ID;
                    }
                    if (Rm_RPGHandler.Instance.Combat.NPCsCanFight)
                    {
                        if (RPGMakerGUI.Toggle("This NPC Can Fight?", ref selectedNPCInfo.CanFight))
                        {
                            selectedNPCInfo.CanBeKilled = RPGMakerGUI.Toggle("Can be Perma-killed? ", selectedNPCInfo.CanBeKilled);
                            Rme_Combatants.CombatantDetails(selectedNPCInfo);
                        }
                    }
                    GUILayout.Space(5);
                    GUILayout.EndVertical();
                    GUILayout.EndHorizontal();
                }
                if (mainInfoFoldout)
                {
                    RPGMakerGUI.EndFoldout();
                }


                Rme_Combatants.Animations(selectedNPCInfo);



                if (Rm_RPGHandler.Instance.Combat.NPCsCanFight && selectedNPCInfo.CanFight)
                {
                    Rme_Combatants.CombatStats(selectedNPCInfo);
                    Rme_Combatants.Loot(selectedNPCInfo);
                }

                RPGMakerGUI.EndScrollView();
            }
            else
            {
                EditorGUILayout.HelpBox("Add or select a new field to customise Enemy Characters.", MessageType.Info);
            }
            GUILayout.EndArea();
        }