private void OnInitialize() { Selection.OnSelectionChanged += OnSelectionChanged; const string soName = "InspectorPersistentData"; SceneObject so = Scene.Root.FindChild(soName); if (so == null) so = new SceneObject(soName, true); persistentData = so.GetComponent<InspectorPersistentData>(); if (persistentData == null) persistentData = so.AddComponent<InspectorPersistentData>(); OnSelectionChanged(new SceneObject[0], new string[0]); }