Beispiel #1
0
    void OnTriggerEnter2D(Collider2D hitInfo)
    {
        Debug.Log(hitInfo.name);
        Destroyable destroyable = hitInfo.GetComponent <Destroyable>();

        if (destroyable != null)
        {
            destroyable.TakeHit(damage);
        }
        ErrorActivator playerError = hitInfo.GetComponent <ErrorActivator>();

        if (playerError != null)
        {
            playerError.TakeHit(damage);
        }
        /*Instantiate(impactEffect, transform.position, transform.rotation);*/
        Destroy(gameObject);
    }