Ejemplo n.º 1
0
 public void Impact(GameObject gameObject)
 {
     if (gizmoidHolder.gizmoids.Count == 0)
     {
         AudioPlayer.Instance.PlaySoundClip(clipDestroy, transform);
         onImpact.Invoke(this, gameObject);
     }
 }
Ejemplo n.º 2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (targetTags.Contains(collision.gameObject.tag))
        {
            var health = collision.GetComponent <Health>();
            if (!health)
            {
                health = collision.GetComponentInParent <Health>();
            }
            if (health)
            {
                Impact(health);
            }

            var impact = collision.GetComponent <IImpactable>();
            if (impact != null)
            {
                impact.Impact(collision.gameObject);
            }
            onImpact.Invoke(collision.gameObject);

            gameObject.SetActive(false);
        }
    }
Ejemplo n.º 3
0
 public void Impact(GameObject gameObject)
 {
     onImpact.Invoke(gameObject.transform);
 }