示例#1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Slime"))
     {
         shake.Shaker(0.125f, 0.125f);
         other.GetComponent <Slime>().Death();
     }
     else if (other.CompareTag("Gold"))
     {
         shake.Shaker(0.125f, 0.125f);
         other.GetComponent <Gold>().Death();
     }
 }
示例#2
0
 public void Death()
 {
     spawner.startTimeBtwSpawns = spawner.startTimeBtwSpawns + spawner.decrement;
     shake.Shaker(0.125f, 0.125f);
     Instantiate(effect, transform.position, Quaternion.identity);
     Destroy(gameObject);
 }