void ShowCreateWindow() { editScrollPos = EditorGUILayout.BeginScrollView(editScrollPos, false, false, GUILayout.MinWidth(540), GUILayout.MinHeight(550)); conditionName = EditorGUILayout.TextField("Name: ", conditionName, GUILayout.Width(300)); conditionID = EditorGUILayout.IntField("ID: ", conditionID, GUILayout.Width(300)); conditionDesc = EditorGUILayout.TextField("Description: ", conditionDesc, GUILayout.Width(450)); isHarmful = EditorGUILayout.Toggle("Harmful", isHarmful); conditionStat = (AuraStat)EditorGUILayout.EnumPopup("Affected Stat: ", conditionStat, GUILayout.Width(450)); if (conditionStat == AuraStat.Skill) { auraSkill = EditorGUILayout.TextField("Skill: ", auraSkill, GUILayout.Width(300)); } conditionValue = EditorGUILayout.IntField("Value: ", conditionValue, GUILayout.Width(300)); hasDuration = EditorGUILayout.Toggle("Timed", hasDuration); conditionDuration = EditorGUILayout.DoubleField("Duration: ", conditionDuration, GUILayout.Width(300)); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Save", GUILayout.Width(150.0f))) { // Save this item to the database, either as a new item // or as an existing item. if (editorState == EditorState.Create) { SaveNewAura(); } else { SaveExistingAura(); } EditorUtility.SetDirty(auraDatabase); editorState = EditorState.Home; } if (GUILayout.Button("Cancel", GUILayout.Width(150.0f))) { EditorUtility.SetDirty(auraDatabase); editorState = EditorState.Home; } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndScrollView(); }
public void RemoveActorAura(ActorStats _actorStats) { actorStats = _actorStats; AuraStat stat = Aura.AuraStat; int val = Aura.AuraValue; if (stat == AuraStat.Skill) { actorStats.ModSkill(Aura.AuraSkill, -val); } else { actorStats.ModStat(stat.ToString(), -val); } Debug.Log("Removing aura " + Aura.AuraName + " to " + actorStats.gameObject.name); }
void GetAuraData() { conditionName = EditorGUILayout.TextField("Name: ", selectedAura.AuraName); conditionID = EditorGUILayout.IntField("ID: ", selectedAura.AuraID); conditionDesc = EditorGUILayout.TextField("Description: ", selectedAura.AuraDesc); isHarmful = EditorGUILayout.Toggle("Harmful", selectedAura.IsHarmful); conditionStat = (AuraStat)EditorGUILayout.EnumPopup("Affected Stat: ", selectedAura.AuraStat); if (conditionStat == AuraStat.Skill) { auraSkill = EditorGUILayout.TextField("Skill: ", selectedAura.AuraSkill, GUILayout.Width(300)); } conditionValue = EditorGUILayout.IntField("Value: ", selectedAura.AuraValue); hasDuration = EditorGUILayout.Toggle("Timed", selectedAura.HasDuration); conditionDuration = EditorGUILayout.DoubleField("Duration: ", selectedAura.AuraDuration); }