com.javierquevedo.BubbleController.kill C# (CSharp) Метод

kill() публичный Метод

public kill ( bool explodes ) : void
explodes bool
Результат void
        public void kill(bool explodes)
        {
            StopAllCoroutines();
            Destroy(this.transform.GetComponent<Rigidbody>());
            Destroy(this.transform.GetComponent<Collider>());
            if (explodes)
            {
                StartCoroutine(scaleTo(new Vector3(0,0,0), 0.15f));
            }else
            {
                Vector3 killPosition = new Vector3(this.transform.position.x, 0f, 0f);
                float distance = Vector3.Distance(this.transform.position, killPosition);
                this.moveTo(killPosition, distance/_killSpeed);
            }
        }

Usage Example

 private void destroyBubble(BubbleController bubbleController, bool explodes)
 {
     this._matrix.remove(bubbleController.bubble);
     this._bubbleControllers.Remove(bubbleController);
     bubbleController.CollisionDelegate = null;
     bubbleController.kill(explodes);
     //Destroy(bubbleController.gameObject);
 }
All Usage Examples Of com.javierquevedo.BubbleController::kill