public void ShowColorPicker2() { picker = AColorPicker.Create(m_ComponentContainer, "AColorPickerUGUI_2_Prefab"); picker.Setup(() => { SetBasicUIVisible(true); }); picker.transform.localPosition = new Vector3(0, -200, 0); SetBasicUIVisible(false); }
/// <summary> /// Example 3: /// Place the picker under the root(parent == null); /// Enabling/Disabling the alpha slider; /// Changing the color space textures; /// </summary> public void ShowColorPicker3() { picker = AColorPicker.Create(null, "AColorPickerUGUI_AutoFit_Prefab"); picker.Setup(hasAlpha, hasPickerRect, () => { SetBasicUIVisible(true); }); picker.ChangePaletteColorTexture(paletteTextureIndex); SetBasicUIVisible(false); }
/// <summary> /// Create an instance of AColorPicker, and set parent. /// </summary> /// <param name="parentT">The container/parent for this instance.</param> /// <param name="prefabName">The prefab in resources folder, name must match</param> public static AColorPicker Create(Transform parentT, string prefabName = "AColorPickerUGUI_AutoFit_Prefab") { GameObject prefab = Resources.Load(prefabName) as GameObject; AColorPicker gifPanel = _InstantiatePrefab <AColorPicker>(prefab); gifPanel.transform.SetParent(parentT); if (parentT) { gifPanel.transform.rotation = parentT.rotation; } gifPanel.transform.localScale = Vector3.one; gifPanel.transform.localPosition = Vector3.zero; return(gifPanel); }
void Start() { picker = AColorPicker.Create(null); picker.Setup(null); }