Ejemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        PlayerActor playerActor = collider.transform.parent.GetComponent <PlayerActor>();

        if (playerActor != null && playerActor != owner)
        {
            playerActor.DealDamage(GameConfig.Instance.canonDamage);
            Destroy(gameObject);
            playerActor.transform.DOShakePosition(1f, 0.2f).OnComplete(() => {
                parentAction.done = true;
            });
        }
    }