Example #1
0
        public static void Read(Nettention.Proud.Message msg, out Vector3Array posArray)
        {
            int count = 0;

            msg.Read(out count);

            if (count > 0)
            {
                UnityEngine.Vector3[] posData = new UnityEngine.Vector3[count];

                for (int i = 0; i < count; i++)
                {
                    UnityEngine.Vector3 data = new UnityEngine.Vector3();

                    msg.Read(out data.x);
                    msg.Read(out data.y);
                    msg.Read(out data.z);

                    posData[i] = data;
                }

                posArray = new Vector3Array(posData);
            }
            else
            {
                posArray = new Vector3Array();
            }
        }
Example #2
0
        public static void Write(Nettention.Proud.Message msg, Vector3Array posArray)
        {
            if (posArray == null)
            {
                return;
            }

            msg.Write(posArray.Count);

            for (int i = 0; i < posArray.Count; i++)
            {
                UnityEngine.Vector3 data = posArray.data[i];

                msg.Write(data.x);
                msg.Write(data.y);
                msg.Write(data.z);
            }
        }