public void Expolde() { if (this.piece != null && !this.piece.isDead && !this.piece.isFadeAway) { Explode explode = EntityPool.Instance.Use("Explode").GetComponent <Explode>(); explode.Setup(this.piece); Board.Instance.CokeSurroundPiece(piece); } Dispose(); }
void OnCollisionEnter(Collision collision) { //Explode exp = Instantiate(explodePrefab, transform.position, transform.rotation); //exp.Setup(); Explode exp = ExploPooling.instance.Get(); exp.gameObject.SetActive(true); exp.gameObject.transform.position = transform.position; exp.Setup(); //Destroy(gameObject); //Pooling ShootPoling.instance.ReturnToPool(this); }