public void SetLineButton(DD_Lines lines) { name = string.Format("Button{0}", lines.gameObject.name); GetComponent <Image>().color = lines.color; SetLabel(lines); }
public void OnButtonClick() { if (true == Input.GetKey(KeyCode.LeftControl)) { return; } if (null == m_Line) { Debug.LogWarning(this.ToString() + "error OnButtonClick : null == m_Line"); return; } DD_Lines lines = m_Line.GetComponent <DD_Lines>(); if (null == lines) { Debug.LogWarning(this.ToString() + "error OnButtonClick : null == DD_Lines"); return; } else { lines.IsShow = !lines.IsShow; } }
private void SetLabel(DD_Lines lines) { if ((null == m_Label) || (null == m_Label.GetComponent <Text>())) { m_Label = null; } try { m_Label.GetComponent <Text>().text = lines.GetComponent <DD_Lines>().lineName; m_Label.GetComponent <Text>().color = lines.GetComponent <DD_Lines>().color; } catch { m_Label.GetComponent <Text>().color = Color.white; } }
private void SetLineColor(GameObject line, Color color) { if (null == line) { //Debug.logger(this.ToString() + " SetLineColor error : null == line"); return; } DD_Lines lines = line.GetComponent <DD_Lines>(); if (null == lines) { Debug.LogWarning(line.ToString() + " SetLineColor error : null == lines"); return; } lines.color = color; SetLineButtonColor(line, color); }
private bool AddLineButton(GameObject line) { if (null == lineButtonsContent) { Debug.LogWarning(this + "AddLineButton Error : null == lineButtonsContent"); return(false); } if (lineButtonsContent.transform.childCount >= maxLineNum) { return(false); } if (null == line) { Debug.LogWarning(this + "AddLineButton Error : null == line"); return(false); } DD_Lines lines = line.GetComponent <DD_Lines>(); if (null == lines) { Debug.LogWarning(this + "AddLineButton Error : null == lines"); return(false); } GameObject button = Instantiate((GameObject)Resources.Load("Prefabs/LineButton"), lineButtonsContent.transform); if (null == button) { Debug.LogWarning(this + "AddLineButton Error : null == button"); return(false); } //button.name = string.Format("Button{0}", line.name); //button.GetComponent<Image>().color = lines.color; button.GetComponent <DD_LineButton>().line = line; return(true); }