Exemplo n.º 1
0
    void Start()
    {
        m_WayMgr = new WayPointMgr();

        int[]          arr  = Util.StringToTArray <int>(m_Points, ',');
        List <Vector3> list = new List <Vector3>();

        Transform tf;

        foreach (int id in arr)
        {
            tf = m_PointFather.FindChild(string.Format("p{0}", id));
            if (tf != null)
            {
                list.Add(tf.position);
            }
        }

        m_WayMgr.SetWayPoints(list.ToArray());
        m_PassedDis = 0f;
        m_Moving    = true;
#if UNITY_EDITOR
        m_Step = (int)(m_WayMgr.Length / m_Speed);
#endif
    }