Example #1
0
        private void OnDrawGizmosSelected()
        {
            GUIStyle uIStyle = new GUIStyle();

            uIStyle.fontSize  = 30;
            uIStyle.fontStyle = FontStyle.Bold;

            ED_ActorPathPointCom[] pointComs = gameObject.GetComponentsInChildren <ED_ActorPathPointCom>(true);
            if (pointComs != null)
            {
                for (int i = 0; i < pointComs.Length; i++)
                {
                    ED_ActorPathPointCom tPointCom = pointComs[i];
                    int nextIndex = i + 1;
                    if (nextIndex > 0 && nextIndex < pointComs.Length)
                    {
                        ED_ActorPathPointCom tNextPointCom = pointComs[nextIndex];
                        GizmosHelper.DrawLine(tPointCom.transform.position, tNextPointCom.transform.position, Color.white);
                    }

                    GUI.color = Color.black;
                    Handles.Label(tPointCom.transform.position, (i + 1).ToString(), uIStyle);
                    GUI.color = Color.white;
                }
            }
        }
Example #2
0
        public override object ExportData()
        {
            ActorPathModel pathData = new ActorPathModel();

            pathData.defaultPath = defaultPath;
            pathData.closePath   = closePath;
            pathData.pathSpeed   = pathSpeed;

            ED_ActorPathPointCom[] pointComs = gameObject.GetComponentsInChildren <ED_ActorPathPointCom>(true);
            if (pointComs != null)
            {
                for (int i = 0; i < pointComs.Length; i++)
                {
                    ED_ActorPathPointCom tPointCom = pointComs[i];
                    pathData.points.Add((ActorPointModel)tPointCom.ExportData());
                }
            }

            return(pathData);
        }