UnityEngine.PolygonCollider2D.CreatePrimitive C# (CSharp) Method

CreatePrimitive() public method

Creates as regular primitive polygon with the specified number of sides.

public CreatePrimitive ( int sides, [ scale, [ offset ) : void
sides int The number of sides in the polygon. This must be greater than two.
scale [ The X/Y scale of the polygon. These must be greater than zero.
offset [ The X/Y offset of the polygon.
return void
        public void CreatePrimitive(int sides, [DefaultValue("Vector2.one")] Vector2 scale, [DefaultValue("Vector2.zero")] Vector2 offset)
        {
            INTERNAL_CALL_CreatePrimitive(this, sides, ref scale, ref offset);
        }

Same methods

PolygonCollider2D::CreatePrimitive ( int sides ) : void
PolygonCollider2D::CreatePrimitive ( int sides, Vector2 scale ) : void

Usage Example

 static public int CreatePrimitive(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             self.CreatePrimitive(a1);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 3)
         {
             UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             UnityEngine.Vector2 a2;
             checkType(l, 3, out a2);
             self.CreatePrimitive(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 4)
         {
             UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             UnityEngine.Vector2 a2;
             checkType(l, 3, out a2);
             UnityEngine.Vector2 a3;
             checkType(l, 4, out a3);
             self.CreatePrimitive(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of UnityEngine.PolygonCollider2D::CreatePrimitive