SFE_Pickupable.js 271 B

12345678910111213141516171819202122
  1. #pragma strict
  2. var onPickupGenerate:GameObject;
  3. function Start () {
  4. }
  5. function Update () {
  6. }
  7. function OnCollisionEnter(collision : Collision) {
  8. if (onPickupGenerate) Instantiate(onPickupGenerate, transform.position, transform.rotation);
  9. Destroy(gameObject);
  10. }