topical media & game development
lib-unity-presentation-Assets-Scripts-DeleteTrigger.cs / cs
using UnityEngine;
using System.Collections;
public class DeleteTrigger : MonoBehaviour {
void OnTriggerEnter (Collider other) {
if (other == null || other.transform == null)
return;
Transform trans = other.transform;
if (trans.parent != null) trans = trans.parent;
Destroy(trans.gameObject);
}
}
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.