public void Init() { if (!initialized) { HardlightPanes = new List <EditorPane>(); //Note: SuitSetupPane (inherited from EditorPane) is a ScriptableObject. SuitSetupPane setup = CreateInstance <SuitSetupPane>(); setup.Setup(); setup.ShouldDisplay = false; PackagingPane package = CreateInstance <PackagingPane>(); package.Setup(); package.ShouldDisplay = true; //EmulationPane emulation = CreateInstance<EmulationPane>(); //emulation.Setup(); //emulation.ShouldDisplay = false; ActiveTab = setup; HardlightPanes.Add(package); HardlightPanes.Add(setup); //HardlightPanes.Add(emulation); //HardlightPanes.Add(new AssetImporterPane()); //HardlightPanes.Add(new EmulationPane()); icon = (Texture2D)Resources.Load("Button Icons/NullSpace Logo 256x256", typeof(Texture2D)); mat = Resources.Load <Material>("EditorIcon"); initialized = true; Repaint(); } }
public void ActivateSpecificEditorPane(System.Type typeOfPane) { EditorPane result = FindEditorPane(typeOfPane); if (result != null) { SetActiveTab(result); } }
public void AddOutputMessage(EditorPane caller, HelpMessage message) { if (ActiveTab != null && ActiveTab == caller) { //if (message.messageType == MessageType.Error) //{ errorScrollPos = new Vector2(float.MaxValue, float.MaxValue); //} } }
private void SetActiveTab(EditorPane newPane) { //Don't change to null inputs if (newPane != null) { //Don't do stuff for when we have no active pane. if (ActiveTab != null) { //Can't deactivate self...? if (ActiveTab != newPane) { ActiveTab.ShouldDisplay = false; } } ActiveTab = newPane; ActiveTab.ShouldDisplay = true; } }