예제 #1
0
 void OnTriggerStay2D(Collider2D aaa)
 {
     if (gameObject.tag == "LocalPlayer")
     {
         if (aaa.gameObject.tag == "Water" && Input.GetKeyDown(KeyCode.Space))
         {
             ClientSend.CharacterStatus((int)CharacterStats.Water);
         }
     }
 }
예제 #2
0
 void OnCollisionStay2D(Collision2D aaa)     //aaa為自定義碰撞事件
 {
     if (gameObject.tag == "LocalPlayer")
     {
         if (aaa.gameObject.tag == "Coal" && Input.GetKeyDown(KeyCode.Space))
         {
             ClientSend.CharacterStatus((int)CharacterStats.Coal);
         }
         if (aaa.gameObject.tag == "Metal" && Input.GetKeyDown(KeyCode.Space))
         {
             ClientSend.CharacterStatus((int)CharacterStats.Metal);
         }
         if (aaa.gameObject.tag == "lab" && Input.GetKeyDown(KeyCode.Space))
         {
             ClientSend.CharacterStatus((int)CharacterStats.Lab);
         }
     }
 }