Collider for 2D physics representing an arbitrary polygon defined by its vertices.

Inheritance: Collider2D
	// Use this for initialization
	void Start () {
		area = this.gameObject.GetComponent<PolygonCollider2D> (); 
		/*Vector3[] passIn = new Vector3[points.Length]; 
		for (int i = 0; i < points.Length; i++)
			passIn [i] = points [i].transform.position; 
		SetCollider (passIn); */
	}
Beispiel #2
0
 void Start()
 {
     base.Start();
     anim = GetComponent<Animator>();
     rigid = GetComponent<Rigidbody2D>();
     collider = GetComponent<PolygonCollider2D>();
 }
        // Use this for initialization
        void Awake()
        {
            spriteRend = GetComponent<SpriteRenderer> ();
            collider = GetComponent<PolygonCollider2D> ();

            //DestroyPlanetChunk ();
        }
	// Use this for initialization
	void Awake () {
        ignoreCollisionList = new List<Collider2D>();

        rigid = GetComponent<Rigidbody2D>();

        ball = this.gameObject.AddComponent<PolygonCollider2D>();
        ball.sharedMaterial = ballPhysicsMat;

        rend = GetComponent<LineRenderer>();

        Vector2[] points = new Vector2[2 * (numSides + 1)];
        rend.SetVertexCount(numSides + 1);

        float visualRadius = (outerRadius + innerRadius) / 2;
        rend.SetWidth(outerRadius - innerRadius, outerRadius - innerRadius);

        // inner points
        for (int i = 0; i <= numSides; i++)
        {
            float angle = TwoPI * i / numSides;
            Vector2 direction = new Vector2(Mathf.Cos(angle), Mathf.Sin(angle));
            points[i] = innerRadius * direction;
            rend.SetPosition(i, visualRadius * direction);

        }

        // outer points
        for (int i = numSides + 1; i < points.Length; i++)
        {
            float angle = TwoPI * i / numSides;
            points[i] = new Vector2(outerRadius * Mathf.Cos(angle), outerRadius * Mathf.Sin(angle));
        }

        ball.points = points;
	}
 void Start()
 {
     // Create a polygon collider
     localCollider = gameObject.AddComponent<PolygonCollider2D>();
     localCollider.isTrigger = true; // Set as a trigger so it doesn't collide with our environment
     localCollider.pathCount = 0; // Clear auto-generated polygons
 }
// fields

// properties
    static void PolygonCollider2D_points(JSVCall vc)
    {
        if (vc.bGet)
        {
            UnityEngine.PolygonCollider2D _this = (UnityEngine.PolygonCollider2D)vc.csObj;
            var result = _this.points;
            var arrRet = result;
            for (int i = 0; arrRet != null && i < arrRet.Length; i++)
            {
                JSApi.setVector2S((int)JSApi.SetType.SaveAndTempTrace, arrRet[i]);
                JSApi.moveSaveID2Arr(i);
            }
            JSApi.setArrayS((int)JSApi.SetType.Rval, (arrRet != null ? arrRet.Length : 0), true);
        }
        else
        {
            UnityEngine.Vector2[] arg0 = JSDataExchangeMgr.GetJSArg <UnityEngine.Vector2[]>(() =>
            {
                int jsObjID = JSApi.getObject((int)JSApi.GetType.Arg);
                int length  = JSApi.getArrayLength(jsObjID);
                var ret     = new UnityEngine.Vector2[length];
                for (var i = 0; i < length; i++)
                {
                    JSApi.getElement(jsObjID, i);
                    ret[i] = (UnityEngine.Vector2)JSApi.getVector2S((int)JSApi.GetType.SaveAndRemove);
                }
                return(ret);
            });
            UnityEngine.PolygonCollider2D _this = (UnityEngine.PolygonCollider2D)vc.csObj;
            _this.points = arg0;
        }
    }
Beispiel #7
0
 static public int constructor(IntPtr l)
 {
     UnityEngine.PolygonCollider2D o;
     o = new UnityEngine.PolygonCollider2D();
     pushObject(l, o);
     return(1);
 }
    void Awake()
    {
        lightMesh = new Mesh();
        lightMesh.name = string.Format("Light Mesh ({0})", name);
        lightMesh.MarkDynamic();

        meshFilter = GetComponent<MeshFilter>();
        meshFilter.mesh = lightMesh;

        meshRenderer = GetComponent<MeshRenderer>();
        meshRenderer.sharedMaterial = lightMaterial;

        var container = transform.Find("LightMesh");
        if (!container)
        {
            container = new GameObject("LightMesh").transform;
            container.SetParent(transform, true);
            container.localPosition = Vector3.zero;
            container.gameObject.layer = gameObject.layer;
        }

        lightMeshCollider = container.GetComponent<PolygonCollider2D>();
        if (lightMeshCollider == null)
        {
            lightMeshCollider = container.gameObject.AddComponent<PolygonCollider2D>();
        }

        lightMeshCollider.isTrigger = true;

        vertices = new List<Vertex>();

        UpdateLightFX();
    }
	// Use this for initialization
    protected override void Awake()
    {
        base.Awake();
		vfx = GetComponent<ParticleSystem>();
		coll = GetComponent<PolygonCollider2D>();
		effector = GetComponent<PointEffector2D>();
	}
Beispiel #10
0
 void Start()
 {
     hitbox = gameObject.AddComponent<PolygonCollider2D>();
     hitbox.isTrigger = true;
     AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Skills/Slash/slash_" + Random.Range(0,3).ToString()), gameObject.transform.position);
     StartCoroutine("playAnimation", attackSpeed);
 }
Beispiel #11
0
	// ============= GENERATION ==============
	private void Awake() {
		allPoints = new List<Point>();
		edgePoints = new List<Point>();
		finishingPoints = new List<Point>();
		polygonCollider = GetComponent<PolygonCollider2D>();
		mesh = GetComponent<TriangulatedMesh>();
	}
    // Use this for initialization
    void Start()
    {

        audio = gameObject.GetComponent<AudioSource>();
        rb = GetComponent<Rigidbody2D>();
        collision = GetComponent<PolygonCollider2D>();
    }
 static public int set_points(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.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         UnityEngine.Vector2[]         v;
         checkArray(l, 2, out v);
         self.points = v;
         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
 }
Beispiel #14
0
	// Use this for initialization
	void Start () {
        this.currentState = "Square"; // Game starts with Square
        this.animator = this.GetComponent<Animator>();
        this.currentDirection = 1; // 1 for RIGHT / -1 for LEFT

        this.world = GameObject.Find("World");
        this.isStucked = false;
        this.isControllerLocked = false;

        //Initialize the sounds
        /*this.fitTargetSound = this.audioPrefab.transform.GetChild(0).GetComponent<AudioSource>();
        this.dieSound = this.audioPrefab.transform.GetChild(1).GetComponent<AudioSource>();
        this.landscapeSound = this.audioPrefab.transform.GetChild(2).GetComponent<AudioSource>();
        this.changeSound = this.audioPrefab.transform.GetChild(3).GetComponent<AudioSource>();
        this.bounceSound = this.audioPrefab.transform.GetChild(4).GetComponent<AudioSource>();
        */
        //Grab the colliders
        this.SquareCollider = this.GetComponent<BoxCollider2D>();
        this.CircleCollider = this.GetComponent<CircleCollider2D>();
        this.TriangleCollider = this.GetComponent<PolygonCollider2D>();

        //Grab the Rigidbody
        this.rigidBody = this.GetComponent<Rigidbody2D>();
        this.setRigidbody();
	}
Beispiel #15
0
    void Reset()
    {

        gameObject.name = "@PolyNav2D";
        masterCollider = GetComponent<PolygonCollider2D>();
        masterCollider.isTrigger = true;
    }
 private void MakeBounds(PolygonCollider2D source)
 {
     if (source.renderer == null)
     {
     Vector2[] points = source.points;
     float maxX = float.NegativeInfinity;
     float maxY = float.NegativeInfinity;
     foreach (Vector2 point in points)
     {
         if (point.x > maxX)
         {
             maxX = point.x;
         }
         if (point.y > maxY)
         {
             maxY = point.y;
         }
     }
     Vector2 maxSize = new Vector2(maxX, maxY);
     Vector2 pos = source.transform.position;
     Vector2 polySize = maxSize - pos;
     MakeBounds(source.gameObject, polySize, Vector2.zero);
     }
     else
     {
     MakeBounds(source.renderer);
     }
 }
    void Awake()
    {
        rigidbody = GetComponent<Rigidbody2D>();
        body = GetComponent<PolygonCollider2D>();
        feet = GetComponent<CircleCollider2D>();
        health = GetComponent<Health>();
        standing = body.points;
        crouched = new Vector2[standing.Length];
        grounded = false;
        onWall = false;
        upSlope = false;
        downSlope = false;

        int min = 0;
        for (int i = 0; i < standing.Length; i++)
        {
            if (standing[i].y < standing[min].y)
                min = i;
        }
        for (int i = 0; i < standing.Length; i++)
        {
            float newY = (standing[i].y - standing[min].y) * 0.5f + standing[min].y;
            crouched[i] = new Vector2(standing[i].x, newY);
        }
    }
    public override void RebuildAllColliders()
    {
        UpdateCollidable();

        DestroyCollider();

        var alphaTex = destructibleSprite.AlphaTex;

        if (alphaTex != null)
        {
            var spriteRenderer = D2D_Helper.GetOrAddComponent<SpriteRenderer>(child);
            var sprite         = Sprite.Create(alphaTex, new Rect(0, 0, alphaTex.width, alphaTex.height), Vector2.zero, 1.0f, 0, SpriteMeshType.FullRect);

            spriteRenderer.sprite = sprite;

            collider = child.AddComponent<PolygonCollider2D>();

            // Disable the collider if it couldn't form any triangles
            collider.enabled = IsDefaultPolygonCollider2D(collider) == false;

            D2D_Helper.Destroy(sprite);
            D2D_Helper.Destroy(spriteRenderer);

            UpdateColliderSettings();
        }
    }
 static public int GetPath(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.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         var ret = self.GetPath(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     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
 }
Beispiel #20
0
 public override void AssignValues(List<ActionParameter> parameters)
 {
     if (sceneSetting == SceneSetting.DefaultNavMesh)
     {
         if (KickStarter.sceneSettings.navigationMethod == AC_NavigationMethod.PolygonCollider && changeNavMeshMethod == ChangeNavMeshMethod.ChangeNumberOfHoles)
         {
             hole = AssignFile <PolygonCollider2D> (parameters, parameterID, constantID, hole);
             replaceHole = AssignFile <PolygonCollider2D> (parameters, replaceParameterID, replaceConstantID, replaceHole);
         }
         else
         {
             newNavMesh = AssignFile <NavigationMesh> (parameters, parameterID, constantID, newNavMesh);
         }
     }
     else if (sceneSetting == SceneSetting.DefaultPlayerStart)
     {
         playerStart = AssignFile <PlayerStart> (parameters, parameterID, constantID, playerStart);
     }
     else if (sceneSetting == SceneSetting.SortingMap)
     {
         sortingMap = AssignFile <SortingMap> (parameters, parameterID, constantID, sortingMap);
     }
     else if (sceneSetting == SceneSetting.SortingMap)
     {
         tintMap = AssignFile <TintMap> (parameters, parameterID, constantID, tintMap);
     }
     else if (sceneSetting == SceneSetting.OnLoadCutscene || sceneSetting == SceneSetting.OnStartCutscene)
     {
         cutscene = AssignFile <Cutscene> (parameters, parameterID, constantID, cutscene);
     }
 }
		override public void AssignValues (List<ActionParameter> parameters)
		{
			SceneSettings sceneSettings = GameObject.FindWithTag (Tags.gameEngine).GetComponent <SceneSettings>();

			if (sceneSetting == SceneSetting.DefaultNavMesh)
			{
				if (sceneSettings.navigationMethod == AC_NavigationMethod.PolygonCollider && changeNavMeshMethod == ChangeNavMeshMethod.ChangeNumberOfHoles)
				{
					hole = AssignFile <PolygonCollider2D> (parameters, parameterID, constantID, hole);
				}
				else
				{
					newNavMesh = AssignFile <NavigationMesh> (parameters, parameterID, constantID, newNavMesh);
				}
			}
			else if (sceneSetting == SceneSetting.DefaultPlayerStart)
			{
				playerStart = AssignFile <PlayerStart> (parameters, parameterID, constantID, playerStart);
			}
			else if (sceneSetting == SceneSetting.SortingMap)
			{
				sortingMap = AssignFile <SortingMap> (parameters, parameterID, constantID, sortingMap);
			}
			else if (sceneSetting == SceneSetting.OnLoadCutscene || sceneSetting == SceneSetting.OnStartCutscene)
			{
				cutscene = AssignFile <Cutscene> (parameters, parameterID, constantID, cutscene);
			}
		}
Beispiel #22
0
    public void DrawAsteroid()
    {
        var drawObject = GetComponent<LineRendererDrawer>();
        polyCollider = GetComponent<PolygonCollider2D>();
        var linePoints = circleSegments + 1;
        var polyPoints = new Vector2[linePoints];
        var drawPoints = new List<Vector2>();
        float part = 360f / circleSegments;
        int i = 0;
        while (i < linePoints)
        {
            float duh = part * i * (2 * Mathf.PI / 360) * -1 + Mathf.PI / 2;
            Vector3 pos = new Vector3((Mathf.Cos(duh) * radius), (Mathf.Sin(duh) * radius), 0);

            if (i != 0 && i != (linePoints - 1))
            {
                pos = new Vector3(pos.x + Random.Range(-radius / 4, radius / 4), pos.y + Random.Range(-radius / 4, radius / 4), 0);
            }

            drawPoints.Add(pos);
            polyPoints[i] = new Vector2(pos.x, pos.y);
            i++;
        }
        drawObject.SetPoints(drawPoints);
        polyCollider.points = polyPoints;
    }
Beispiel #23
0
    //---------------------------------------------------------------------------------------------

    protected virtual void OnDrawGizmos()
    {
        Follow();

        if (!m_pCollider)
            m_pCollider = GetComponent<PolygonCollider2D>();

        Vector2[] points = m_pCollider.points;
        Vector2 p2D = transform.position;

        if (points == null) return;

        Vector3 pointCurrent, pointNext;
        Vector3 angles = transform.rotation.eulerAngles;

        for (var i = 0; i < points.Length - 1; i++)
        {
            pointCurrent = KDTools.Adjust(points[i], p2D, angles, transform.localScale);
            pointNext = KDTools.Adjust(points[i + 1], p2D, angles, transform.localScale);
            Gizmos.DrawLine(pointCurrent, pointNext);
        }

        pointCurrent = KDTools.Adjust
                       (
                            points[points.Length - 1], 
                            p2D, 
                            angles,
                            transform.localScale
                        );

        pointNext = KDTools.Adjust(points[0], p2D, angles, transform.localScale);

        Gizmos.DrawLine(pointCurrent, pointNext);
    }
Beispiel #24
0
 void Start()
 {
     scoreGUI = GameObject.Find ("ScoreGUI");
     sound01 = GetComponent<AudioSource> ();
     rigidbody2D = GetComponent<Rigidbody2D>();
     polygon = GetComponent<PolygonCollider2D> ();
     sp = GetComponent<SpriteRenderer> ();
 }
 // Use this for initialization
 void Awake()
 {
     light2d = GetComponent<Light2D>();
     renderer = GetComponent<MeshRenderer>();
     sprite = GetComponentInChildren<SpriteRenderer>();
     collider = GetComponentInChildren<PolygonCollider2D>();
     DrawSprite();
 }
Beispiel #26
0
 /**
  * <summary>Removes the effects of a PolygonCollider2D on the shape of the base PolygonCollider2D.
  * This function will only have an effect if the PolygonCollider2D was previously added, using AddHole().</sumary>
  * <param name = "oldHole">The new PolygonCollider2D to remove</param>
  */
 public void RemoveHole(PolygonCollider2D oldHole)
 {
     if (polygonColliderHoles.Contains (oldHole))
     {
         polygonColliderHoles.Remove (oldHole);
         ResetHoles ();
     }
 }
	internal CasterCollider(PolygonCollider2D coll){
		collider = coll;
		transform = coll.transform;
		TotalPointsCount = coll.GetTotalPointCount();
		points = new Vector2[TotalPointsCount];
		points = coll.points;
		type = CasterType.PolygonCollider2d;
	}
 private void Awake()
 {
     animator = GetComponent<Animator>();
     audioSource = GetComponent<AudioSource>();
     enemyRigidbody = GetComponent<Rigidbody2D>();
     spriteRenderer = GetComponent<SpriteRenderer>();
     enemyCollider = GetComponent<PolygonCollider2D>();
 }
Beispiel #29
0
	void Start()
	{
		target = GameObject.Find("Shrine").transform;
		//killCounter = GetComponent<Text> ();
		enemyAudio = GetComponent<AudioSource> ();
		polyColl = GetComponent<PolygonCollider2D> ();
		spriteRend = GetComponent<SpriteRenderer> ();
	}
Beispiel #30
0
 void Start()
 {
     Debug.Log("Started");
     gameObject.AddComponent<LineRenderer>();
     classpc = gameObject.AddComponent<PolygonCollider2D>();
     classpc.SetPath(0, new Vector2[] { });
     //classpc.SetPath(1, new Vector2[] { });
 }
Beispiel #31
0
 static public int set_points(IntPtr l)
 {
     UnityEngine.PolygonCollider2D o = (UnityEngine.PolygonCollider2D)checkSelf(l);
     UnityEngine.Vector2[]         v;
     checkType(l, 2, out v);
     o.points = v;
     return(0);
 }
Beispiel #32
0
    static public int set_pathCount(IntPtr l)
    {
        UnityEngine.PolygonCollider2D o = (UnityEngine.PolygonCollider2D)checkSelf(l);
        int v;

        checkType(l, 2, out v);
        o.pathCount = v;
        return(0);
    }
		public void Destroy()
		{
			if (PolygonCollider2D != null)
			{
				D2D_Helper.Destroy(PolygonCollider2D);
				
				PolygonCollider2D = null;
			}
		}
		public void ReplaceCollider(PolygonCollider2D newPolygonCollider2D)
		{
			if (PolygonCollider2D != newPolygonCollider2D)
			{
				Destroy();
				
				PolygonCollider2D = newPolygonCollider2D;
			}
		}
	private void DestroyPolygonCollider2D()
	{
		if (polygonCollider2D != null)
		{
			D2D_Helper.Destroy(polygonCollider2D);
			
			polygonCollider2D = null;
		}
	}
Beispiel #36
0
	// Use this for initialization
	void Awake () {
		mCollider = gameObject.GetComponent<PolygonCollider2D> ();
		Vector2[] points = new Vector2[4];
		points [0] = new Vector2 (1.0f, 0.0f) * blastDiameter / 2;
		points [1] = new Vector2 (0.0f, 1.0f) * blastDiameter / 4;
		points [2] = new Vector2 (-1.0f, 0.0f) * blastDiameter / 2;
		points [3] = new Vector2 (0.0f, -1.0f) * blastDiameter / 4;
		mCollider.points = points;
	}	
Beispiel #37
0
 static public int get_autoTiling(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         pushValue(l, self.autoTiling);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #38
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D o;
         o = new UnityEngine.PolygonCollider2D();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #39
0
 static public int GetTotalPointCount(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         var ret = self.GetTotalPointCount();
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #40
0
 static public int get_pathCount(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         pushValue(l, self.pathCount);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int get_pathCount(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.pathCount);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #42
0
 static public int SetPath(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
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(int), typeof(UnityEngine.Vector2[])))
         {
             UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             UnityEngine.Vector2[] a2;
             checkArray(l, 3, out a2);
             self.SetPath(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (matchType(l, argc, 2, typeof(int), typeof(List <UnityEngine.Vector2>)))
         {
             UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Collections.Generic.List <UnityEngine.Vector2> a2;
             checkType(l, 3, out a2);
             self.SetPath(a1, a2);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function SetPath to call");
         return(2);
     }
     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
 }
Beispiel #43
0
 static public int set_points(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         UnityEngine.Vector2[]         v;
         checkType(l, 2, out v);
         self.points = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #44
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D o;
         o = new UnityEngine.PolygonCollider2D();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Beispiel #45
0
 static public int GetTotalPointCount(IntPtr l)
 {
     try{
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         System.Int32 ret = self.GetTotalPointCount();
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Beispiel #46
0
 static public int set_pathCount(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         int v;
         checkType(l, 2, out v);
         self.pathCount = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #47
0
 static public int constructor(IntPtr l)
 {
     LuaDLL.lua_remove(l, 1);
     UnityEngine.PolygonCollider2D o;
     if (matchType(l, 1))
     {
         o = new UnityEngine.PolygonCollider2D();
         pushObject(l, o);
         return(1);
     }
     LuaDLL.luaL_error(l, "New object failed.");
     return(0);
 }
Beispiel #48
0
 static public int set_autoTiling(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         bool v;
         checkType(l, 2, out v);
         self.autoTiling = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #49
0
 static int QPYX_GetTotalPointCount_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 1);
         UnityEngine.PolygonCollider2D QPYX_obj_YXQP = (UnityEngine.PolygonCollider2D)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.PolygonCollider2D));
         int QPYX_o_YXQP = QPYX_obj_YXQP.GetTotalPointCount();
         LuaDLL.lua_pushinteger(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Beispiel #50
0
 static public int GetPath(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         var ret = self.GetPath(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static void PolygonCollider2D_pathCount(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.PolygonCollider2D _this = (UnityEngine.PolygonCollider2D)vc.csObj;
         var result = _this.pathCount;
         JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(result));
     }
     else
     {
         System.Int32 arg0 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
         UnityEngine.PolygonCollider2D _this = (UnityEngine.PolygonCollider2D)vc.csObj;
         _this.pathCount = arg0;
     }
 }
Beispiel #52
0
 static int QPYX_GetPath_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         UnityEngine.PolygonCollider2D QPYX_obj_YXQP = (UnityEngine.PolygonCollider2D)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.PolygonCollider2D));
         int QPYX_arg0_YXQP = (int)LuaDLL.luaL_checknumber(L_YXQP, 2);
         UnityEngine.Vector2[] QPYX_o_YXQP = QPYX_obj_YXQP.GetPath(QPYX_arg0_YXQP);
         ToLua.Push(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static int GetTotalPointCount(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.PolygonCollider2D obj = (UnityEngine.PolygonCollider2D)ToLua.CheckObject(L, 1, typeof(UnityEngine.PolygonCollider2D));
         int o = obj.GetTotalPointCount();
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #54
0
 static int QPYX_SetPath_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 3);
         UnityEngine.PolygonCollider2D QPYX_obj_YXQP = (UnityEngine.PolygonCollider2D)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.PolygonCollider2D));
         int QPYX_arg0_YXQP = (int)LuaDLL.luaL_checknumber(L_YXQP, 2);
         UnityEngine.Vector2[] QPYX_arg1_YXQP = ToLua.CheckStructArray <UnityEngine.Vector2>(L_YXQP, 3);
         QPYX_obj_YXQP.SetPath(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
         return(0);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Beispiel #55
0
 static public int SetPath(IntPtr l)
 {
     try {
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         UnityEngine.Vector2[] a2;
         checkType(l, 3, out a2);
         self.SetPath(a1, a2);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #56
0
 static public int GetPath(IntPtr l)
 {
     try{
         UnityEngine.PolygonCollider2D self = (UnityEngine.PolygonCollider2D)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         UnityEngine.Vector2[] ret = self.GetPath(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static int GetPath(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.PolygonCollider2D obj = (UnityEngine.PolygonCollider2D)ToLua.CheckObject(L, 1, typeof(UnityEngine.PolygonCollider2D));
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         UnityEngine.Vector2[] o = obj.GetPath(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int SetPath(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UnityEngine.PolygonCollider2D obj = (UnityEngine.PolygonCollider2D)ToLua.CheckObject(L, 1, typeof(UnityEngine.PolygonCollider2D));
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         UnityEngine.Vector2[] arg1 = ToLua.CheckStructArray <UnityEngine.Vector2>(L, 3);
         obj.SetPath(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int set_points(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.PolygonCollider2D obj  = (UnityEngine.PolygonCollider2D)o;
            UnityEngine.Vector2[]         arg0 = ToLua.CheckStructArray <UnityEngine.Vector2>(L, 2);
            obj.points = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index points on a nil value"));
        }
    }
    static int set_pathCount(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.PolygonCollider2D obj = (UnityEngine.PolygonCollider2D)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.pathCount = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index pathCount on a nil value"));
        }
    }