void Awake() { Debug.Log("[ColorPickerPopup:Awake]"); if (singleton == null) { Debug.Log("ColorPickerPopup checking in."); singleton = this; swatches = new SwatchData[NUM_SWATCHES + 1]; for (int ii = 0; ii <= NUM_SWATCHES; ++ii) { swatches[ii] = new SwatchData(); } swatchButtons = new Button[NUM_SWATCHES + 1]; swatchButtons[0] = swatchButton0; swatchButtons[1] = swatchButton1; swatchButtons[2] = swatchButton2; swatchButtons[3] = swatchButton3; swatchButtons[4] = swatchButton4; swatchButtons[5] = swatchButton5; swatchButtons[6] = backgroundSwatchButton; selectedSwatch = 0; gameObject.SetActive(false); } else { Debug.Log("ColorPickerPopup checking out."); GameObject.Destroy(gameObject); } }
public SwatchData(SwatchData copy) { _coords = copy._coords; _value = copy._value; _color = copy._color; _brightColor = copy._brightColor; }
public void InitializeAllSwatches() { for (int ii = 0; ii < NUM_SWATCHES; ii++) { swatches[ii] = new SwatchData(MapEditorManager.singleton.swatchData[ii]); UpdateButtonColor(ii); } swatches[BACKGROUND_SWATCH] = new SwatchData(MapManager.singleton.backgroundSwatch); UpdateButtonColor(BACKGROUND_SWATCH); }
public SerializableSwatch(SwatchData copy) { x = copy.coords.x; y = copy.coords.y; v = copy.value; }