private void LoadColorPicker(SerializableColor color) { GameObject itemDisplay = Instantiate(ColorItemPrefab); itemDisplay.transform.SetParent(ColorPageContainer.transform, false); itemDisplay.GetComponentInChildren <Image>().color = color.ToColor(); var itemButton = itemDisplay.AddComponent <ColorItemButton>(); itemButton.OnButtonClick = OnButtonClick; itemButton.BtnName = "ColorItem"; itemButton.Color = color.ToColor(); }
// after deserialize serializable_color then update to unity_color public void OnAfterDeserialize() { my_color = my_scolor.ToColor(); }