Example #1
0
        public GameObject AddLine(string name)
        {
            CoordinateAxis coordinate = coordinateAxisGO.GetComponent <CoordinateAxis>();

            if (coordinate.lineNum >= maxLineNum)
            {
                Debug.Log("coordinate.lineNum > maxLineNum");
                return(null);
            }

            if (coordinate.lineNum != lineButtonsContent.transform.childCount)
            {
                Debug.Log("coordinate.lineNum != m_LineButtonList.Count");
            }

            GameObject line = coordinate.AddLine(name);

            if (!AddLineButton(line))
            {
                if (!coordinate.RemoveLine(line))
                {
                    Debug.Log(this.ToString() + " AddLine error : false == coordinate.RemoveLine(line)");
                }
                line = null;
            }
            return(line);
        }
Example #2
0
        private void Awake()
        {
            CoordinateAxis coordinateAxis = transform.GetComponentInChildren <CoordinateAxis>();

            if (coordinateAxis == null)
            {
                coordinateAxisGO      = Instantiate((GameObject)Resources.Load("Prefabs/CoordinateAxis"), gameObject.transform);
                coordinateAxisGO.name = "CoordinateAxis";
            }
            else
            {
                coordinateAxisGO = coordinateAxis.gameObject;
            }

            LineButtonsContent tempObject = GetComponentInChildren <LineButtonsContent>();

            if (tempObject == null)
            {
                Debug.LogWarning(this + "Awake Error : null == lineButtonsContent");
                return;
            }
            else
            {
                if ((lineButtonsContent = tempObject.gameObject) == null)
                {
                    Debug.LogWarning(this + "Awake Error : null == lineButtonsContent");
                    return;
                }
            }
        }
Example #3
0
        public void InputPoint(GameObject line, Vector2 point)
        {
            CoordinateAxis coordinate = coordinateAxisGO.GetComponent <CoordinateAxis>();

            coordinate.InputPoint(line, point);
        }