void OnGUI() { return; if (GUILayout.Button("CreatePlayer")) { stageController.CreateUnit(0, "Player"); RefreshItems(); } if (GUILayout.Button("CreateEnemy")) { stageController.CreateUnit(enemyId++, "Enemy"); RefreshItems(); } GUILayout.BeginHorizontal(); idString = GUILayout.TextField(idString); if (GUILayout.Button("Kill")) { try { int id = int.Parse(idString); stageController.KillUnit(id); RefreshItems(); } catch (System.Exception ex) { } } if (GUILayout.Button("Refresh")) { RefreshItems(); } GUILayout.EndHorizontal(); if (items != null) { for (int i = 0; i < items.Length; i++) { if (items[i] != null) { GUILayout.Label(items[i].id.ToString() + " : " + items[i].unit.gameObject.ToString()); } } } }
void Start() { stageController = new StageController(); EngineDelegate.instance.SetStageController(stageController); stageController.CreateUnit(0, "Player"); }