Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class ExplosiveBarrel : MonoBehaviour, IDamageable
- {
- [SerializeField] private GameObject explosionEffect;
- public void Explode()
- {
- Instantiate(explosionEffect, transform.position, Quaternion.identity);
- Destroy(gameObject);
- }
- public void Damage(float damageAmount)
- {
- Explode();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment