void OnTriggerEnter(Collider coll) { if (immune) { return; } GameObject otherGO = coll.gameObject; if (otherGO.tag == "Bullet" || otherGO.transform.root.gameObject.tag == "Player") { if (otherGO.tag == "Bullet") { immune = true; // Destroy(otherGO); everyobjectdestroysitself Warpaid.InitDrop(dropProbability, transform); Warpaid.AddScore(score); } InstantiateParticleSystem(); Destroy(gameObject); } }
void InstantiateDrop() { Warpaid.InitDrop(dropProbability, transform); }