Esempio n. 1
0
    /// <summary>
    /// Coin spanws from inside a box and is automatically collected.
    /// </summary>
    public void Spawn(Vector3 spawnForce)
    {
        isBrickCoin          = true;
        rigidbody.useGravity = true;
        rigidbody.AddForce(spawnForce, ForceMode.VelocityChange);
        StartCoroutine(DoAutoCollect());
        HitBox box = GameObject.FindObjectOfType(typeof(HitBox)) as HitBox;

        if (box != null)
        {
            box.Collect(this);
        }
    }