Esempio n. 1
0
        public string[] Serialize()
        {
            var targetsData = targets.Select(t => new TransformData {
                name     = t.name,
                position = t.position,
                rotation = t.rotation,
            });

            return(SimpleSerializer.Serialize(targetsData));
        }
Esempio n. 2
0
 public void Deserialize(string[] lines)
 {
     foreach (var data in SimpleSerializer.Deserialize <TransformData>(lines))
     {
         var target = FindNamedTarget(data.name);
         if (target != null)
         {
             target.position = data.position;
             target.rotation = data.rotation;
         }
         else
         {
             Debug.LogWarning("No transform found: " + data.name);
         }
     }
 }