You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
643 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Boulder : HeavyObject
  5. {
  6. public GameObject splash;
  7. public GameObject Explosion;
  8. public override void OnWaterStay(WaterController water,float waveHeight)
  9. {
  10. }
  11. public override void OnWaterExit(WaterController water)
  12. {
  13. }
  14. void OnTriggerEnter(Collider other) {
  15. if (other.gameObject.CompareTag("Water")) {
  16. Destroy(Instantiate(splash, transform.position,Quaternion.identity), 2.5f);
  17. }else {
  18. Destroy(Instantiate(Explosion, transform.position, Quaternion.identity), 6);
  19. }
  20. }
  21. }