private void Awake() { Log.Normal("Customizing DraggableWindow"); DraggableWindow.CloseTexture = ResourceUtil.LocateTexture("ScienceAlert.Resources.btnClose.png"); DraggableWindow.LockTexture = ResourceUtil.LocateTexture("ScienceAlert.Resources.btnLock.png"); DraggableWindow.UnlockTexture = ResourceUtil.LocateTexture("ScienceAlert.Resources.btnUnlock.png"); DraggableWindow.ButtonHoverBackground = ResourceUtil.LocateTexture("ScienceAlert.Resources.btnBackground.png"); DraggableWindow.ButtonSound = "click1"; scienceAlert = GetComponent <ScienceAlert>(); optionsWindow = new GameObject("ScienceAlert.OptionsWindow").AddComponent <DraggableOptionsWindow>(); optionsWindow.scienceAlert = GetComponent <ScienceAlert>(); optionsWindow.manager = GetComponent <ExperimentManager>(); experimentList = new GameObject("ScienceAlert.ExperimentList").AddComponent <DraggableExperimentList>(); experimentList.biomeFilter = GetComponent <BiomeFilter>(); experimentList.manager = GetComponent <ExperimentManager>(); #if false debugWindow = new GameObject("ScienceAlert.DebugWindow").AddComponent <DraggableDebugWindow>(); debugWindow.Visible = false; #endif optionsWindow.Visible = experimentList.Visible = false; }
protected override Rect Setup() { Instance = this; Title = "Available Experiments"; ShrinkHeightToFit = true; Skin = Instantiate(Settings.Skin); // we'll be altering it a little bit to make sure the buttons are the right size Settings.Instance.OnSave += AboutToSave; LoadFrom(Settings.Instance.additional.GetNode("ExperimentWindow") ?? new ConfigNode()); return(new Rect(windowRect.x, windowRect.y, 256f, 128f)); }