Exemplo n.º 1
0
    void Action(Transform target)
    {
        PlayerStats targetStats = target.GetComponent <PlayerStats>();

        OnProjectileHit.Invoke(stats, targetStats, this);

        Destroy(gameObject);
    }
Exemplo n.º 2
0
        void OnCollisionEnter(Collision c)
        {
            if (CollisionHandled)
            {
                return;
            }
            CollisionHandled = true;
            var canStick = c.gameObject.GetComponentInParent <ArrowStickable>();

            if (canStick)
            {
                Body.isKinematic     = true;
                Body.velocity        = Vector3.zero;
                Body.angularVelocity = Vector3.zero;
            }
            OnProjectileHit.Invoke(c);
        }
Exemplo n.º 3
0
 public void ProjectileHit(Projectile projectile)
 {
     OnProjectileHit?.Invoke(projectile);
 }