// 更新选中的新物体 private void OnSelectionChange() { if (Selection.activeTransform != null) { TileObjects = Selection.activeTransform.GetComponent <TileObjects>(); } }
void Awake() { if (Instance == null) { Instance = this; } else { Debug.Log("Warning: multiple " + this + " in scene!"); } FillDictionary(); }
private static void ShowWindow() { // 定制窗口的一些信息 var window = GetWindow <TileWnd>(); window.titleContent = new GUIContent("Tile Editor"); window.Show(); // 选中带有TileObject脚本实例的TileObjects实例 if (Selection.activeTransform != null) { TileObjects = Selection.activeTransform.GetComponent <TileObjects>(); } }
// 获得编辑器脚本 private void OnEnable() { TileObjects = (global::TileObjects)target; }
private void Awake() { Instance = this; }