Exemple #1
0
        private void SetLineColor(GameObject line, Color color)
        {
            if (!line)
            {
                return;
            }

            DrawGraphicLines lines = line.GetComponent <DrawGraphicLines>();

            if (!lines)
            {
                Debug.LogWarning(line.ToString() + " SetLineColor error : null == lines");
                return;
            }
            lines.color = color;
            SetLineButtonColor(line, color);
        }
Exemple #2
0
        private bool AddLineButton(GameObject line)
        {
            if (!lineButtonsContent)
            {
                Debug.LogWarning(this + "AddLineButton Error : null == lineButtonsContent");
                return(false);
            }

            if (lineButtonsContent.transform.childCount >= maxLineNum)
            {
                return(false);
            }

            if (!line)
            {
                Debug.LogWarning(this + "AddLineButton Error : null == line");
                return(false);
            }

            DrawGraphicLines lines = line.GetComponent <DrawGraphicLines>();

            if (!lines)
            {
                Debug.LogWarning(this + "AddLineButton Error : null == lines");
                return(false);
            }

            GameObject button = Instantiate((GameObject)Resources.Load("Prefabs/LineButton"), lineButtonsContent.transform);

            if (!button)
            {
                Debug.LogWarning(this + "AddLineButton Error : null == button");
                return(false);
            }
            button.GetComponent <LineButton>().Line = line;
            return(true);
        }