コード例 #1
0
 private void DisplayAboutGUI()
 {
     EditorGUILayout.Space();
     ShowAboutDungeonFoldout = GUILayoutHelper.Foldout(ShowAboutDungeonFoldout, new GUIContent("About"), () =>
     {
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("ID", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfDungeon.Summary.ID.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Region Name", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfDungeon.Summary.RegionName, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Location Name", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfDungeon.Summary.LocationName, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Dungeon Type", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfDungeon.Summary.DungeonType.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #2
0
 void ShowForbiddenShieldsGUI()
 {
     EditorGUILayout.Space();
     showForbiddenShieldsFoldout = GUILayoutHelper.Foldout(showForbiddenShieldsFoldout, new GUIContent("Forbidden Shields"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Buckler");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsShieldForbidden(DFCareer.ShieldFlags.Buckler).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Round Shield");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsShieldForbidden(DFCareer.ShieldFlags.RoundShield).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Kite Shield");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsShieldForbidden(DFCareer.ShieldFlags.KiteShield).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Tower Shield");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsShieldForbidden(DFCareer.ShieldFlags.TowerShield).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #3
0
        private void DisplayAssetExporterGUI()
        {
            EditorGUILayout.Space();
            ShowAssetExportFoldout = GUILayoutHelper.Foldout(ShowAssetExportFoldout, new GUIContent("Asset Exporter (Beta)"), () =>
            {
                EditorGUILayout.HelpBox("Export pre-built assets to specified Resources folder and subfolder.", MessageType.Info);

                // Parent Resources path
                var propMyResourcesFolder         = Prop("Option_MyResourcesFolder");
                propMyResourcesFolder.stringValue = EditorGUILayout.TextField(new GUIContent("My Resources Folder", "Path to Resources folder for asset export."), propMyResourcesFolder.stringValue);

                // Terrain atlases
                GUILayoutHelper.Horizontal(() =>
                {
                    var propTerrainAtlasesSubFolder         = Prop("Option_TerrainAtlasesSubFolder");
                    propTerrainAtlasesSubFolder.stringValue = EditorGUILayout.TextField(new GUIContent("Terrain Atlas SubFolder", "Sub-folder for terrain atlas textures."), propTerrainAtlasesSubFolder.stringValue);
                    if (GUILayout.Button("Update"))
                    {
//#if UNITY_EDITOR && !UNITY_WEBPLAYER
//                        dfUnity.ExportTerrainTextureAtlases();
//#endif
                    }
                });
            });
        }
コード例 #4
0
        private void DisplayClimateGUI()
        {
            var propClimateUse         = Prop("ClimateUse");
            var propCurrentClimate     = Prop("CurrentClimate");
            var propCurrentSeason      = Prop("CurrentSeason");
            var propCurrentNatureSet   = Prop("CurrentNatureSet");
            var propWindowTextureStyle = Prop("WindowTextureStyle");

            EditorGUILayout.Space();
            ShowClimateFoldout = GUILayoutHelper.Foldout(ShowClimateFoldout, new GUIContent("Climate"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    propClimateUse.enumValueIndex = (int)(LocationClimateUse)EditorGUILayout.EnumPopup(new GUIContent("Usage"), (LocationClimateUse)propClimateUse.enumValueIndex);
                    if (propClimateUse.enumValueIndex == (int)LocationClimateUse.Disabled)
                    {
                        return;
                    }

                    propCurrentSeason.enumValueIndex = (int)(ClimateSeason)EditorGUILayout.EnumPopup(new GUIContent("Season"), (ClimateSeason)propCurrentSeason.enumValueIndex);
                    if (propClimateUse.enumValueIndex == (int)LocationClimateUse.Custom)
                    {
                        propCurrentClimate.enumValueIndex   = (int)(ClimateBases)EditorGUILayout.EnumPopup(new GUIContent("Climate"), (ClimateBases)propCurrentClimate.enumValueIndex);
                        propCurrentNatureSet.enumValueIndex = (int)(ClimateNatureSets)EditorGUILayout.EnumPopup(new GUIContent("Nature Flats"), (ClimateNatureSets)propCurrentNatureSet.enumValueIndex);
                    }

                    propWindowTextureStyle.enumValueIndex = (int)(WindowStyle)EditorGUILayout.EnumPopup(new GUIContent("Windows", "Change window material for day, night, etc."), (WindowStyle)propWindowTextureStyle.enumValueIndex);

                    if (GUILayout.Button("Apply"))
                    {
                        dfLocation.ApplyClimateSettings();
                    }
                });
            });
        }
コード例 #5
0
        private void DisplayAboutGUI()
        {
            EditorGUILayout.Space();
            ShowAboutGroundFoldout = GUILayoutHelper.Foldout(ShowAboutGroundFoldout, new GUIContent("About"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    if (dfGround.Summary.archive == 0)
                    {
                        EditorGUILayout.HelpBox("Ground planes must be created by script or imported using the DaggerfallUnity editor.", MessageType.Info);
                        return;
                    }

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Climate", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfGround.Summary.climate.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Season", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfGround.Summary.season.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                });
            });
        }
コード例 #6
0
 void ShowForbiddenArmorGUI()
 {
     EditorGUILayout.Space();
     showForbiddenArmorFoldout = GUILayoutHelper.Foldout(showForbiddenArmorFoldout, new GUIContent("Forbidden Armors"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Leather");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsArmorForbidden(DFCareer.ArmorFlags.Leather).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Chain");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsArmorForbidden(DFCareer.ArmorFlags.Chain).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Plate");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsArmorForbidden(DFCareer.ArmorFlags.Plate).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #7
0
 private void DisplayAboutGUI()
 {
     EditorGUILayout.Space();
     ShowAboutBillboardFoldout = GUILayoutHelper.Foldout(ShowAboutBillboardFoldout, new GUIContent("About"), () =>
     {
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("File", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(TextureFile.IndexToFileName(dfBillboard.Summary.Archive), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Index", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.Record.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("In Dungeon", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.InDungeon.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Is Mobile", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.IsMobile.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             if (dfBillboard.Summary.InDungeon && dfBillboard.Summary.IsMobile)
             {
                 GUILayoutHelper.Horizontal(() =>
                 {
                     EditorGUILayout.LabelField("Gender", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                     EditorGUILayout.SelectableLabel(((DFBlock.RdbFlatGenders)(dfBillboard.Summary.Gender)).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                 });
                 GUILayoutHelper.Horizontal(() =>
                 {
                     EditorGUILayout.LabelField("Type", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                     EditorGUILayout.SelectableLabel(dfBillboard.Summary.FixedEnemyType.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                 });
             }
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Is Atlased", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.AtlasedMaterial.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Is Animated", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.AnimatedMaterial.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Current Frame", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfBillboard.Summary.CurrentFrame.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #8
0
 void DisplaySaveImageGUI()
 {
     if (saveTextures[selectedSave] != null)
     {
         showImageFoldout = GUILayoutHelper.Foldout(showImageFoldout, new GUIContent("Image"), () =>
         {
             EditorGUILayout.Space();
             int height = (int)(((float)Screen.width / (float)saveTextures[selectedSave].width) * (float)saveTextures[selectedSave].height);
             Rect rect  = EditorGUILayout.GetControlRect(false, height);
             EditorGUI.DrawTextureTransparent(rect, saveTextures[selectedSave], ScaleMode.StretchToFill);
         });
     }
 }
コード例 #9
0
 void ShowAttributesGUI()
 {
     EditorGUILayout.Space();
     showAttributesFoldout = GUILayoutHelper.Foldout(showAttributesFoldout, new GUIContent("Attributes"), () =>
     {
         GUILayoutHelper.Indent(() =>
         {
             EditorGUILayout.Space();
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Strength");
                 EditorGUILayout.SelectableLabel(selectedCareer.Strength.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Intelligence");
                 EditorGUILayout.SelectableLabel(selectedCareer.Intelligence.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Willpower");
                 EditorGUILayout.SelectableLabel(selectedCareer.Willpower.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Agility");
                 EditorGUILayout.SelectableLabel(selectedCareer.Agility.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Endurance");
                 EditorGUILayout.SelectableLabel(selectedCareer.Endurance.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Personality");
                 EditorGUILayout.SelectableLabel(selectedCareer.Personality.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Speed");
                 EditorGUILayout.SelectableLabel(selectedCareer.Speed.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Luck");
                 EditorGUILayout.SelectableLabel(selectedCareer.Luck.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #10
0
 void ShowTolerancesGUI()
 {
     EditorGUILayout.Space();
     showTolerancesFoldout = GUILayoutHelper.Foldout(showTolerancesFoldout, new GUIContent("Tolerances"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Paralysis");
                 EditorGUILayout.SelectableLabel(selectedCareer.Paralysis.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Magic");
                 EditorGUILayout.SelectableLabel(selectedCareer.Magic.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Poison");
                 EditorGUILayout.SelectableLabel(selectedCareer.Poison.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Fire");
                 EditorGUILayout.SelectableLabel(selectedCareer.Fire.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Frost");
                 EditorGUILayout.SelectableLabel(selectedCareer.Frost.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Shock");
                 EditorGUILayout.SelectableLabel(selectedCareer.Shock.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Disease");
                 EditorGUILayout.SelectableLabel(selectedCareer.Disease.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #11
0
        private void DisplayEditorGUI()
        {
            var propPreset = Prop("Preset");

            EditorGUILayout.Space();
            propPreset.enumValueIndex = (int)(AudioPresets)EditorGUILayout.EnumPopup(new GUIContent("Preset"), (AudioPresets)propPreset.enumValueIndex);
            dfAudioSource.SoundIndex  = EditorGUILayout.IntField(new GUIContent("Index", "Index of sound to apply. Valid range is 0-458."), dfAudioSource.SoundIndex);

            //EditorGUILayout.Space();
            //if (GUILayout.Button("Apply"))
            //    dfAudioSource.Apply();

            EditorGUILayout.Space();
            ShowPreviewSoundFoldout = GUILayoutHelper.Foldout(ShowPreviewSoundFoldout, new GUIContent("Sound Finder"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    GUILayoutHelper.Horizontal(() =>
                    {
                        dfAudioSource.PreviewIndex = EditorGUILayout.IntField(new GUIContent("Preview Index", "Preview sound by index. Valid range is 0-458."), dfAudioSource.PreviewIndex);
                        if (GUILayout.Button("Preview"))
                        {
                            dfAudioSource.EditorPreviewByIndex();
                        }
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        dfAudioSource.PreviewID = EditorGUILayout.IntField(new GUIContent("Preview ID", "Preview sound by ID."), dfAudioSource.PreviewID);
                        if (GUILayout.Button("Preview"))
                        {
                            dfAudioSource.EditorPreviewByID();
                        }
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        dfAudioSource.PreviewClip = (SoundClips)EditorGUILayout.EnumPopup(new GUIContent("Preview Clip", "Preview sound by clip enum."), dfAudioSource.PreviewClip);
                        if (GUILayout.Button("Preview"))
                        {
                            dfAudioSource.EditorPreviewBySoundClip();
                        }
                    });
                });
            });
        }
コード例 #12
0
 void ShowProficienciesGUI()
 {
     EditorGUILayout.Space();
     showProficienciesFoldout = GUILayoutHelper.Foldout(showProficienciesFoldout, new GUIContent("Proficiencies"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Short Blades");
                 EditorGUILayout.SelectableLabel(selectedCareer.ShortBlades.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Long Blades");
                 EditorGUILayout.SelectableLabel(selectedCareer.LongBlades.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Hand To Hand");
                 EditorGUILayout.SelectableLabel(selectedCareer.HandToHand.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Axes");
                 EditorGUILayout.SelectableLabel(selectedCareer.Axes.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Blunt Weapons");
                 EditorGUILayout.SelectableLabel(selectedCareer.BluntWeapons.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Missile Weapons");
                 EditorGUILayout.SelectableLabel(selectedCareer.MissileWeapons.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #13
0
        private void DisplayDungeonTexturesGUI()
        {
            var propDungeonTextureUse = Prop("DungeonTextureUse");

            EditorGUILayout.Space();
            ShowDungeonTexturesFoldout = GUILayoutHelper.Foldout(ShowDungeonTexturesFoldout, new GUIContent("Dungeon Textures (Beta)"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    propDungeonTextureUse.enumValueIndex = (int)(DungeonTextureUse)EditorGUILayout.EnumPopup(new GUIContent("Usage"), (DungeonTextureUse)propDungeonTextureUse.enumValueIndex);
                    if (propDungeonTextureUse.enumValueIndex == (int)DungeonTextureUse.Disabled ||
                        propDungeonTextureUse.enumValueIndex == (int)DungeonTextureUse.UseLocation_PartiallyImplemented)
                    {
                        return;
                    }

                    dfDungeon.DungeonTextureTable[0] = EditorGUILayout.IntField("119 is ->", dfDungeon.DungeonTextureTable[0]);
                    dfDungeon.DungeonTextureTable[1] = EditorGUILayout.IntField("120 is ->", dfDungeon.DungeonTextureTable[1]);
                    dfDungeon.DungeonTextureTable[2] = EditorGUILayout.IntField("122 is ->", dfDungeon.DungeonTextureTable[2]);
                    dfDungeon.DungeonTextureTable[3] = EditorGUILayout.IntField("123 is ->", dfDungeon.DungeonTextureTable[3]);
                    dfDungeon.DungeonTextureTable[4] = EditorGUILayout.IntField("124 is ->", dfDungeon.DungeonTextureTable[4]);
                    dfDungeon.DungeonTextureTable[5] = EditorGUILayout.IntField("168 is ->", dfDungeon.DungeonTextureTable[5]);

                    GUILayoutHelper.Horizontal(() =>
                    {
                        if (GUILayout.Button("Reset"))
                        {
                            dfDungeon.ResetDungeonTextureTable();
                        }
                        if (GUILayout.Button("Random"))
                        {
                            dfDungeon.RandomiseDungeonTextureTable();
                        }
                        if (GUILayout.Button("Apply"))
                        {
                            dfDungeon.ApplyDungeonTextureTable();
                        }
                    });
                });
            });
        }
コード例 #14
0
 void ShowAdvancementGUI()
 {
     EditorGUILayout.Space();
     showAdvancementFoldout = GUILayoutHelper.Foldout(showAdvancementFoldout, new GUIContent("Advancement"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Max HP Per Class Level / Number of Monster HP Die Rolls");
                 EditorGUILayout.SelectableLabel(selectedCareer.HitPointsPerLevel.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Difficulty Multiplier");
                 EditorGUILayout.SelectableLabel(selectedCareer.AdvancementMultiplier.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #15
0
 void ShowMagickaGUI()
 {
     EditorGUILayout.Space();
     showMagickaFoldout = GUILayoutHelper.Foldout(showMagickaFoldout, new GUIContent("Magicka"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Increased Magery");
                 EditorGUILayout.SelectableLabel(selectedCareer.SpellPointMultiplierValue.ToString("0.00 * INT"), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Darkness Powered Magery");
                 EditorGUILayout.SelectableLabel(selectedCareer.DarknessPoweredMagery.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Light Powered Magery");
                 EditorGUILayout.SelectableLabel(selectedCareer.LightPoweredMagery.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Spell Absorption");
                 EditorGUILayout.SelectableLabel(selectedCareer.SpellAbsorption.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Unable to regenerate spell points");
                 EditorGUILayout.SelectableLabel(selectedCareer.NoRegenSpellPoints.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #16
0
        void ShowSkillsGUI()
        {
            EditorGUILayout.Space();
            showSkillsFoldout = GUILayoutHelper.Foldout(showSkillsFoldout, new GUIContent("Skills"), () =>
            {
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Primary");
                GUILayoutHelper.Indent(() =>
                {
                    EditorGUILayout.SelectableLabel(selectedCareer.PrimarySkill1.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    EditorGUILayout.SelectableLabel(selectedCareer.PrimarySkill2.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    EditorGUILayout.SelectableLabel(selectedCareer.PrimarySkill3.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                });

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Major");
                GUILayoutHelper.Indent(() =>
                {
                    EditorGUILayout.SelectableLabel(selectedCareer.MajorSkill1.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    EditorGUILayout.SelectableLabel(selectedCareer.MajorSkill2.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    EditorGUILayout.SelectableLabel(selectedCareer.MajorSkill3.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                });

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Minor");
                GUILayoutHelper.Indent(() =>
                {
                    EditorGUILayout.SelectableLabel(selectedCareer.MinorSkill1.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    EditorGUILayout.SelectableLabel(selectedCareer.MinorSkill2.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    EditorGUILayout.SelectableLabel(selectedCareer.MinorSkill3.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    EditorGUILayout.SelectableLabel(selectedCareer.MinorSkill4.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    EditorGUILayout.SelectableLabel(selectedCareer.MinorSkill5.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    EditorGUILayout.SelectableLabel(selectedCareer.MinorSkill6.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                });
            });
        }
コード例 #17
0
        private void DisplayOptionsGUI()
        {
            EditorGUILayout.Space();
            ShowOptionsFoldout = GUILayoutHelper.Foldout(ShowOptionsFoldout, new GUIContent("Options"), () =>
            {
                // Combining options
                var propCombineRMB = Prop("Option_CombineRMB");
                var propCombineRDB = Prop("Option_CombineRDB");
                //var propCombineLocations = Prop("Option_CombineLocations");
                //var propBatchBillboards = Prop("Option_BatchBillboards");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Performance");
                GUILayoutHelper.Indent(() =>
                {
                    propCombineRMB.boolValue = EditorGUILayout.Toggle(new GUIContent("Combine RMB", "Combine city-block meshes together."), propCombineRMB.boolValue);
                    propCombineRDB.boolValue = EditorGUILayout.Toggle(new GUIContent("Combine RDB", "Combine dungeon-block meshes together."), propCombineRDB.boolValue);
                    //propBatchBillboards.boolValue = EditorGUILayout.Toggle(new GUIContent("Batch Billboards", "Use a fast vertex shader and batched data to draw billboards."), propBatchBillboards.boolValue);
                    //propCombineLocations.boolValue = EditorGUILayout.Toggle(new GUIContent("Combine Locations", "Super-combine location RMB blocks together. First combines RMB then chunks those together."), propCombineLocations.boolValue);
                });

                // Import options
                var propSetStaticFlags    = Prop("Option_SetStaticFlags");
                var propAddMeshColliders  = Prop("Option_AddMeshColliders");
                var propDefaultSounds     = Prop("Option_DefaultSounds");
                var propSimpleGroundPlane = Prop("Option_SimpleGroundPlane");
                var propCloseCityGates    = Prop("Option_CloseCityGates");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Import Options");
                GUILayoutHelper.Indent(() =>
                {
                    propSetStaticFlags.boolValue    = EditorGUILayout.Toggle(new GUIContent("Set Static Flags", "Apply static flag where appropriate when building scenes. Billboards and dynamic objects are not marked static."), propSetStaticFlags.boolValue);
                    propAddMeshColliders.boolValue  = EditorGUILayout.Toggle(new GUIContent("Add Colliders", "Add colliders where appropriate when building scenes. Decorative billboards will not receive colliders."), propAddMeshColliders.boolValue);
                    propDefaultSounds.boolValue     = EditorGUILayout.Toggle(new GUIContent("Default Sounds", "Adds DaggerfallAudioSource and setup default sounds for noise-making scene objects."), propDefaultSounds.boolValue);
                    propSimpleGroundPlane.boolValue = EditorGUILayout.Toggle(new GUIContent("Simple Ground Plane", "Adds simple quad ground plane to imported exterior locations (ignored by terrain system)."), propSimpleGroundPlane.boolValue);
                    propCloseCityGates.boolValue    = EditorGUILayout.Toggle(new GUIContent("Close City Gates", "In walled cities use this flag to start city gates in closed position."), propCloseCityGates.boolValue);
                });

                // Light options
                var propImportPointLights      = Prop("Option_ImportPointLights");
                var propAnimatedPointLights    = Prop("Option_AnimatedPointLights");
                var propPointLightTag          = Prop("Option_PointLightTag");
                var propCustomPointLightScript = Prop("Option_CustomPointLightScript");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Lights");
                GUILayoutHelper.Indent(() =>
                {
                    propImportPointLights.boolValue = EditorGUILayout.Toggle(new GUIContent("Import Point Lights", "Import point lights with city and dungeon blocks."), propImportPointLights.boolValue);
                    GUILayoutHelper.EnableGroup(propImportPointLights.boolValue, () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            propAnimatedPointLights.boolValue = EditorGUILayout.Toggle(new GUIContent("Animated", "Adds a script to make point lights flicker like Daggerfall. Works best with deferred rendering path"), propAnimatedPointLights.boolValue);
                            propPointLightTag.stringValue     = EditorGUILayout.TagField(new GUIContent("Tag", "Custom tag to assign point lights."), propPointLightTag.stringValue);
                            propCustomPointLightScript.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Custom Script", "Custom script to assign point lights."), propCustomPointLightScript.objectReferenceValue, typeof(MonoScript), false);
                        });
                    });
                });

                // Enemy options
                var propImportEnemies            = Prop("Option_ImportEnemies");
                var propEnemyCharacterController = Prop("Option_EnemyCharacterController");
                var propEnemyRigidbody           = Prop("Option_EnemyRigidbody");
                var propEnemyCapsuleCollider     = Prop("Option_EnemyCapsuleCollider");
                var propEnemyNavMeshAgent        = Prop("Option_EnemyNavMeshAgent");
                var propEnemyExampleAI           = Prop("Option_EnemyExampleAI");
                var propEnemyTag          = Prop("Option_EnemyTag");
                var propCustomEnemyScript = Prop("Option_CustomEnemyScript");
                var propEnemyRadius       = Prop("Option_EnemyRadius");
                var propEnemySlopeLimit   = Prop("Option_EnemySlopeLimit");
                var propEnemyStepOffset   = Prop("Option_EnemyStepOffset");
                var propEnemyUseGravity   = Prop("Option_EnemyUseGravity");
                var propEnemyIsKinematic  = Prop("Option_EnemyIsKinematic");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Enemies");
                GUILayoutHelper.Indent(() =>
                {
                    propImportEnemies.boolValue = EditorGUILayout.Toggle(new GUIContent("Import Enemies", "Import fixed and random enemies from dungeon blocks."), propImportEnemies.boolValue);
                    GUILayoutHelper.EnableGroup(propImportEnemies.boolValue, () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            propEnemyCharacterController.boolValue = EditorGUILayout.Toggle(new GUIContent("CharacterController", "Add a CharacterController to every enemy."), propEnemyCharacterController.boolValue);
                            propEnemyRigidbody.boolValue           = EditorGUILayout.Toggle(new GUIContent("Rigidbody", "Add a Rigidbody to every enemy."), propEnemyRigidbody.boolValue);
                            propEnemyCapsuleCollider.boolValue     = EditorGUILayout.Toggle(new GUIContent("CapsuleCollider", "Add a CapsuleCollider to every enemy."), propEnemyCapsuleCollider.boolValue);
                            propEnemyNavMeshAgent.boolValue        = EditorGUILayout.Toggle(new GUIContent("NavMeshAgent", "Add a NavMeshAgent to every enemy."), propEnemyNavMeshAgent.boolValue);
                            propEnemyExampleAI.boolValue           = EditorGUILayout.Toggle(new GUIContent("Example AI", "Add example AI scripts to every enemy. Adds CharacterController."), propEnemyExampleAI.boolValue);
                            propEnemyTag.stringValue = EditorGUILayout.TagField(new GUIContent("Tag", "Custom tag to assign enemies."), propEnemyTag.stringValue);
                            propCustomEnemyScript.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Custom Script", "Custom script to assign enemies."), propCustomEnemyScript.objectReferenceValue, typeof(MonoScript), false);
                            ShowEnemyAdvancedFoldout = GUILayoutHelper.Foldout(ShowEnemyAdvancedFoldout, new GUIContent("Advanced"), () =>
                            {
                                GUILayoutHelper.Indent(() =>
                                {
                                    propEnemyRadius.floatValue     = EditorGUILayout.FloatField(new GUIContent("Radius", "Enemy radius for CharacterController, CapsuleCollider, NavMeshAgent."), propEnemyRadius.floatValue);
                                    propEnemySlopeLimit.floatValue = EditorGUILayout.FloatField(new GUIContent("Slope Limit", "Slope limit for CharacterController."), propEnemySlopeLimit.floatValue);
                                    propEnemyStepOffset.floatValue = EditorGUILayout.FloatField(new GUIContent("Step Offset", "Step offset for CharacterController."), propEnemyStepOffset.floatValue);
                                    propEnemyUseGravity.boolValue  = EditorGUILayout.Toggle(new GUIContent("Use Gravity", "Rigidbody should use gravity."), propEnemyUseGravity.boolValue);
                                    propEnemyIsKinematic.boolValue = EditorGUILayout.Toggle(new GUIContent("Is Kinematic", "Rigidbody should be kinematic."), propEnemyIsKinematic.boolValue);
                                });
                            });
                        });
                    });
                });

                // Time & Space options
                var propAutomateTextureSwaps = Prop("Option_AutomateTextureSwaps");
                var propAutomateSky          = Prop("Option_AutomateSky");
                var propAutomateCityLights   = Prop("Option_AutomateCityLights");
                //var propAutomateCityGates = Prop("Option_AutomateCityGates");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Time & Space");
                GUILayoutHelper.Indent(() =>
                {
                    propAutomateTextureSwaps.boolValue = EditorGUILayout.Toggle(new GUIContent("Automate Textures", "Assign textures for climate, season, and windows at runtime based on player world position and world time."), propAutomateTextureSwaps.boolValue);
                    propAutomateSky.boolValue          = EditorGUILayout.Toggle(new GUIContent("Automate Sky", "Assign seasonal skies and full day/night cycle based on player world position and world time."), propAutomateSky.boolValue);
                    propAutomateCityLights.boolValue   = EditorGUILayout.Toggle(new GUIContent("Automate City Lights", "Turn city lights on/off based on world time."), propAutomateCityLights.boolValue);
                    //propAutomateCityGates.boolValue = EditorGUILayout.Toggle(new GUIContent("Automate City Gates", "Open/close city gates based on world time. Not implemented."), propAutomateCityGates.boolValue);
                });
            });
        }
コード例 #18
0
 private void DisplayAboutGUI()
 {
     EditorGUILayout.Space();
     ShowAboutLocationFoldout = GUILayoutHelper.Foldout(ShowAboutLocationFoldout, new GUIContent("About"), () =>
     {
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("ID", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.ID.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Longitude", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.Longitude.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Latitude", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.Latitude.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Map Pixel X", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.MapPixelX.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Map Pixel Y", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.MapPixelY.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("World Coord X", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.WorldCoordX.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("World Coord Z", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.WorldCoordZ.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("World Climate", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.WorldClimate.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Sky Base", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.SkyBase.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Region Name", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.RegionName, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Location Name", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.LocationName, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Has Dungeon", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.HasDungeon.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Climate Base", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.Climate.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Nature Flats", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                 EditorGUILayout.SelectableLabel(dfLocation.Summary.Nature.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #19
0
        private void DisplayImporterGUI()
        {
            // Hide importer GUI when not active in hierarchy
            if (!dfUnity.gameObject.activeInHierarchy)
            {
                return;
            }

            EditorGUILayout.Space();
            ShowImportFoldout = GUILayoutHelper.Foldout(ShowImportFoldout, new GUIContent("Importer"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    EditorGUILayout.Space();
                    var propModelID = Prop("ModelImporter_ModelID");
                    EditorGUILayout.LabelField(new GUIContent("ModelID", "Enter numeric ID of model."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propModelID.intValue = EditorGUILayout.IntField(propModelID.intValue);
                        if (GUILayout.Button("Import"))
                        {
                            GameObjectHelper.CreateDaggerfallMeshGameObject((uint)propModelID.intValue, null);
                        }
                    });

                    EditorGUILayout.Space();
                    var propBlockName = Prop("BlockImporter_BlockName");
                    EditorGUILayout.LabelField(new GUIContent("Block Name", "Enter name of block. Accepts .RMB and .RDB blocks."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propBlockName.stringValue = EditorGUILayout.TextField(propBlockName.stringValue.Trim().ToUpper());
                        if (GUILayout.Button("Import"))
                        {
                            GameObjectHelper.CreateDaggerfallBlockGameObject(propBlockName.stringValue, null);
                        }
                    });

                    EditorGUILayout.Space();
                    var propCityName = Prop("CityImporter_CityName");
                    EditorGUILayout.LabelField(new GUIContent("City Name", "Enter exact city name in format RegionName/CityName. Case-sensitive."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propCityName.stringValue = EditorGUILayout.TextField(propCityName.stringValue.Trim());
                        if (GUILayout.Button("Import"))
                        {
                            GameObjectHelper.CreateDaggerfallLocationGameObject(propCityName.stringValue, null);
                        }
                    });

                    EditorGUILayout.Space();
                    var propDungeonName = Prop("DungeonImporter_DungeonName");
                    EditorGUILayout.LabelField(new GUIContent("Dungeon Name", "Enter exact dungeon name in format RegionName/DungeonName. Case-sensitive."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propDungeonName.stringValue = EditorGUILayout.TextField(propDungeonName.stringValue.Trim());
                        if (GUILayout.Button("Import"))
                        {
                            GameObjectHelper.CreateDaggerfallDungeonGameObject(propDungeonName.stringValue, null);
                        }
                    });
                });
            });
        }
コード例 #20
0
        private void DisplayImporterGUI()
        {
            // Hide importer GUI when not active in hierarchy
            if (!dfUnity.gameObject.activeInHierarchy)
            {
                return;
            }

            EditorGUILayout.Space();
            ShowImportFoldout = GUILayoutHelper.Foldout(ShowImportFoldout, new GUIContent("Importer"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    EditorGUILayout.Space();
                    var propModelID = Prop("ModelImporter_ModelID");
                    EditorGUILayout.LabelField(new GUIContent("ModelID", "Enter numeric ID of model."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propModelID.intValue = EditorGUILayout.IntField(propModelID.intValue);
                        if (GUILayout.Button("Import"))
                        {
                            GameObjectHelper.CreateDaggerfallMeshGameObject((uint)propModelID.intValue, null);
                        }
                    });

                    EditorGUILayout.Space();
                    var propBlockName = Prop("BlockImporter_BlockName");
                    EditorGUILayout.LabelField(new GUIContent("Block Name", "Enter name of block. Accepts .RMB and .RDB blocks."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propBlockName.stringValue = EditorGUILayout.TextField(propBlockName.stringValue.Trim().ToUpper());
                        if (GUILayout.Button("Import"))
                        {
                            // Create block
                            if (propBlockName.stringValue.EndsWith(".RMB"))
                            {
                                GameObjectHelper.CreateRMBBlockGameObject(propBlockName.stringValue, dfUnity.Option_RMBGroundPlane, dfUnity.Option_CityBlockPrefab);
                            }
                            else if (propBlockName.stringValue.EndsWith(".RDB"))
                            {
                                GameObjectHelper.CreateRDBBlockGameObject(
                                    propBlockName.stringValue,
                                    null,
                                    true,
                                    DFRegion.DungeonTypes.HumanStronghold,
                                    0.5f,
                                    4,
                                    (int)DateTime.Now.Ticks,
                                    dfUnity.Option_DungeonBlockPrefab);
                            }
                        }
                    });

                    EditorGUILayout.Space();
                    var propCityName = Prop("CityImporter_CityName");
                    EditorGUILayout.LabelField(new GUIContent("City Name", "Enter exact city name in format RegionName/CityName. Case-sensitive."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propCityName.stringValue = EditorGUILayout.TextField(propCityName.stringValue.Trim());
                        if (GUILayout.Button("Import"))
                        {
                            GameObjectHelper.CreateDaggerfallLocationGameObject(propCityName.stringValue, null);
                        }
                    });

                    EditorGUILayout.Space();
                    var propDungeonName = Prop("DungeonImporter_DungeonName");
                    EditorGUILayout.LabelField(new GUIContent("Dungeon Name", "Enter exact dungeon name in format RegionName/DungeonName. Case-sensitive."));
                    GUILayoutHelper.Horizontal(() =>
                    {
                        propDungeonName.stringValue = EditorGUILayout.TextField(propDungeonName.stringValue.Trim());
                        if (GUILayout.Button("Import"))
                        {
                            GameObjectHelper.CreateDaggerfallDungeonGameObject(propDungeonName.stringValue, null);
                        }
                    });
                });
            });
        }
コード例 #21
0
        private void DisplayOptionsGUI()
        {
            EditorGUILayout.Space();
            ShowOptionsFoldout = GUILayoutHelper.Foldout(ShowOptionsFoldout, new GUIContent("Options"), () =>
            {
                // Performance options
                var propSetStaticFlags  = Prop("Option_SetStaticFlags");
                var propCombineRMB      = Prop("Option_CombineRMB");
                var propCombineRDB      = Prop("Option_CombineRDB");
                var propBatchBillboards = Prop("Option_BatchBillboards");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Performance");
                if (!propSetStaticFlags.boolValue ||
                    !propCombineRMB.boolValue ||
                    !propCombineRDB.boolValue ||
                    !propBatchBillboards.boolValue)
                {
                    EditorGUILayout.HelpBox("Performance options should only be disabled for testing.", MessageType.Warning);
                }
                GUILayoutHelper.Indent(() =>
                {
                    propSetStaticFlags.boolValue  = EditorGUILayout.Toggle(new GUIContent("Set Static Flags", "Apply static flag where appropriate when building scenes. Billboards and dynamic objects are not marked static."), propSetStaticFlags.boolValue);
                    propCombineRMB.boolValue      = EditorGUILayout.Toggle(new GUIContent("Combine RMB", "Combine city-block meshes together."), propCombineRMB.boolValue);
                    propCombineRDB.boolValue      = EditorGUILayout.Toggle(new GUIContent("Combine RDB", "Combine dungeon-block meshes together."), propCombineRDB.boolValue);
                    propBatchBillboards.boolValue = EditorGUILayout.Toggle(new GUIContent("Batch Billboards", "Combine billboards into batches. Some billboards are never batched, such as editor markers."), propBatchBillboards.boolValue);
                });

                // Import options
                var propAddMeshColliders = Prop("Option_AddMeshColliders");
                var propRMBGroundPlane   = Prop("Option_RMBGroundPlane");
                var propCloseCityGates   = Prop("Option_CloseCityGates");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Import Options");
                GUILayoutHelper.Indent(() =>
                {
                    propAddMeshColliders.boolValue = EditorGUILayout.Toggle(new GUIContent("Add Colliders", "Add colliders where appropriate when building scenes. Decorative billboards will not receive colliders."), propAddMeshColliders.boolValue);
                    propRMBGroundPlane.boolValue   = EditorGUILayout.Toggle(new GUIContent("RMB Ground Plane", "Adds RMB ground plane to imported city block (ignored by terrain system)."), propRMBGroundPlane.boolValue);
                    propCloseCityGates.boolValue   = EditorGUILayout.Toggle(new GUIContent("Close City Gates", "In walled cities use this flag to start city gates in closed position."), propCloseCityGates.boolValue);
                });

                // Prefab options
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Prefabs");
                GUILayoutHelper.Indent(() =>
                {
                    // Lights
                    var propImportLightPrefabs       = Prop("Option_ImportLightPrefabs");
                    var propCityLightPrefab          = Prop("Option_CityLightPrefab");
                    var propDungeonLightPrefab       = Prop("Option_DungeonLightPrefab");
                    var propInteriorLightPrefab      = Prop("Option_InteriorLightPrefab");
                    propImportLightPrefabs.boolValue = EditorGUILayout.Toggle(new GUIContent("Import Light Prefabs", "Import light prefabs into scene."), propImportLightPrefabs.boolValue);
                    GUILayoutHelper.EnableGroup(propImportLightPrefabs.boolValue, () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            propCityLightPrefab.objectReferenceValue     = EditorGUILayout.ObjectField(new GUIContent("City Lights", "Prefab for city lights."), propCityLightPrefab.objectReferenceValue, typeof(Light), false);
                            propDungeonLightPrefab.objectReferenceValue  = EditorGUILayout.ObjectField(new GUIContent("Dungeon Lights", "Prefab for dungeon lights."), propDungeonLightPrefab.objectReferenceValue, typeof(Light), false);
                            propInteriorLightPrefab.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Interior Lights", "Prefab for building interior lights."), propInteriorLightPrefab.objectReferenceValue, typeof(Light), false);
                        });
                    });

                    // Doors
                    var propImportDoorPrefabs  = Prop("Option_ImportDoorPrefabs");
                    var propDungeonDoorPrefab  = Prop("Option_DungeonDoorPrefab");
                    var propInteriorDoorPrefab = Prop("Option_InteriorDoorPrefab");
                    EditorGUILayout.Space();
                    propImportDoorPrefabs.boolValue = EditorGUILayout.Toggle(new GUIContent("Import Door Prefabs", "Import door prefabs into scene."), propImportDoorPrefabs.boolValue);
                    GUILayoutHelper.EnableGroup(propImportDoorPrefabs.boolValue, () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            propDungeonDoorPrefab.objectReferenceValue  = EditorGUILayout.ObjectField(new GUIContent("Dungeon Doors", "Prefab for dungeon doors."), propDungeonDoorPrefab.objectReferenceValue, typeof(DaggerfallActionDoor), false);
                            propInteriorDoorPrefab.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Interior Doors", "Prefab for building interior doors."), propInteriorDoorPrefab.objectReferenceValue, typeof(DaggerfallActionDoor), false);
                        });
                    });

                    // Enemies
                    var propImportEnemyPrefabs = Prop("Option_ImportEnemyPrefabs");
                    var propEnemyPrefab        = Prop("Option_EnemyPrefab");
                    EditorGUILayout.Space();
                    propImportEnemyPrefabs.boolValue = EditorGUILayout.Toggle(new GUIContent("Import Enemy Prefabs", "Import enemy prefabs into scene."), propImportEnemyPrefabs.boolValue);
                    GUILayoutHelper.EnableGroup(propImportEnemyPrefabs.boolValue, () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            propEnemyPrefab.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Enemies", "Prefab for enemies."), propEnemyPrefab.objectReferenceValue, typeof(DaggerfallEnemy), false);
                        });
                    });

                    // Optional
                    var propCityBlockPrefab    = Prop("Option_CityBlockPrefab");
                    var propDungeonBlockPrefab = Prop("Option_DungeonBlockPrefab");
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("Optional");
                    GUILayoutHelper.Indent(() =>
                    {
                        propCityBlockPrefab.objectReferenceValue    = EditorGUILayout.ObjectField(new GUIContent("City Blocks", "Prefab for city blocks."), propCityBlockPrefab.objectReferenceValue, typeof(DaggerfallRMBBlock), false);
                        propDungeonBlockPrefab.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Dungeon Blocks", "Prefab for dungeon blocks."), propDungeonBlockPrefab.objectReferenceValue, typeof(DaggerfallRDBBlock), false);
                    });
                });

                // Time & Space options
                var propAutomateTextureSwaps = Prop("Option_AutomateTextureSwaps");
                var propAutomateSky          = Prop("Option_AutomateSky");
                var propAutomateCityLights   = Prop("Option_AutomateCityLights");
                //var propAutomateCityGates = Prop("Option_AutomateCityGates");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Time & Space");
                GUILayoutHelper.Indent(() =>
                {
                    propAutomateTextureSwaps.boolValue = EditorGUILayout.Toggle(new GUIContent("Automate Textures", "Assign textures for climate, season, and windows at runtime based on player world position and world time."), propAutomateTextureSwaps.boolValue);
                    propAutomateSky.boolValue          = EditorGUILayout.Toggle(new GUIContent("Automate Sky", "Assign seasonal skies and full day/night cycle based on player world position and world time."), propAutomateSky.boolValue);
                    propAutomateCityLights.boolValue   = EditorGUILayout.Toggle(new GUIContent("Automate City Lights", "Turn city lights on/off based on world time."), propAutomateCityLights.boolValue);
                    //propAutomateCityGates.boolValue = EditorGUILayout.Toggle(new GUIContent("Automate City Gates", "Open/close city gates based on world time. Not implemented."), propAutomateCityGates.boolValue);
                });
            });
        }
コード例 #22
0
 void ShowSecondaryAttributesGUI()
 {
     EditorGUILayout.Space();
     showSecondaryAttributesFoldout = GUILayoutHelper.Foldout(showSecondaryAttributesFoldout, new GUIContent("Secondary Attributes"), () =>
     {
         GUILayoutHelper.Indent(() =>
         {
             EditorGUILayout.Space();
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Damage Modifier");
                 EditorGUILayout.SelectableLabel(FormulaHelper.DamageModifier(selectedCareer.Strength).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Max Encumbrance");
                 EditorGUILayout.SelectableLabel(FormulaHelper.MaxEncumbrance(selectedCareer.Strength).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Spell Points");
                 EditorGUILayout.SelectableLabel(FormulaHelper.SpellPoints(selectedCareer.Intelligence, selectedCareer.SpellPointMultiplierValue).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Magic Resist");
                 EditorGUILayout.SelectableLabel(FormulaHelper.MagicResist(selectedCareer.Willpower).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("To Hit Modifier");
                 EditorGUILayout.SelectableLabel(FormulaHelper.ToHitModifier(selectedCareer.Agility).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Hit Points Modifier");
                 EditorGUILayout.SelectableLabel(FormulaHelper.HitPointsModifier(selectedCareer.Endurance).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Healing Rate Modifier");
                 EditorGUILayout.SelectableLabel(FormulaHelper.HealingRateModifier(selectedCareer.Endurance).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             if (careerSource == CareerSource.Monsters)
             {
                 MobileEnemy enemy;
                 if (EnemyBasics.GetEnemy(selectedCareer.Name, out enemy))
                 {
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string monsterHealth = string.Format("{0}-{1}", enemy.MinHealth, enemy.MaxHealth);
                         EditorGUILayout.LabelField("Monster Health");
                         EditorGUILayout.SelectableLabel(monsterHealth, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string monsterDamage = string.Format("{0}-{1}", enemy.MinDamage, enemy.MaxDamage);
                         EditorGUILayout.LabelField("Monster Damage 1");
                         EditorGUILayout.SelectableLabel(monsterDamage, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string monsterDamage2 = string.Format("{0}-{1}", enemy.MinDamage2, enemy.MaxDamage2);
                         EditorGUILayout.LabelField("Monster Damage 2");
                         EditorGUILayout.SelectableLabel(monsterDamage2, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string monsterDamage3 = string.Format("{0}-{1}", enemy.MinDamage3, enemy.MaxDamage3);
                         EditorGUILayout.LabelField("Monster Damage 3");
                         EditorGUILayout.SelectableLabel(monsterDamage3, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         EditorGUILayout.LabelField("Required Metal");
                         EditorGUILayout.SelectableLabel(enemy.MinMetalToHit.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string level = string.Format("{0}", enemy.Level);
                         EditorGUILayout.LabelField("Level");
                         EditorGUILayout.SelectableLabel(level, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                     GUILayoutHelper.Horizontal(() =>
                     {
                         string armorValue = string.Format("{0}", enemy.ArmorValue);
                         EditorGUILayout.LabelField("Armor Value");
                         EditorGUILayout.SelectableLabel(armorValue, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                     });
                 }
             }
         });
     });
 }
コード例 #23
0
        private void DisplayAboutGUI()
        {
            EditorGUILayout.Space();
            ShowCustomBillboardFoldout = GUILayoutHelper.Foldout(ShowCustomBillboardFoldout, new GUIContent("Custom"), () =>
            {
                var propCustomArchive = Prop("customArchive");
                var propCustomRecord  = Prop("customRecord");
                GUILayoutHelper.Indent(() =>
                {
                    propCustomArchive.intValue = EditorGUILayout.IntField(new GUIContent("Archive", "Set texture archive index (e.g. TEXTURE.210 is 210)"), propCustomArchive.intValue);
                    propCustomRecord.intValue  = EditorGUILayout.IntField(new GUIContent("Record", "Set texture record index (between 0-n)"), propCustomRecord.intValue);
                    if (GUILayout.Button("Set Billboard Texture"))
                    {
                        try
                        {
                            dfBillboard.SetMaterial(propCustomArchive.intValue, propCustomRecord.intValue);
                        }
                        catch (Exception ex)
                        {
                            Debug.Log("Failed to set custom billboard texture. Exception: " + ex.Message);
                        }
                    }
                    if (GUILayout.Button("Align To Surface"))
                    {
                        GameObjectHelper.AlignBillboardToGround(dfBillboard.gameObject, dfBillboard.Summary.Size, 4);
                    }
                });
            });

            EditorGUILayout.Space();
            ShowAboutBillboardFoldout = GUILayoutHelper.Foldout(ShowAboutBillboardFoldout, new GUIContent("About"), () =>
            {
                GUILayoutHelper.Indent(() =>
                {
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("File", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(TextureFile.IndexToFileName(dfBillboard.Summary.Archive), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Index", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfBillboard.Summary.Record.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    //GUILayoutHelper.Horizontal(() =>
                    //{
                    //    EditorGUILayout.LabelField("In Dungeon", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                    //    EditorGUILayout.SelectableLabel(dfBillboard.Summary.InDungeon.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    //});
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Is Mobile", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfBillboard.Summary.IsMobile.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    if (dfBillboard.Summary.IsMobile)
                    {
                        GUILayoutHelper.Horizontal(() =>
                        {
                            EditorGUILayout.LabelField("Flags", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                            EditorGUILayout.SelectableLabel(dfBillboard.Summary.Flags.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                        });
                        GUILayoutHelper.Horizontal(() =>
                        {
                            EditorGUILayout.LabelField("Type", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                            EditorGUILayout.SelectableLabel(dfBillboard.Summary.FixedEnemyType.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                        });
                    }
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Is Atlased", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfBillboard.Summary.AtlasedMaterial.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Is Animated", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfBillboard.Summary.AnimatedMaterial.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Current Frame", GUILayout.Width(EditorGUIUtility.labelWidth - 4));
                        EditorGUILayout.SelectableLabel(dfBillboard.Summary.CurrentFrame.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                });
            });
        }
コード例 #24
0
        void ShowMiscellaneousGUI()
        {
            EditorGUILayout.Space();
            showMiscellaneousFoldout = GUILayoutHelper.Foldout(showMiscellaneousFoldout, new GUIContent("Miscellaneous"), () =>
            {
                EditorGUILayout.Space();
                GUILayoutHelper.Indent(() =>
                {
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Acute Hearing");
                        EditorGUILayout.SelectableLabel(selectedCareer.AcuteHearing.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Athleticism");
                        EditorGUILayout.SelectableLabel(selectedCareer.Athleticism.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Adrenaline Rush");
                        EditorGUILayout.SelectableLabel(selectedCareer.AdrenalineRush.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });

                    EditorGUILayout.Space();
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Regeneration");
                        EditorGUILayout.SelectableLabel(selectedCareer.Regeneration.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Rapid Healing");
                        EditorGUILayout.SelectableLabel(selectedCareer.RapidHealing.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });

                    EditorGUILayout.Space();
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Damage From Sunlight");
                        EditorGUILayout.SelectableLabel(selectedCareer.DamageFromSunlight.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Damage From Holy Places");
                        EditorGUILayout.SelectableLabel(selectedCareer.DamageFromHolyPlaces.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });

                    EditorGUILayout.Space();
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Undead Attack Modifier");
                        EditorGUILayout.SelectableLabel(selectedCareer.UndeadAttackModifier.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Daedra Attack Modifier");
                        EditorGUILayout.SelectableLabel(selectedCareer.DaedraAttackModifier.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Humanoid Attack Modifier");
                        EditorGUILayout.SelectableLabel(selectedCareer.HumanoidAttackModifier.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField("Animals Attack Modifier");
                        EditorGUILayout.SelectableLabel(selectedCareer.AnimalsAttackModifier.ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
                    });
                });
            });
        }
コード例 #25
0
        void DisplayFactionsFoldout()
        {
            if (factionDict.Count == 0)
            {
                return;
            }

            foreach (var kvp in factionDict)
            {
                FactionFile.FactionData faction = kvp.Value;
                string textLabel = faction.name;

                if (!factionFoldoutDict.ContainsKey(faction.id))
                {
                    factionFoldoutDict.Add(faction.id, false);
                }

                factionFoldoutDict[faction.id] = GUILayoutHelper.Foldout(factionFoldoutDict[faction.id], new GUIContent(textLabel), () =>
                {
                    GUILayoutHelper.Indent(() =>
                    {
                        int parentid      = faction.parent;
                        string parentText = "None";
                        if (parentid > 0)
                        {
                            parentText = factionDict[parentid].name;
                        }
                        EditorGUILayout.LabelField(string.Format("Parent: {0}", parentText));

                        EditorGUILayout.LabelField(string.Format("Type: {0}", (FactionFile.FactionTypes)faction.type));
                        EditorGUILayout.LabelField(string.Format("Reputation: {0}", faction.rep));

                        int region        = faction.region;
                        string regionText = "None";
                        if (region > 0)
                        {
                            regionText = dfUnity.ContentReader.MapFileReader.GetRegionName(region);
                        }
                        EditorGUILayout.LabelField(string.Format("Region: {0}", regionText));

                        int ruler = faction.ruler;
                        if (ruler > 0)
                        {
                            EditorGUILayout.LabelField(string.Format("Ruler: {0}", factionDict[ruler].name));
                        }

                        int ally1 = faction.ally1;
                        int ally2 = faction.ally2;
                        int ally3 = faction.ally3;
                        if (ally1 > 0)
                        {
                            EditorGUILayout.LabelField(string.Format("Ally1: {0}", factionDict[ally1].name));
                        }
                        if (ally2 > 0)
                        {
                            EditorGUILayout.LabelField(string.Format("Ally2: {0}", factionDict[ally2].name));
                        }
                        if (ally3 > 0)
                        {
                            EditorGUILayout.LabelField(string.Format("Ally2: {0}", factionDict[ally3].name));
                        }

                        int enemy1 = faction.enemy1;
                        int enemy2 = faction.enemy2;
                        int enemy3 = faction.enemy3;
                        if (enemy1 > 0)
                        {
                            EditorGUILayout.LabelField(string.Format("Enemy1: {0}", factionDict[enemy1].name));
                        }
                        if (enemy2 > 0)
                        {
                            EditorGUILayout.LabelField(string.Format("Enemy2: {0}", factionDict[enemy2].name));
                        }
                        if (enemy3 > 0)
                        {
                            EditorGUILayout.LabelField(string.Format("Enemy3: {0}", factionDict[enemy3].name));
                        }

                        int sgroup = faction.sgroup;
                        if (sgroup > 0)
                        {
                            EditorGUILayout.LabelField(string.Format("SocialGroup: {0}", (FactionFile.SocialGroups)sgroup));
                        }

                        int ggroup = faction.ggroup;
                        if (ggroup > 0)
                        {
                            EditorGUILayout.LabelField(string.Format("GuildGroup: {0}", (FactionFile.GuildGroups)ggroup));
                        }

                        int vam = faction.vam;
                        if (vam > 0)
                        {
                            EditorGUILayout.LabelField(string.Format("VampireClan: {0}", factionDict[vam].name));
                        }
                    });
                });
            }
        }
コード例 #26
0
 void ShowForbiddenMaterialsGUI()
 {
     EditorGUILayout.Space();
     showForbiddenMaterialFoldout = GUILayoutHelper.Foldout(showForbiddenMaterialFoldout, new GUIContent("Forbidden Materials"), () =>
     {
         EditorGUILayout.Space();
         GUILayoutHelper.Indent(() =>
         {
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Iron");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Iron).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Steel");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Steel).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Silver");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Silver).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Elven");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Elven).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Dwarven");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Dwarven).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Mithril");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Mithril).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Adamantium");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Adamantium).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Ebony");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Ebony).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Orcish");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Orcish).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
             GUILayoutHelper.Horizontal(() =>
             {
                 EditorGUILayout.LabelField("Daedric");
                 EditorGUILayout.SelectableLabel(selectedCareer.IsMaterialForbidden(DFCareer.MaterialFlags.Daedric).ToString(), EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
             });
         });
     });
 }
コード例 #27
0
        void OnGUI()
        {
            if (!IsReady())
            {
                EditorGUILayout.HelpBox("DaggerfallUnity instance not ready. Have you set your Arena2 path?", MessageType.Info);
                return;
            }

            if (selectedSave != lastSelectedSave || currentSaveTree == null)
            {
                currentSaveTree = saveTrees[selectedSave];
                currentSaveVars = saveVars[selectedSave];
                if (currentSaveTree == null || currentSaveVars == null)
                {
                    return;
                }

                currentItems = currentSaveTree.FindRecords(RecordTypes.Item).ToArray();

                // Merge savetree faction data
                factionDict = factionFile.Merge(currentSaveVars);

                lastSelectedSave = selectedSave;
            }

            if (saveTrees != null && saveTrees.Length > 0)
            {
                DisplaySaveSelectGUI();
                DisplaySaveImageGUI();
                DisplaySaveStatsGUI();
                DisplaySaveCharacterGUI();

                scrollPos = GUILayoutHelper.ScrollView(scrollPos, () =>
                {
                    EditorGUILayout.Space();
                    showFactionsFoldout = GUILayoutHelper.Foldout(showFactionsFoldout, new GUIContent("Factions"), () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            DisplayFactionsFoldout();
                        });
                    });

                    EditorGUILayout.Space();
                    showItemsFoldout = GUILayoutHelper.Foldout(showItemsFoldout, new GUIContent("Items"), () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            DisplayItemsFoldout();
                        });
                    });

                    EditorGUILayout.Space();
                    showSaveTreeFoldout = GUILayoutHelper.Foldout(showSaveTreeFoldout, new GUIContent("SaveTree"), () =>
                    {
                        EditorGUILayout.HelpBox("Temporarily Filtering out records of type Door and UnknownItemRecord to keep list manageable.", MessageType.Info);

                        DisplaySaveTree(currentSaveTree.RootRecord);
                    });
                });
            }
        }
コード例 #28
0
        private void DisplayOptionsGUI()
        {
            EditorGUILayout.Space();
            ShowOptionsFoldout = GUILayoutHelper.Foldout(ShowOptionsFoldout, new GUIContent("Options"), () =>
            {
                // Performance options
                var propSetStaticFlags  = Prop("Option_SetStaticFlags");
                var propCombineRMB      = Prop("Option_CombineRMB");
                var propCombineRDB      = Prop("Option_CombineRDB");
                var propBatchBillboards = Prop("Option_BatchBillboards");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Performance");
                if (!propSetStaticFlags.boolValue ||
                    !propCombineRMB.boolValue ||
                    !propCombineRDB.boolValue ||
                    !propBatchBillboards.boolValue)
                {
                    EditorGUILayout.HelpBox("Below settings will impact runtime performance. Only change when necessary.", MessageType.Warning);
                }
                GUILayoutHelper.Indent(() =>
                {
                    propSetStaticFlags.boolValue  = EditorGUILayout.Toggle(new GUIContent("Set Static Flags", "Apply static flag where appropriate when building scenes. Billboards and dynamic objects are not marked static."), propSetStaticFlags.boolValue);
                    propCombineRMB.boolValue      = EditorGUILayout.Toggle(new GUIContent("Combine RMB", "Combine city-block meshes together."), propCombineRMB.boolValue);
                    propCombineRDB.boolValue      = EditorGUILayout.Toggle(new GUIContent("Combine RDB", "Combine dungeon-block meshes together."), propCombineRDB.boolValue);
                    propBatchBillboards.boolValue = EditorGUILayout.Toggle(new GUIContent("Batch Billboards", "Combine billboards into batches. Some billboards are never batched, such as editor markers."), propBatchBillboards.boolValue);
                });

                // Import options
                var propAddMeshColliders = Prop("Option_AddMeshColliders");
                var propRMBGroundPlane   = Prop("Option_RMBGroundPlane");
                //var propCloseCityGates = Prop("Option_CloseCityGates");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Import Options");
                GUILayoutHelper.Indent(() =>
                {
                    propAddMeshColliders.boolValue = EditorGUILayout.Toggle(new GUIContent("Add Colliders", "Add colliders where appropriate when building scenes. Decorative billboards will not receive colliders."), propAddMeshColliders.boolValue);
                    propRMBGroundPlane.boolValue   = EditorGUILayout.Toggle(new GUIContent("RMB Ground Plane", "Adds RMB ground plane to imported city block (ignored by terrain system)."), propRMBGroundPlane.boolValue);
                });

                // Prefab options
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Prefabs");
                GUILayoutHelper.Indent(() =>
                {
                    // Lights
                    var propImportLightPrefabs       = Prop("Option_ImportLightPrefabs");
                    var propCityLightPrefab          = Prop("Option_CityLightPrefab");
                    var propDungeonLightPrefab       = Prop("Option_DungeonLightPrefab");
                    var propInteriorLightPrefab      = Prop("Option_InteriorLightPrefab");
                    propImportLightPrefabs.boolValue = EditorGUILayout.Toggle(new GUIContent("Import Light Prefabs", "Import light prefabs into scene."), propImportLightPrefabs.boolValue);
                    GUILayoutHelper.EnableGroup(propImportLightPrefabs.boolValue, () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            propCityLightPrefab.objectReferenceValue     = EditorGUILayout.ObjectField(new GUIContent("City Lights", "Prefab for city lights."), propCityLightPrefab.objectReferenceValue, typeof(Light), false);
                            propDungeonLightPrefab.objectReferenceValue  = EditorGUILayout.ObjectField(new GUIContent("Dungeon Lights", "Prefab for dungeon lights."), propDungeonLightPrefab.objectReferenceValue, typeof(Light), false);
                            propInteriorLightPrefab.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Interior Lights", "Prefab for building interior lights."), propInteriorLightPrefab.objectReferenceValue, typeof(Light), false);
                        });
                    });

                    // Doors
                    var propImportDoorPrefabs  = Prop("Option_ImportDoorPrefabs");
                    var propDungeonDoorPrefab  = Prop("Option_DungeonDoorPrefab");
                    var propInteriorDoorPrefab = Prop("Option_InteriorDoorPrefab");
                    EditorGUILayout.Space();
                    propImportDoorPrefabs.boolValue = EditorGUILayout.Toggle(new GUIContent("Import Door Prefabs", "Import door prefabs into scene."), propImportDoorPrefabs.boolValue);
                    GUILayoutHelper.EnableGroup(propImportDoorPrefabs.boolValue, () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            propDungeonDoorPrefab.objectReferenceValue  = EditorGUILayout.ObjectField(new GUIContent("Dungeon Doors", "Prefab for dungeon doors."), propDungeonDoorPrefab.objectReferenceValue, typeof(DaggerfallActionDoor), false);
                            propInteriorDoorPrefab.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Interior Doors", "Prefab for building interior doors."), propInteriorDoorPrefab.objectReferenceValue, typeof(DaggerfallActionDoor), false);
                        });
                    });

                    // Enemies
                    var propImportEnemyPrefabs = Prop("Option_ImportEnemyPrefabs");
                    var propEnemyPrefab        = Prop("Option_EnemyPrefab");
                    EditorGUILayout.Space();
                    propImportEnemyPrefabs.boolValue = EditorGUILayout.Toggle(new GUIContent("Import Enemy Prefabs", "Import enemy prefabs into scene."), propImportEnemyPrefabs.boolValue);
                    GUILayoutHelper.EnableGroup(propImportEnemyPrefabs.boolValue, () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            propEnemyPrefab.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Enemies", "Prefab for enemies."), propEnemyPrefab.objectReferenceValue, typeof(DaggerfallEnemy), false);
                        });
                    });

                    // Random treasure
                    var propImportRandomTreasure = Prop("Option_ImportRandomTreasure");
                    var propLootContainerPrefab  = Prop("Option_LootContainerPrefab");
                    EditorGUILayout.Space();
                    propImportRandomTreasure.boolValue = EditorGUILayout.Toggle(new GUIContent("Import Random Treasure", "Import random treasure piles into scene."), propImportRandomTreasure.boolValue);
                    GUILayoutHelper.EnableGroup(propImportRandomTreasure.boolValue, () =>
                    {
                        GUILayoutHelper.Indent(() =>
                        {
                            propLootContainerPrefab.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Loot Container", "Prefab for random treasure loot containers."), propLootContainerPrefab.objectReferenceValue, typeof(DaggerfallLoot), false);
                        });
                    });

                    // Dungeon Water
                    var propDungeonWaterPrefab      = Prop("Option_DungeonWaterPrefab");
                    var propDungeonWaterPlaneSize   = Prop("Option_DungeonWaterPlaneSize");
                    var propDungeonWaterPlaneOffset = Prop("Option_DungeonWaterPlaneOffset");
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("Water");
                    GUILayoutHelper.Indent(() =>
                    {
                        propDungeonWaterPrefab.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Dungeon Water", "Prefab for dungeon water."), propDungeonWaterPrefab.objectReferenceValue, typeof(GameObject), false);
                        propDungeonWaterPlaneSize.vector3Value      = EditorGUILayout.Vector3Field(new GUIContent("Plane Size", "Size of water plane in Unity units, used for scaling target relative to Daggerfall geometry import (i.e. MeshReader.GlobalScale)."), propDungeonWaterPlaneSize.vector3Value, null);
                        propDungeonWaterPlaneOffset.vector3Value    = EditorGUILayout.Vector3Field(new GUIContent("Plane Offset", "Amount to offset water plane so origin aligns with block origin and top aligns with water surface."), propDungeonWaterPlaneOffset.vector3Value, null);
                    });

                    // Optional
                    var propCityBlockPrefab    = Prop("Option_CityBlockPrefab");
                    var propDungeonBlockPrefab = Prop("Option_DungeonBlockPrefab");
                    var propMobileNPCPrefab    = Prop("Option_MobileNPCPrefab");
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("Optional");
                    GUILayoutHelper.Indent(() =>
                    {
                        propCityBlockPrefab.objectReferenceValue    = EditorGUILayout.ObjectField(new GUIContent("City Blocks", "Prefab for city blocks."), propCityBlockPrefab.objectReferenceValue, typeof(DaggerfallRMBBlock), false);
                        propDungeonBlockPrefab.objectReferenceValue = EditorGUILayout.ObjectField(new GUIContent("Dungeon Blocks", "Prefab for dungeon blocks."), propDungeonBlockPrefab.objectReferenceValue, typeof(DaggerfallRDBBlock), false);
                        propMobileNPCPrefab.objectReferenceValue    = EditorGUILayout.ObjectField(new GUIContent("Mobile NPCs", "Prefab for mobile NPCs in locations."), propMobileNPCPrefab.objectReferenceValue, typeof(MobilePersonMotor), false);
                    });
                });

                // Time & Space options
                var propAutomateTextureSwaps = Prop("Option_AutomateTextureSwaps");
                var propAutomateSky          = Prop("Option_AutomateSky");
                var propAutomateCityLights   = Prop("Option_AutomateCityLights");
                //var propAutomateCityGates = Prop("Option_AutomateCityGates");
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Time & Space");
                GUILayoutHelper.Indent(() =>
                {
                    propAutomateTextureSwaps.boolValue = EditorGUILayout.Toggle(new GUIContent("Automate Textures", "Assign textures for climate, season, and windows at runtime based on player world position and world time."), propAutomateTextureSwaps.boolValue);
                    propAutomateSky.boolValue          = EditorGUILayout.Toggle(new GUIContent("Automate Sky", "Assign seasonal skies and full day/night cycle based on player world position and world time."), propAutomateSky.boolValue);
                    propAutomateCityLights.boolValue   = EditorGUILayout.Toggle(new GUIContent("Automate City Lights", "Turn city lights on/off based on world time."), propAutomateCityLights.boolValue);
                    //propAutomateCityGates.boolValue = EditorGUILayout.Toggle(new GUIContent("Automate City Gates", "Open/close city gates based on world time. Not implemented."), propAutomateCityGates.boolValue);
                });
            });
        }