//public MonsterConfig monster; public static void OpenWindow() { EnemyEditorWindow enemyWindow = (EnemyEditorWindow)GetWindow(typeof(EnemyEditorWindow)); enemyWindow.wantsMouseMove = true; enemyWindow.Show(); }
private void OnGUI() { enemyScriptable = (EnemyConfig)EditorGUILayout.ObjectField(enemyScriptable, typeof(EnemyConfig), false); if (GUI.Button(new Rect(30, 30, 50, 30), "Load")) { EnemyEditorWindow enemyEditorWindow = (EnemyEditorWindow)GetWindow(typeof(EnemyEditorWindow)); if (enemyScriptable != null) { enemyEditorWindow.enemyName = enemyScriptable.enemyName; enemyEditorWindow.health = enemyScriptable.health; enemyEditorWindow.damage = enemyScriptable.damage; enemyEditorWindow.speed = enemyScriptable.speed; enemyEditorWindow.melee = enemyScriptable.melee; enemyEditorWindow.flyMonster = enemyScriptable.flyMonster; enemyEditorWindow.head = enemyScriptable.head; enemyEditorWindow.body = enemyScriptable.body; enemyEditorWindow.leftArm = enemyScriptable.leftArm; enemyEditorWindow.rightArm = enemyScriptable.rightArm; } enemyEditorWindow.Show(); Close(); } }
/// <summary> /// Estetica general de la ventana y botones para crear/cargar los niveles. /// </summary> private void OnGUI() { minSize = new Vector2(300, 200); maxSize = minSize; //------------------------------------------- EditorGUILayout.Space(); EditorGUILayout.LabelField("ENEMIES EDITOR", _style1); EditorGUILayout.Space(); EditorGUI.DrawRect(GUILayoutUtility.GetRect(100, 2), Color.black); //------------------------------------------- bool createEnemy = GUI.Button(new Rect(75, 50, 150, 50), "Create a Enemy"); if (createEnemy) { EnemyEditorWindow levelConfig = (EnemyEditorWindow)GetWindow(typeof(EnemyEditorWindow)); levelConfig.Show(); Close(); } //------------------------------------------- bool loadEnemy = GUI.Button(new Rect(75, 110, 150, 50), "Load Enemy"); if (loadEnemy) { EnemyLoadWindow levelLoader = (EnemyLoadWindow)GetWindow(typeof(EnemyLoadWindow)); levelLoader.Show(); Close(); } }
/// <summary> /// Loads all the libraries for the editors. /// </summary> void LoadLibraries() { battleEditor = new BattleEditorWindow(battleLibrary, battleContainer); characterEditor = new CharacterEditorWindow(characterLibrary, charContainer, poseList); enemyEditor = new EnemyEditorWindow(enemyLibrary, enemyContainer); backgroundEditor = new BackgroundEditorWindow(backgroundLibrary, backgroundContainer); itemEditor = new ItemEditorWindow(itemLibrary, itemContainer); moduleEditor = new ModuleEditorWindow(moduleLibrary, moduleContainer); InitializeWindow(); }
/// <summary> /// Loads all the libraries for the editors. /// </summary> void LoadLibraries() { battleEditor = new BattleEditorWindow(battleLibrary, battleContainer); characterEditor = new CharacterEditorWindow(characterLibrary, charContainer, poseList); enemyEditor = new EnemyEditorWindow(enemyLibrary, enemyContainer); backgroundEditor = new BackgroundEditorWindow(backgroundLibrary, backgroundContainer); itemEquipEditor = new ItemEquipEditorWindow(itemEquipLibrary, itemEquipContainer); kanjiEditor = new KanjiEditorWindow(kanjiLibrary, kanjiContainer); musicEditor = new MusicEditorWindow(musicLibrary, musicContainer); InitializeWindow(); }
private static void Open() { _window = GetWindow <EnemyEditorWindow>(); _window.titleContent = new GUIContent("敌人编辑器"); _window.position = GUIHelper.GetEditorWindowRect().AlignCenter(800, 500); }