private void HandleAnyMouseClickColorSquare(CAGlobalColorSelectorButton colorSquareRef) { switch (CurrentState) { case EState.DEFAULT: m_ChangeNextClickedColorSiblingIndex = colorSquareRef.transform.parent.GetSiblingIndex(); CurrentState = EState.CHANGE_TO_NEXT_CLICKED_PIXEL_COLOR; break; case EState.DELETE_NEXT_CLICKED_COLOR: DeleteColorState(colorSquareRef.transform.parent.GetSiblingIndex()); break; case EState.CHANGE_NEXT_CLICKED_COLOR: m_ChangeNextClickedColorSiblingIndex = colorSquareRef.transform.parent.GetSiblingIndex(); CurrentState = EState.CHANGE_TO_NEXT_CLICKED_PIXEL_COLOR; break; case EState.CHANGE_TO_NEXT_CLICKED_PIXEL_COLOR: break; default: break; } }
private void ChangeColorState(int childIndex, Color c) { SaveLoadManager.Instance.ChangeColor(childIndex + 1, c); //get button reference from children (there should only be one) CAGlobalColorSelectorButton thisBtn = m_ColorSquareParent.GetChild(childIndex).GetComponentInChildren <CAGlobalColorSelectorButton>(); //update background color thisBtn.m_Background.color = c; }
private void AddNewColorState(Color c) { //instantiate as child of color square parent GameObject newGO = Instantiate(m_ColorSquarePrefab, m_ColorSquareParent); //get button reference from children (there should only be one) CAGlobalColorSelectorButton newBtn = newGO.transform.GetComponentInChildren <CAGlobalColorSelectorButton>(); //update background color newBtn.m_Background.color = c; }
public void OnRightMouseClickColorSquare(CAGlobalColorSelectorButton colorSquareRef) { HandleAnyMouseClickColorSquare(colorSquareRef); }