public override void OnLoaded(ContentHandler contentHandler) { RuntimeInspectorStartup.AddListener((sender, evt) => { var ris = sender as RuntimeInspectorStartup; var tpContainer = ris.transform.Find("Container/Menu/Third-party Group"); if (tpContainer) { transform.SetParent(tpContainer.transform); } else { Debug.LogError("Couldn't find RuntimeInspector UI Third-party Group!"); } var uiContainer = ris.transform.Find("Container"); if (uiContainer) { uiContainer.SetParent(RoR2.RoR2Application.instance.mainCanvas.transform); uiContainer.SetAsLastSibling(); } else { Debug.LogError("Couldn't find RuntimeInspector UI Container!"); } hierarchy = ris.Hierarchy; inspector = ris.Inspector; ((RuntimeInspectorStartup)sender).Hierarchy.OnSelectionChanged += Pinger.SetPing; }); }
void BuildWindowSingletons() { Hierarchy = GetComponentInChildren <RuntimeHierarchy>(true); Inspector = GetComponentInChildren <RuntimeInspector>(true); var colorPicker = Instantiate(contentHandler.prefabs.Where(p => p.name == "ColorPicker").First()); DontDestroyOnLoad(colorPicker); ColorPicker.Instance = colorPicker.GetComponent <ColorPicker>(); ColorPicker.Instance.Close(); var objPicker = Instantiate(contentHandler.prefabs.Where(p => p.name == "ObjectReferencePicker").First()); DontDestroyOnLoad(objPicker); ObjectReferencePicker.Instance = objPicker.GetComponent <ObjectReferencePicker>(); ObjectReferencePicker.Instance.Close(); }