Пример #1
0
        public void ConvertToSerializable(Blade blade)
        {
            var transform = blade.transform;
            var position  = transform.position;

            x = (int)position.x;
            y = (int)position.y;
            z = (int)position.z;

            var eulerAngles = transform.eulerAngles;

            u = (int)eulerAngles.x;
            v = (int)eulerAngles.y;
            w = (int)eulerAngles.z;

            l = new List <IntVector3>();
            foreach (var loc in blade.locations)
            {
                IntVector3 pos;
                pos.x = (int)loc.x;
                pos.y = (int)loc.y;
                pos.z = (int)loc.z;
                l.Add(pos);
            }
        }
Пример #2
0
        public Blade GetBlade()
        {
            var blade = new Blade();

            blade.locations = new List <Vector3>();
            foreach (var loc in l)
            {
                Vector3 pos;
                pos.x = loc.x;
                pos.y = loc.y;
                pos.z = loc.z;
                blade.locations.Add(pos);
            }
            return(blade);
        }
Пример #3
0
 public void SetBladeValues(Blade blade)
 {
     locations = blade.locations;
 }