-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11b4521
commit aa50501
Showing
5 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using OpenTS2.Game; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace OpenTS2 | ||
{ | ||
[CustomEditor(typeof(Simulator))] | ||
public class SimulatorEditor : Editor | ||
{ | ||
public override void OnInspectorGUI() | ||
{ | ||
DrawDefaultInspector(); | ||
var simulator = target as Simulator; | ||
var vm = simulator.VirtualMachine; | ||
if (vm == null) return; | ||
var entities = vm.Entities; | ||
if (entities == null) return; | ||
GUILayout.Label("Entities"); | ||
GUILayout.BeginVertical("box"); | ||
foreach(var entity in entities) | ||
{ | ||
GUILayout.BeginVertical("box"); | ||
GUILayout.Label($"{entity.ID} - {entity.ObjectDefinition.FileName}"); | ||
GUILayout.EndVertical(); | ||
if (GUILayout.Button("Kill")) | ||
{ | ||
entity.Delete(); | ||
} | ||
} | ||
GUILayout.EndVertical(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters