public void CheckDestroty() { fAge += Time.deltaTime; if (curHP <= 0) { ParticleMgr.GetInstance().CreateDestroyedParticles(gameObject, ParticleNum); GameObject.Destroy(gameObject); if (Obstacle) { GameObject.Destroy(Obstacle); } } }
private void OnCollisionEnter2D(Collision2D collision) { GameObject Col = collision.gameObject; if (Col.tag == "Wall") { bMove = false; } if (Col.tag == "Boss" && Col.GetComponent <BossBehavior>().GetIsRushing()) { ParticleMgr.GetInstance().CreateDestroyedParticles(gameObject, 80); TetMgr.GetComponent <TetrisMgr>().SetDeletedTetris(iXPos, iYPos); GameObject.Destroy(gameObject); } }