public override void OnInspectorGUI() { EditorGUILayout.LabelField("Please use the Monster Editor Window to modify stats"); EditorGUILayout.LabelField("You must also open the prefeb editor"); if (GUILayout.Button("Open Window")) { EnemyEntityEditor.MenuCreateWindow(); } //The string labels can be changed without issue Entity temp = (Entity)serializedObject.FindProperty("entity").objectReferenceValue; //HACK //if temp is null say so and bail if (temp == null) { EditorGUILayout.LabelField("No enemy data"); } EditorGUILayout.LabelField("Health: " + temp.hitPoints); EditorGUILayout.LabelField("Endurance: " + temp.endurance); EditorGUILayout.LabelField("Magic: " + temp.mana); EditorGUILayout.Space(); EditorGUILayout.LabelField("Strength: " + temp.strength); EditorGUILayout.LabelField("Constitution: " + temp.constitution); EditorGUILayout.LabelField("Intelligence: " + temp.intelligence); EditorGUILayout.LabelField("Willpower: " + temp.willpower); EditorGUILayout.Space(); EditorGUILayout.LabelField("Physical Armor: " + temp.physicalArmor); EditorGUILayout.LabelField("Magic armor: " + temp.magicArmor); }
public override void OnInspectorGUI() { EditorGUILayout.LabelField("Please use the Entity Editor Window"); if (GUILayout.Button("Open Window")) { EnemyEntityEditor.MenuCreateWindow(); } }
public static void CodeReload() { //detects if the window is alread opened and grabs it. //Code recompiles causes the instance reference to be lost. if (EditorWindow.HasOpenInstances <EnemyEntityEditor>()) { instance = EditorWindow.GetWindow <EnemyEntityEditor>("", false); instance.UpdateSlection(); } }
public static void MenuCreateWindow() { if (instance == null) { instance = CreateWindow <EnemyEntityEditor>(); } else { EditorWindow.FocusWindowIfItsOpen <EnemyEntityEditor>(); } instance.UpdateSlection(); }