Advertisement
Boomsma95

Tutorial Script: BulletManager

Mar 26th, 2013
1,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class BulletManager : MonoBehaviour
  5. {
  6.     public MPPlayer shooterPlayer;
  7.     public float destroyTimer = 5;
  8.     public float damage = 0;
  9.  
  10.     void Start()
  11.     {
  12.         Destroy(gameObject, destroyTimer);
  13.     }
  14.  
  15.     void OnCollisionEnter(Collision col)
  16.     {
  17.         col.transform.SendMessageUpwards("GetBulletDamage", damage, SendMessageOptions.DontRequireReceiver);
  18.         Destroy(gameObject);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement