Advertisement
Guest User

Untitled

a guest
Mar 28th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. void OnCollisionEnter(Collision collision)
  2. {
  3.     ApplyExploder(collision.gameObject);
  4. }
  5.  
  6. private void ApplyExploder(GameObject target)
  7. {
  8.     var exploder = Exploder.Utils.ExploderSingleton.ExploderInstance;
  9.     if (exploder)
  10.     {
  11.         // check if the target is explodable object
  12.         if (Exploder.ExploderUtils.IsExplodable(target))
  13.         {
  14.             exploder.ExplodeObject(target, OnExplosion);
  15.         }
  16.     }
  17. }
  18. private void OnExplosion(float time, Exploder.ExploderObject.ExplosionState state)
  19. {
  20.     if (state == Exploder.ExploderObject.ExplosionState.ExplosionFinished)
  21.     {
  22.         //UnityEngine.Debug.Log("OnExplosion " + state);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement