private void CheckFall()
 {
     if (transform.position.y < -7f)
     {
         Debug.Log("fall off");
         transform.position = new Vector2(-6, 0);
         //-hp
         PublicTool.changeAttribute(PlayerAttribute.HP, -1);
     }
 }
示例#2
0
 private void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.tag == "Player")
     {
         Debug.Log("hit");
         //-hp
         PublicTool.changeAttribute(PlayerAttribute.HP, -damage);
         Destroy(gameObject);
     }
 }