Inheritance: Behaviour
Exemple #1
8
 void OnTriggerEnter2D(Collider2D c)
 {
     //print ("Pokeball pushes back "+c.gameObject.name);
     if (c.gameObject.GetComponent<ReceiveKnockback>()!=null && c.gameObject.name != my_parent_name && !c.GetComponent<PlayerController>().locked) {
         c.gameObject.GetComponent<Consciousness>().TakeDamage(3, pid);
         //if what we hit is a player and isn't the player who made us...
         Vector2 knockback = GetComponent<Rigidbody2D>().velocity;
         knockback.Normalize ();
         knockback.x *= KNOCKBACK_AMOUNT;
         knockback.y *= KNOCKBACK_AMOUNT;
         Knockback knockbackObject = new Knockback(KNOCKBACK_TIME,knockback);
         c.gameObject.SendMessage("GetKnockedBack", knockbackObject);
         //...activate the GetKnockedBack function of the thing we just hit
         //causing them to fly backward! In players, this function is in PlayerMovement.
     }
     //ADD EXCEPTIONS FOR DIE_ON_CONTACT object destroys here \/
     if (die_on_contact && c.gameObject.name != my_parent_name && c.gameObject.name!="Ring"
         && c.tag != "Coin" && c.tag != "Item" && c.tag != "Melee Hitbox" && c.tag != "Portal"
         && c.tag != "Death Floor"){
         //if we hit ANYTHING but the player we came from
         GameObject expl_temp = (GameObject) Instantiate(explosion, transform.position, Quaternion.identity);
         Destroy(expl_temp, expl_temp.GetComponent<ParticleSystem>().startLifetime);
         Destroy (gameObject);
     }
 }
 static public int ClosestPoint(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.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
         UnityEngine.Vector2    a1;
         checkType(l, 2, out a1);
         var ret = self.ClosestPoint(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
 }
Exemple #3
0
 void OnTriggerEnter2D(Collider2D collided)
 {
     if(collided.tag == "Player"){
         //print ("Activated Enemy");
         this.active = true;
     }
 }
	void OnTriggerEnter2D(Collider2D collider)
	{
		if((Distance>100)&&(collider.transform==UpBodyTrans))
		{
			Distance = UpBodyTrans.position.y-DownColliderTrans.position.y;
		}
	}
Exemple #5
0
    void OnTriggerEnter2D(Collider2D c)
    {
        //レイヤー名取得
        string layerName = LayerMask.LayerToName(c.gameObject.layer);

        //レイヤー名がBullet(Player)以外のとき
        if( layerName != "Bullet(Player)") return;

        //PlayerBulletのTransformを取得
        Transform playerBulletTransform = c.transform.parent;

        //Bulletコンポーネントを取得
        Bullet bullet = playerBulletTransform.GetComponent<Bullet> ();

        //ヒットポイントを減らす
        hp = hp - bullet.power;

        //弾の削除
        Destroy(c.gameObject);

        //ヒットポイントが0以下であれば
        if (hp <= 0) {

            //スコアコンポーネントを取得してポイントを追加
            FindObjectOfType<Score>().AddPoint(point);

            //爆発
            spaceship.Explosion ();

            //エネミーの削除
            Destroy (gameObject);
        } else {
            spaceship.GetAnimator ().SetTrigger ("Damage");
        }
    }
Exemple #6
0
    static int IsTouchingLayers(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                UnityEngine.Collider2D obj = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L, 1);
                bool o = obj.IsTouchingLayers();
                LuaDLL.lua_pushboolean(L, o);
                return(1);
            }
            else if (count == 2)
            {
                UnityEngine.Collider2D obj = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L, 1);
                int  arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                bool o    = obj.IsTouchingLayers(arg0);
                LuaDLL.lua_pushboolean(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Collider2D.IsTouchingLayers"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemple #7
0
 static public int OverlapCollider(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.Collider2D      self = (UnityEngine.Collider2D)checkSelf(l);
         UnityEngine.ContactFilter2D a1;
         checkValueType(l, 2, out a1);
         UnityEngine.Collider2D[] a2;
         checkArray(l, 3, out a2);
         var ret = self.OverlapCollider(a1, a2);
         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
 }
Exemple #8
0
 static public int set_sharedMaterial(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.Collider2D        self = (UnityEngine.Collider2D)checkSelf(l);
         UnityEngine.PhysicsMaterial2D v;
         checkType(l, 2, out v);
         self.sharedMaterial = 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
 }
Exemple #9
0
 static public int IsTouchingLayers(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 1)
         {
             UnityEngine.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
             var ret = self.IsTouchingLayers();
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 2)
         {
             UnityEngine.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
             System.Int32           a1;
             checkType(l, 2, out a1);
             var ret = self.IsTouchingLayers(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #10
0
	void OnTriggerEnter2D(Collider2D other)
	{
		if((other.gameObject.tag == ("LeftBullet") || other.gameObject.tag == ("RightBullet")) && gameObject.tag == ("Player1"))
		{
			gameController.playerHPDown();
		}

		if((other.gameObject.tag == ("LeftBullet") || other.gameObject.tag == ("RightBullet")) && gameObject.tag == ("Player2"))
		{
			gameController.playerHPDown();
		}



		if(other.gameObject.tag == ("Coin") && gameObject.tag == ("Player"))
		{
			gameController.playerScoreUp();
		}



		if(other.gameObject.tag == ("Hazzard") && gameObject.tag == ("Player1"))
		{
			gameController.playerHP = 0;
		}


	}
Exemple #11
0
 static public int get_isTrigger(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.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.isTrigger);
         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
 }
Exemple #12
0
	void OnTriggerEnter2D(Collider2D col){
		if (col.gameObject.tag == "Player") {
			GameObject.Find ("Player").transform.FindChild ("Pancakes").GetComponent<Renderer> ().enabled = true;
			toaster.SetActive (true);
			gameObject.SetActive (false);
		}
	}
    private BetterCharacterSelection bcs; //the script for this menu

    #endregion Fields

    #region Methods

    /// <summary>
    /// If the cursor is shot, change the AI's selected ship
    /// </summary>
    /// <param name="other">Other.</param>
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "WeaponFire") {
            bcs.SwitchAI (playerNum - 1, direction);
            Destroy (other.gameObject);
        }
    }
Exemple #14
0
 static int QPYX_IsTouchingLayers_YXQP(IntPtr L_YXQP)
 {
     try
     {
         int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
         if (QPYX_count_YXQP == 1)
         {
             UnityEngine.Collider2D QPYX_obj_YXQP = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L_YXQP, 1);
             bool QPYX_o_YXQP = QPYX_obj_YXQP.IsTouchingLayers();
             LuaDLL.lua_pushboolean(L_YXQP, QPYX_o_YXQP);
             return(1);
         }
         else if (QPYX_count_YXQP == 2)
         {
             UnityEngine.Collider2D QPYX_obj_YXQP = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L_YXQP, 1);
             int  QPYX_arg0_YXQP = (int)LuaDLL.luaL_checknumber(L_YXQP, 2);
             bool QPYX_o_YXQP    = QPYX_obj_YXQP.IsTouchingLayers(QPYX_arg0_YXQP);
             LuaDLL.lua_pushboolean(L_YXQP, QPYX_o_YXQP);
             return(1);
         }
         else
         {
             return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: UnityEngine.Collider2D.IsTouchingLayers"));
         }
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Exemple #15
0
 void OnTriggerEnter2D(Collider2D enemy)
 {
     if (enemy.gameObject.GetComponent<Player> () == null)
         return;
     Debug.Log ("trigger entered");
     eventHandler.HandleClash ();
 }
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.name == "Player")
     {
         levelManager.RespawnPlayer();
     }
 }
Exemple #17
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.tag == "Player")
     {
         col.gameObject.GetComponent<Damageable>().OnTakeDamage(m_attack.GetDamage(gameObject.transform));
     }
 }
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.tag == "spike")
     {
         parent_script.HitSpikes();
     }
 }
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Default")
     {
         Destroy(gameObject);
     }
 }
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "Fog") {
         col.gameObject.GetComponent<FogMovement>().multiplier *= -1;
         StartCoroutine(DeadTime(col.gameObject));
     }
 }
 void OnTriggerStay2D(Collider2D other)
 {
     if (Input.GetKey (KeyCode.DownArrow)){
         simon.next_level2 ();
         endtime = Time.time + .8f;
     }
 }
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.tag == "Player")
     {
         col.gameObject.SendMessage("getHit");
     }
 }
 void OnTriggerEnter2D(Collider2D other)
 {
     if(other.gameObject.tag == "Coin")
     {
         isActive = !isActive;
     }
 }
Exemple #24
0
 void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.name == "Player")
     {
         playerscript.canClimb = true;
     }
 }
Exemple #25
0
    void OnTriggerEnter2D(Collider2D other)
    {

       gameObject.GetComponent<AudioSource>().Play();

       GameManager.instance.spawnRewardScreen();
    }
Exemple #26
0
 void OnTriggerExit2D(Collider2D collider)
 {
     if (collider.name == "Player")
     {
         playerscript.canClimb = false;
     }
 }
 public void OnTriggerEnter2D(Collider2D other)
 {
     if(other.GetComponent<EnemyIdentifier>())
     {
         Destroy(_identifier.Handler.gameObject);
     }
 }
    void AssignReferences()
    {
        myCollider = GetComponent<Collider2D>();
        myCollider.isTrigger = true;

        animator = GetComponent<Animator>();
    }
Exemple #29
0
	void OnTriggerEnter2D (Collider2D col){

		Debug.Log (gameObject.name + " has collided with " + col.gameObject.name);
		anim.SetBool (bump, true);


	}
Exemple #30
0
 void OnTriggerStay2D(Collider2D collider)
 {
     if (collider.GetComponent<Damageable>() != null)
     {
         collider.GetComponent<Damageable>().TakeDamage(GetComponent<Damager>().damage * Time.deltaTime);
     }
 }
 public void OnTriggerExit2D(Collider2D other)
 {
     //Returning to patrol state after Player exits within time frame
     if (other.CompareTag("Player")){
         ToPatrolState();
     }
 }
Exemple #32
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag ("NormalArrow") || other.CompareTag ("SplittedArrow")) {
         nnflag = true;
         transform.FindChild("Heart").gameObject.SetActive(true);
     }
 }
Exemple #33
0
	void OnTriggerEnter2D(Collider2D other){
		if(other.transform.parent){
			Destroy(other.transform.parent.gameObject);
		}else{
			Destroy(other.gameObject);
		}
	}
 void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.gameObject.tag == "Player") {
         this.playerScript.OnItemCollected(this.itemName);
         Destroy(this.gameObject);
     }
 }
Exemple #35
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "skeletoncombo") {
         total -= 1;
         Destroy(other.gameObject);
     }
 }
 public void OnTriggerEnter2D(Collider2D collision)
 {
     if(collision.tag == "Player")
     {
         GameSingleton.instance.PlayerIsDead();
     }
 }
Exemple #37
0
 void OnTriggerEnter2D(Collider2D coll)
 {
     if(GameObject.Find("Player") == coll.gameObject)
     {
         GameObject.Find("GameManager").GetComponent<gameManager>().resetGame();
     }
 }
 static public int GetContacts(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(UnityEngine.Collider2D[])))
         {
             UnityEngine.Collider2D   self = (UnityEngine.Collider2D)checkSelf(l);
             UnityEngine.Collider2D[] a1;
             checkArray(l, 2, out a1);
             var ret = self.GetContacts(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.ContactPoint2D[])))
         {
             UnityEngine.Collider2D       self = (UnityEngine.Collider2D)checkSelf(l);
             UnityEngine.ContactPoint2D[] a1;
             checkArray(l, 2, out a1);
             var ret = self.GetContacts(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.ContactFilter2D), typeof(UnityEngine.Collider2D[])))
         {
             UnityEngine.Collider2D      self = (UnityEngine.Collider2D)checkSelf(l);
             UnityEngine.ContactFilter2D a1;
             checkValueType(l, 2, out a1);
             UnityEngine.Collider2D[] a2;
             checkArray(l, 3, out a2);
             var ret = self.GetContacts(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.ContactFilter2D), typeof(UnityEngine.ContactPoint2D[])))
         {
             UnityEngine.Collider2D      self = (UnityEngine.Collider2D)checkSelf(l);
             UnityEngine.ContactFilter2D a1;
             checkValueType(l, 2, out a1);
             UnityEngine.ContactPoint2D[] a2;
             checkArray(l, 3, out a2);
             var ret = self.GetContacts(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function GetContacts to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int Cast(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 3)
         {
             UnityEngine.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
             UnityEngine.Vector2    a1;
             checkType(l, 2, out a1);
             UnityEngine.RaycastHit2D[] a2;
             checkArray(l, 3, out a2);
             var ret = self.Cast(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 4)
         {
             UnityEngine.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
             UnityEngine.Vector2    a1;
             checkType(l, 2, out a1);
             UnityEngine.RaycastHit2D[] a2;
             checkArray(l, 3, out a2);
             System.Single a3;
             checkType(l, 4, out a3);
             var ret = self.Cast(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 5)
         {
             UnityEngine.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
             UnityEngine.Vector2    a1;
             checkType(l, 2, out a1);
             UnityEngine.RaycastHit2D[] a2;
             checkArray(l, 3, out a2);
             System.Single a3;
             checkType(l, 4, out a3);
             System.Boolean a4;
             checkType(l, 5, out a4);
             var ret = self.Cast(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function Cast to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int OverlapCollider(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(UnityEngine.ContactFilter2D), typeof(UnityEngine.Collider2D[])))
         {
             UnityEngine.Collider2D      self = (UnityEngine.Collider2D)checkSelf(l);
             UnityEngine.ContactFilter2D a1;
             checkValueType(l, 2, out a1);
             UnityEngine.Collider2D[] a2;
             checkArray(l, 3, out a2);
             var ret = self.OverlapCollider(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.ContactFilter2D), typeof(List <UnityEngine.Collider2D>)))
         {
             UnityEngine.Collider2D      self = (UnityEngine.Collider2D)checkSelf(l);
             UnityEngine.ContactFilter2D a1;
             checkValueType(l, 2, out a1);
             System.Collections.Generic.List <UnityEngine.Collider2D> a2;
             checkType(l, 3, out a2);
             var ret = self.OverlapCollider(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function OverlapCollider 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
 }
	static public int get_bounciness(IntPtr l) {
		try {
			UnityEngine.Collider2D self=(UnityEngine.Collider2D)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.bounciness);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public int get_usedByComposite(IntPtr l) {
		try {
			UnityEngine.Collider2D self=(UnityEngine.Collider2D)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.usedByComposite);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public int get_attachedRigidbody(IntPtr l) {
		try {
			UnityEngine.Collider2D self=(UnityEngine.Collider2D)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.attachedRigidbody);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
 static public int get_friction(IntPtr l)
 {
     try {
         UnityEngine.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.friction);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    static int GetContacts(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes <UnityEngine.Collider2D[]>(L, 2))
            {
                UnityEngine.Collider2D   obj  = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L, 1);
                UnityEngine.Collider2D[] arg0 = ToLua.ToObjectArray <UnityEngine.Collider2D>(L, 2);
                int o = obj.GetContacts(arg0);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <UnityEngine.ContactPoint2D[]>(L, 2))
            {
                UnityEngine.Collider2D       obj  = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L, 1);
                UnityEngine.ContactPoint2D[] arg0 = ToLua.ToStructArray <UnityEngine.ContactPoint2D>(L, 2);
                int o = obj.GetContacts(arg0);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.Collider2D[]>(L, 3))
            {
                UnityEngine.Collider2D      obj  = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L, 1);
                UnityEngine.ContactFilter2D arg0 = StackTraits <UnityEngine.ContactFilter2D> .Check(L, 2);

                UnityEngine.Collider2D[] arg1 = ToLua.ToObjectArray <UnityEngine.Collider2D>(L, 3);
                int o = obj.GetContacts(arg0, arg1);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.ContactPoint2D[]>(L, 3))
            {
                UnityEngine.Collider2D      obj  = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L, 1);
                UnityEngine.ContactFilter2D arg0 = StackTraits <UnityEngine.ContactFilter2D> .Check(L, 2);

                UnityEngine.ContactPoint2D[] arg1 = ToLua.ToStructArray <UnityEngine.ContactPoint2D>(L, 3);
                int o = obj.GetContacts(arg0, arg1);
                LuaDLL.lua_pushinteger(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Collider2D.GetContacts"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Collider2D o;
         o = new UnityEngine.Collider2D();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
	static public int set_sharedMaterial(IntPtr l) {
		try {
			UnityEngine.Collider2D self=(UnityEngine.Collider2D)checkSelf(l);
			UnityEngine.PhysicsMaterial2D v;
			checkType(l,2,out v);
			self.sharedMaterial=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public int set_offset(IntPtr l) {
		try {
			UnityEngine.Collider2D self=(UnityEngine.Collider2D)checkSelf(l);
			UnityEngine.Vector2 v;
			checkType(l,2,out v);
			self.offset=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public int set_density(IntPtr l) {
		try {
			UnityEngine.Collider2D self=(UnityEngine.Collider2D)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.density=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public int set_usedByComposite(IntPtr l) {
		try {
			UnityEngine.Collider2D self=(UnityEngine.Collider2D)checkSelf(l);
			bool v;
			checkType(l,2,out v);
			self.usedByComposite=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public int OverlapPoint(IntPtr l) {
		try {
			UnityEngine.Collider2D self=(UnityEngine.Collider2D)checkSelf(l);
			UnityEngine.Vector2 a1;
			checkType(l,2,out a1);
			var ret=self.OverlapPoint(a1);
			pushValue(l,true);
			pushValue(l,ret);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
 static public int set_isTrigger(IntPtr l)
 {
     try {
         UnityEngine.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
         bool v;
         checkType(l, 2, out v);
         self.isTrigger = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #53
0
    static int QPYX_GetContacts_YXQP(IntPtr L_YXQP)
    {
        try
        {
            int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
            if (QPYX_count_YXQP == 2 && TypeChecker.CheckTypes <UnityEngine.Collider2D[]>(L_YXQP, 2))
            {
                UnityEngine.Collider2D   QPYX_obj_YXQP  = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L_YXQP, 1);
                UnityEngine.Collider2D[] QPYX_arg0_YXQP = ToLua.ToObjectArray <UnityEngine.Collider2D>(L_YXQP, 2);
                int QPYX_o_YXQP = QPYX_obj_YXQP.GetContacts(QPYX_arg0_YXQP);
                LuaDLL.lua_pushinteger(L_YXQP, QPYX_o_YXQP);
                return(1);
            }
            else if (QPYX_count_YXQP == 2 && TypeChecker.CheckTypes <UnityEngine.ContactPoint2D[]>(L_YXQP, 2))
            {
                UnityEngine.Collider2D       QPYX_obj_YXQP  = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L_YXQP, 1);
                UnityEngine.ContactPoint2D[] QPYX_arg0_YXQP = ToLua.ToStructArray <UnityEngine.ContactPoint2D>(L_YXQP, 2);
                int QPYX_o_YXQP = QPYX_obj_YXQP.GetContacts(QPYX_arg0_YXQP);
                LuaDLL.lua_pushinteger(L_YXQP, QPYX_o_YXQP);
                return(1);
            }
            else if (QPYX_count_YXQP == 3 && TypeChecker.CheckTypes <UnityEngine.Collider2D[]>(L_YXQP, 3))
            {
                UnityEngine.Collider2D      QPYX_obj_YXQP  = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L_YXQP, 1);
                UnityEngine.ContactFilter2D QPYX_arg0_YXQP = StackTraits <UnityEngine.ContactFilter2D> .Check(L_YXQP, 2);

                UnityEngine.Collider2D[] QPYX_arg1_YXQP = ToLua.ToObjectArray <UnityEngine.Collider2D>(L_YXQP, 3);
                int QPYX_o_YXQP = QPYX_obj_YXQP.GetContacts(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
                LuaDLL.lua_pushinteger(L_YXQP, QPYX_o_YXQP);
                return(1);
            }
            else if (QPYX_count_YXQP == 3 && TypeChecker.CheckTypes <UnityEngine.ContactPoint2D[]>(L_YXQP, 3))
            {
                UnityEngine.Collider2D      QPYX_obj_YXQP  = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L_YXQP, 1);
                UnityEngine.ContactFilter2D QPYX_arg0_YXQP = StackTraits <UnityEngine.ContactFilter2D> .Check(L_YXQP, 2);

                UnityEngine.ContactPoint2D[] QPYX_arg1_YXQP = ToLua.ToStructArray <UnityEngine.ContactPoint2D>(L_YXQP, 3);
                int QPYX_o_YXQP = QPYX_obj_YXQP.GetContacts(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
                LuaDLL.lua_pushinteger(L_YXQP, QPYX_o_YXQP);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: UnityEngine.Collider2D.GetContacts"));
            }
        }
        catch (Exception e_YXQP)                {
            return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
        }
    }
Exemple #54
0
 private new void OnTriggerEnter2D(UnityEngine.Collider2D collision)
 {
     if (collision.tag.Contains("Terrain"))
     {
         gameObject.SetActive(false);
     }
     else if (collision.CompareTag("Player") || collision.CompareTag("Enemy"))
     {
         if (!(Enum.GetName(typeof(DamageSource), Source) == collision.tag))
         {
             collision.gameObject.GetComponent <Character>().ReceiveAttack(new AttackInfo(Damage, KnockbackImpulse * transform.right, KnockbackTime, StunTime, Source));
             NumPassed++;
         }
     }
 }
Exemple #55
0
 static int QPYX_OverlapPoint_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         UnityEngine.Collider2D QPYX_obj_YXQP  = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L_YXQP, 1);
         UnityEngine.Vector2    QPYX_arg0_YXQP = ToLua.ToVector2(L_YXQP, 2);
         bool QPYX_o_YXQP = QPYX_obj_YXQP.OverlapPoint(QPYX_arg0_YXQP);
         LuaDLL.lua_pushboolean(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static public int IsTouching(IntPtr l)
 {
     try {
         UnityEngine.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
         UnityEngine.Collider2D a1;
         checkType(l, 2, out a1);
         var ret = self.IsTouching(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #57
0
 static int OnTriggerExit2D(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         BehaviorDesigner.Runtime.Tasks.Task obj = (BehaviorDesigner.Runtime.Tasks.Task)ToLua.CheckObject <BehaviorDesigner.Runtime.Tasks.Task>(L, 1);
         UnityEngine.Collider2D arg0             = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L, 2);
         obj.OnTriggerExit2D(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #58
0
 static int QPYX_Distance_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 2);
         UnityEngine.Collider2D         QPYX_obj_YXQP  = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L_YXQP, 1);
         UnityEngine.Collider2D         QPYX_arg0_YXQP = (UnityEngine.Collider2D)ToLua.CheckObject <UnityEngine.Collider2D>(L_YXQP, 2);
         UnityEngine.ColliderDistance2D QPYX_o_YXQP    = QPYX_obj_YXQP.Distance(QPYX_arg0_YXQP);
         ToLua.PushValue(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static public int IsTouchingLayers(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 (argc == 1)
         {
             UnityEngine.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
             var ret = self.IsTouchingLayers();
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 2)
         {
             UnityEngine.Collider2D self = (UnityEngine.Collider2D)checkSelf(l);
             System.Int32           a1;
             checkType(l, 2, out a1);
             var ret = self.IsTouchingLayers(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function IsTouchingLayers 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
 }
 static int IsTouching(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.Collider2D obj  = (UnityEngine.Collider2D)ToLua.CheckObject(L, 1, typeof(UnityEngine.Collider2D));
         UnityEngine.Collider2D arg0 = (UnityEngine.Collider2D)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Collider2D));
         bool o = obj.IsTouching(arg0);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }