示例#1
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.E))
     {
         transform.parent = null;
         ExplosionCollider.SetActive(true);
         rb.AddExplosionForce(explosionForce, transform.position, radius, mod);
         Destroy(obj, 0.1f);
     }
 }
示例#2
0
 // Use this for initialization
 void Start()
 {
     rb           = GetComponent <Rigidbody>();
     rb.velocity *= force;
     ExplosionCollider.SetActive(false);
 }