Пример #1
0
    /// <summary>
    /// 创建一个新阵型
    /// </summary>
    /// <returns>The foramtion.</returns>
    /// <param name="url">URL.</param>
    public static Formation CreateForamtion(string url)
    {
        byte[] bytes = ResourceManger.Instance.GetBytes(url);
        if (bytes == null || bytes.Length == 0)
        {
            return(null);
        }

        ByteReader reader     = new ByteReader(bytes);
        int        childCount = reader.Read <int> ();

        Formation f = new Formation();

        for (int i = 0; i < childCount; i++)
        {
            Vector3 pos = reader.ReadVector3();
            f.AddPoint(pos);
        }

        return(f);
    }