private void OnTriggerEnter(Collider other)
    {
        Icollectable icollectable = other.GetComponent <Icollectable>();

        if (icollectable != null)
        {
            icollectable.Collect();
        }
    }
Пример #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("Collectable"))
     {
         Icollectable collectable = other.gameObject.GetComponent <Icollectable>();
         coins.Value += collectable.ScoreValue;
         collectable.HideTheCollectable();
         onHitCollectable.Raise();
     }
 }