void DrawEndingSetting(BuildManagerData data) { GUILayout.Label("Custom Ending Level", EditorStyles.boldLabel); GUILayout.Space(5f); data.endingName = EditorGUILayout.TextField("Ending Name", data.endingName); GUILayout.Space(5f); data.timeofLevel = SetFloat("Level Time", data.timeofLevel); GUILayout.Space(5f); data.towerNumber = SetFloat("Tower Number", data.towerNumber); GUILayout.Space(10f); GameObject[] building = GameObject.FindGameObjectsWithTag("Manager"); if (building.Length >= 1) { EditorGUILayout.HelpBox("Remove the existed one before create new one!", MessageType.Warning); } else if (GUILayout.Button("SAVE", GUILayout.Height(30))) { SaveData(); window.Close(); } }
void DrawSettings(BulletData b_Data) { b_Data.b_Name = EditorGUILayout.TextField("Projectile name: ", b_Data.b_Name); b_Data.b_Mass = EditorGUILayout.FloatField("Projectile mass: ", b_Data.b_Mass); b_Data.b_Velocity = EditorGUILayout.FloatField("Projectile max velocity: ", b_Data.b_Velocity); b_Data.b_Damage = EditorGUILayout.FloatField("Projectile basic damage: ", b_Data.b_Damage); b_Data.hasAnimation = EditorGUILayout.Toggle("Has animation? ", b_Data.hasAnimation); if (b_Data.hasAnimation != false) { EditorGUILayout.HelpBox("Reminder: Please uncheck 'has animation' box if animation is not yet available.", MessageType.Warning); b_Data.animation = (Animation)EditorGUILayout.ObjectField("Projectile animation: ", b_Data.animation, typeof(Animation)); } b_Data.b_Prefab = (GameObject)EditorGUILayout.ObjectField("Projectile prefab: ", b_Data.b_Prefab, typeof(GameObject)); if (b_Data.b_Name == null || b_Data.b_Name.Length < 2) { EditorGUILayout.HelpBox("Reminder: Please input a name for the new projectile. [Should be longer than two characters]", MessageType.Warning); } if (GUILayout.Button("Finish and save new projectile...", GUILayout.Height(40))) { SaveBulletSettings(); window.Close(); } }
private void DrawSettings(string name) { EditorGUILayout.BeginHorizontal(); GUILayout.Label("显示面板"); var str1 = EditorGUILayout.TextField(name); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Prefab"); tempTexture = EditorGUILayout.ObjectField(tempTexture, typeof(Texture2D), false) as Texture2D; EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("内容"); EditorGUILayout.TextField(tempstr_1); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginVertical("Box"); GUILayout.Label("显示百分比 %"); percent = EditorGUILayout.Slider(percent, -100, 100); EditorGUILayout.EndVertical(); if (tempTexture == null) { EditorGUILayout.HelpBox("需要设置对应的Prefab", MessageType.Warning); } else if (GUILayout.Button("关闭", GUILayout.Height(30))) { window.Close(); SaveAssetData(); } }
void DrawSettings(CharacterData charData) { EditorGUILayout.BeginVertical(skin.GetStyle("GeneralPadding")); EditorGUILayout.BeginHorizontal(skin.GetStyle("HorizontalLayout")); GUILayout.Label("Prefab"); charData.prefab = (GameObject)EditorGUILayout.ObjectField(charData.prefab, typeof(GameObject), false); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(skin.GetStyle("HorizontalLayout")); GUILayout.Label("Max Health"); charData.maxHealth = EditorGUILayout.FloatField(charData.maxHealth); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(skin.GetStyle("HorizontalLayout")); GUILayout.Label("Max Energy"); charData.maxEnergy = EditorGUILayout.FloatField(charData.maxEnergy); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(skin.GetStyle("HorizontalLayout")); GUILayout.Label("Power"); charData.power = EditorGUILayout.Slider(charData.power, 0, 100); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(skin.GetStyle("HorizontalLayout")); GUILayout.Label("% Critical Chance"); charData.critChance = EditorGUILayout.Slider(charData.critChance, 0, charData.power); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(skin.GetStyle("HorizontalLayout")); GUILayout.Label("Name"); charData.name = EditorGUILayout.TextField(charData.name); EditorGUILayout.EndHorizontal(); if (charData.prefab == null) { EditorGUILayout.HelpBox("This enemy needs a [Prefab] before it can be created", MessageType.Warning); } else if (charData.name == null || charData.name.Length < 1) { EditorGUILayout.HelpBox("This enemy needs a [Name] before it can be created", MessageType.Warning); } else if (GUILayout.Button("Finish and Save", GUILayout.Height(30))) { SaveCharacterData(); window.Close(); } EditorGUILayout.EndVertical(); }
void DrawSettings(CharacterData charData) { EditorGUILayout.BeginHorizontal(); GUILayout.Label("Prefab"); // : 딱 붙여서 나타난다. charData.prefab = (GameObject)EditorGUILayout.ObjectField(charData.prefab, typeof(GameObject), false); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Health"); // : 딱 붙여서 나타난다. charData.maxHealth = EditorGUILayout.FloatField(charData.maxHealth); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Energy"); // : 에디터 클래스 만큼 띄워서 나타난다. charData.maxEnergy = EditorGUILayout.DelayedFloatField(charData.maxEnergy); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Power"); // : 에디터 클래스 만큼 띄워서 나타난다. charData.power = EditorGUILayout.Slider(charData.power, 0, 100); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Cri Chance"); // : 에디터 클래스 만큼 띄워서 나타난다. charData.critChance = EditorGUILayout.Slider(charData.critChance, 0, 100); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Name"); // : 에디터 클래스 만큼 띄워서 나타난다. charData.name = EditorGUILayout.TextField(charData.name); EditorGUILayout.EndHorizontal(); if (charData.prefab == null) { EditorGUILayout.HelpBox("This enemy needs a [Prefab] before it can be created.", MessageType.Warning); } else if (charData.name == null || charData.name.Length < 1) { EditorGUILayout.HelpBox("Enemy name is Error", MessageType.Warning); } else if (GUILayout.Button("Finish and Save", GUILayout.Height(30))) { SaveCharacterData(); window.Close(); // 이게 열려져 있는 상태에서 진행이 되면 에러가 날 수 도 있다. } }
void DrawSettings(CharachterData charachterData) { EditorGUILayout.BeginHorizontal(); GUILayout.Label("Prefab"); charachterData.prefab = (GameObject)EditorGUILayout.ObjectField(charachterData.prefab, typeof(GameObject), false); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Max Health"); charachterData.maxHealth = EditorGUILayout.FloatField(charachterData.maxHealth); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Max Energy"); charachterData.maxEnergy = EditorGUILayout.FloatField(charachterData.maxEnergy); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Power"); charachterData.power = EditorGUILayout.Slider(charachterData.power, 1, 100); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("% crit Chance"); charachterData.critChange = EditorGUILayout.Slider(charachterData.critChange, 0, charachterData.power); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Name"); charachterData.name = EditorGUILayout.TextField(charachterData.name); EditorGUILayout.EndHorizontal(); if (charachterData.prefab == null) { EditorGUILayout.HelpBox("This Enemy needs a [Prefab] befor creating it", MessageType.Warning); } else if (charachterData.name == null || charachterData.name.Length < 1) { EditorGUILayout.HelpBox("This Enemy needs a [Name] befor creating it", MessageType.Warning); } else if (GUILayout.Button("Finish and Save Data", GUILayout.Height(30))) { SaveCharachterData(); settingsWindow.Close(); } }
void DrawSettings(EnemyData enemyData) { EditorGUILayout.BeginHorizontal(); GUILayout.Label("Prefab"); enemyData.Prefab = (GameObject)EditorGUILayout.ObjectField(enemyData.Prefab, typeof(GameObject), false); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("MaxHealth"); enemyData.MaxHealth = EditorGUILayout.FloatField(enemyData.MaxHealth); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Speed"); enemyData.Speed = EditorGUILayout.FloatField(enemyData.Speed); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("AttackRange"); enemyData.AttackRange = EditorGUILayout.Slider(enemyData.AttackRange, 0, 100); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Name"); enemyData.Name = EditorGUILayout.TextField(enemyData.Name); EditorGUILayout.EndHorizontal(); if (enemyData.Prefab == null) { EditorGUILayout.HelpBox("This enemy need [Prefab]", MessageType.Warning); } else if (enemyData.Name == null || enemyData.Name.Length < 1) { EditorGUILayout.HelpBox("This enemy need [Name]", MessageType.Warning); } else if (GUILayout.Button("Finish and Save", GUILayout.Height(30))) { SaveEnemyData(); window.Close(); } }
void DrawBehaviourSettings() { //Choosing the type of behaviour EditorGUILayout.BeginHorizontal(); GUILayout.Label("Behaviour type"); _behaviourType = (BehaviourType)EditorGUILayout.EnumPopup(_behaviourType); EditorGUILayout.EndHorizontal(); //Showing different parameters depends on the type of behaviour switch (_behaviourType) { case BehaviourType.DAMAGE: //Damage amount EditorGUILayout.BeginHorizontal(); GUILayout.Label("Damage"); _damageBehaviourData.damage = EditorGUILayout.IntField(_damageBehaviourData.damage); EditorGUILayout.EndHorizontal(); //Checking if can be saved if (_damageBehaviourData.damage == 0) { EditorGUILayout.HelpBox("This behaviour needs a [Damage] before it can be created", MessageType.Warning); } else if (GUILayout.Button("Save", GUILayout.Height(30))) { SaveBehaviourData(); _window.Close(); } break; case BehaviourType.POISON: //Damage amount EditorGUILayout.BeginHorizontal(); GUILayout.Label("Damage"); _poisonBehaviourData.damage = EditorGUILayout.IntField(_poisonBehaviourData.damage); EditorGUILayout.EndHorizontal(); //How many turns it will keeps EditorGUILayout.BeginHorizontal(); GUILayout.Label("Turns"); _poisonBehaviourData.turns = EditorGUILayout.IntField(_poisonBehaviourData.turns); EditorGUILayout.EndHorizontal(); //Checking if can be saved if (_poisonBehaviourData.damage == 0) { EditorGUILayout.HelpBox("This behaviour needs a [Damage] before it can be created", MessageType.Warning); } else if (_poisonBehaviourData.turns == 0) { EditorGUILayout.HelpBox("This behaviour needs a [Turns] before it can be created", MessageType.Warning); } else if (GUILayout.Button("Save", GUILayout.Height(30))) { SaveBehaviourData(); _window.Close(); } break; } }
private void DrawSettings(CharacterData charData) { #region -- Prefab Horizontal -- EditorGUILayout.BeginHorizontal(); GUILayout.Label("Prefab: "); charData.prefab = (GameObject)EditorGUILayout.ObjectField(charData.prefab, typeof(GameObject), false); EditorGUILayout.EndHorizontal(); #endregion #region -- Max Health Horizontal -- EditorGUILayout.BeginHorizontal(); GUILayout.Label("Max Health: "); charData.maxHealth = EditorGUILayout.FloatField(charData.maxHealth); EditorGUILayout.EndHorizontal(); #endregion #region -- Max Energy Horizontal -- EditorGUILayout.BeginHorizontal(); GUILayout.Label("Max Energy: "); charData.maxEnergy = EditorGUILayout.FloatField(charData.maxEnergy); EditorGUILayout.EndHorizontal(); #endregion #region -- Power Horizontal-- EditorGUILayout.BeginHorizontal(); GUILayout.Label("Power: "); charData.power = EditorGUILayout.Slider(charData.power, 0, 100); EditorGUILayout.EndHorizontal(); #endregion #region -- % Critical chance Horizontal -- EditorGUILayout.BeginHorizontal(); GUILayout.Label("% Critical chance: "); charData.critChance = EditorGUILayout.Slider(charData.critChance, 0, charData.power); EditorGUILayout.EndHorizontal(); #endregion #region -- Name Horizontal -- EditorGUILayout.BeginHorizontal(); GUILayout.Label("Name: "); charData.name = EditorGUILayout.TextField(charData.name); charData.characterName = charData.name; EditorGUILayout.EndHorizontal(); #endregion #region -- Help Boxes and Button Save -- if (charData.prefab == null) { EditorGUILayout.HelpBox("This unit need a [Prefab] before it can be saved.", MessageType.Warning); } else if (string.IsNullOrEmpty(charData.name)) { EditorGUILayout.HelpBox("This unit need a [Name] before it can be saved.", MessageType.Warning); } else if (GUILayout.Button("Finish and Save", GUILayout.Height(30))) { SaveCharacterData(); window.Close(); } #endregion }