コード例 #1
0
ファイル: OutCollision.cs プロジェクト: yorkglez/WTJ-GAME
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "Player")
     {
         GameObject      thePlayer = GameObject.Find("Player");
         MovementsPlayer Player    = thePlayer.GetComponent <MovementsPlayer> ();
         Player.OutCollision(Power);
         SoundsManager.PlaySound("playerDying");
         Player.Lifes = Player.Lifes - 1;
     }
 }
コード例 #2
0
ファイル: HeadColliders.cs プロジェクト: yorkglez/WTJ-GAME
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "Player")
     {
         GameObject      thePlayer = GameObject.Find("Player");
         MovementsPlayer Player    = thePlayer.GetComponent <MovementsPlayer> ();
         Player.OutCollision(Power);
         GameObject      Donal = GameObject.Find("Donal");
         DonaldMovements donal = Donal.GetComponent <DonaldMovements> ();
         donal.Life = donal.Life - 1;
     }
 }
コード例 #3
0
 /** Collisions **/
 void OnCollisionEnter2D(Collision2D col)
 {
     if (col.gameObject.tag == "EnemyLimit")
     {
         dir = -dir;
         CheckOrientation();
     }
     if (col.gameObject.tag == "Player")
     {
         GameObject      thePlayer = GameObject.Find("Player");
         MovementsPlayer Player    = thePlayer.GetComponent <MovementsPlayer> ();
         Player.Lifes = Player.Lifes - 1;
         Player.OutCollision(5);
     }
 }