/// <summary> /// Instantiate the window instance. /// </summary> /// <returns>The window.</returns> /// <param name="prefab">Prefab.</param> public WindowScript ShowWindow(GameObject prefab) { WindowScript window = Utilities.CreateInstance(prefab, this.WindowsContainer, true).GetComponent <WindowScript>(); window.GetComponent <RectTransform>().anchoredPosition = Vector2.zero; this._windowInstances.Add(window); return(window); }
void Start() { //Sets the variables windowScript = GetComponentInParent <WindowScript>(); draggingTransform = windowScript.GetComponent <RectTransform>(); canvas = ThemeManager.instance.ui; titleBarImage = GetComponent <Image>(); //Sets the colour of the titlebar to the active colour. titleBarImage.color = ThemeManager.instance.activeTitleBarColour; if (ThemeManager.instance.activeTitleBarColour.r <= 0.5f && ThemeManager.instance.activeTitleBarColour.g <= 0.5f && ThemeManager.instance.activeTitleBarColour.b <= 0.5f) { GetComponentInChildren <Text>().color = Color.white; } else { GetComponentInChildren <Text>().color = Color.black; } }