static public int OverridePhysicsShape(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.Sprite self = (UnityEngine.Sprite)checkSelf(l);
         System.Collections.Generic.IList <UnityEngine.Vector2[]> a1;
         checkType(l, 2, out a1);
         self.OverridePhysicsShape(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
 static public int OverridePhysicsShape(IntPtr l)
 {
     try {
         UnityEngine.Sprite self = (UnityEngine.Sprite)checkSelf(l);
         System.Collections.Generic.IList <UnityEngine.Vector2[]> a1;
         checkType(l, 2, out a1);
         self.OverridePhysicsShape(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#3
0
 static int QPYX_OverridePhysicsShape_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         UnityEngine.Sprite QPYX_obj_YXQP = (UnityEngine.Sprite)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.Sprite));
         System.Collections.Generic.IList <UnityEngine.Vector2[]> QPYX_arg0_YXQP = (System.Collections.Generic.IList <UnityEngine.Vector2[]>)ToLua.CheckObject <System.Collections.Generic.IList <UnityEngine.Vector2[]> >(L_YXQP, 2);
         QPYX_obj_YXQP.OverridePhysicsShape(QPYX_arg0_YXQP);
         return(0);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static int OverridePhysicsShape(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.Sprite obj = (UnityEngine.Sprite)ToLua.CheckObject(L, 1, typeof(UnityEngine.Sprite));
         System.Collections.Generic.IList <UnityEngine.Vector2[]> arg0 = (System.Collections.Generic.IList <UnityEngine.Vector2[]>)ToLua.CheckObject <System.Collections.Generic.IList <UnityEngine.Vector2[]> >(L, 2);
         obj.OverridePhysicsShape(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#5
0
 public void OverridePhysicsShape(IList <Vector2[]> physicsShapes)
 {
     for (int i = 0; i < physicsShapes.Count; i++)
     {
         Vector2[] array = physicsShapes[i];
         if (array == null)
         {
             throw new ArgumentNullException(string.Format("Physics Shape at {0} is null.", i));
         }
         if (array.Length < 3)
         {
             throw new ArgumentException(string.Format("Physics Shape at {0} has less than 3 vertices ({1}).", i, array.Length));
         }
     }
     Sprite.OverridePhysicsShapeCount(this, physicsShapes.Count);
     for (int j = 0; j < physicsShapes.Count; j++)
     {
         Sprite.OverridePhysicsShape(this, physicsShapes[j], j);
     }
 }