예제 #1
0
 //Some very funky maths to make sure all the scale values are off the bones and on the sprite instead
 public bool Process(SpatialInfo parent)
 {
     if (GetType() == typeof(SpatialInfo))
     {
         scale_x    = (scale_x > 0) ? 1 : -1;
         scale_y    = (scale_y > 0) ? 1 : -1;
         trueScaleX = Mathf.Abs(trueScaleX);
         trueScaleY = Mathf.Abs(trueScaleY);
         if (parent != null)
         {
             if (!float.IsNaN(parent.trueScaleX))
             {
                 _x         *= parent.trueScaleX;
                 trueScaleX *= parent.trueScaleX;
             }
             if (!float.IsNaN(parent.trueScaleY))
             {
                 _y         *= parent.trueScaleY;
                 trueScaleY *= parent.trueScaleY;
             }
         }
         return(processed = true);
     }
     if (parent != null)
     {
         if (!float.IsNaN(parent.trueScaleX))
         {
             _x      *= parent.trueScaleX;
             scale_x *= parent.trueScaleX;
         }
         if (!float.IsNaN(parent.trueScaleY))
         {
             _y      *= parent.trueScaleY;
             scale_y *= parent.trueScaleY;
         }
     }
     return(processed = true);
 }
예제 #2
0
 //Some very funky maths to make sure all the scale values are off the bones and on the sprite instead
 public bool Process(SpatialInfo parent)
 {
     if (GetType () == typeof(SpatialInfo)) {
         scale_x = (scale_x > 0) ? 1 : -1;
         scale_y = (scale_y > 0) ? 1 : -1;
         trueScaleX = Mathf.Abs (trueScaleX);
         trueScaleY = Mathf.Abs (trueScaleY);
         if (parent != null) {
             if (!float.IsNaN (parent.trueScaleX)) {
                 _x *= parent.trueScaleX;
                 trueScaleX *= parent.trueScaleX;
             }
             if (!float.IsNaN (parent.trueScaleY)) {
                 _y *= parent.trueScaleY;
                 trueScaleY *= parent.trueScaleY;
             }
         }
         return processed = true;
     }
     if (parent != null) {
         if (!float.IsNaN (parent.trueScaleX)) {
             _x *= parent.trueScaleX;
             scale_x *= parent.trueScaleX;
         }
         if (!float.IsNaN (parent.trueScaleY)) {
             _y *= parent.trueScaleY;
             scale_y *= parent.trueScaleY;
         }
     }
     return processed = true;
 }