Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OnCollisionEnter(Collision collision)
- {
- ApplyExploder(collision.gameObject);
- }
- private void ApplyExploder(GameObject target)
- {
- var exploder = Exploder.Utils.ExploderSingleton.ExploderInstance;
- if (exploder)
- {
- // check if the target is explodable object
- if (Exploder.ExploderUtils.IsExplodable(target))
- {
- exploder.ExplodeObject(target, OnExplosion);
- }
- }
- }
- private void OnExplosion(float time, Exploder.ExploderObject.ExplosionState state)
- {
- if (state == Exploder.ExploderObject.ExplosionState.ExplosionFinished)
- {
- //UnityEngine.Debug.Log("OnExplosion " + state);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement