Esempio n. 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (_collected)
        {
            return;
        }

        Energy oe = other.GetComponent <Energy>();

        if (oe == null)
        {
            return;
        }
        if (_as != null && _collectClip != null)
        {
            _as.PlayOneShot(_collectClip);
        }
        _collected           = true;
        transform.localScale = Vector3.zero;
        oe.Charge(_amount);
        StartCoroutine("Destroy");
    }