コード例 #1
0
    void Action(Transform target)
    {
        PlayerStats targetStats = target.GetComponent <PlayerStats>();

        OnProjectileHit.Invoke(stats, targetStats, this);

        Destroy(gameObject);
    }
コード例 #2
0
ファイル: Projectile.cs プロジェクト: Lernom/Unity_VR_Demo
        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);
        }
コード例 #3
0
 public void ProjectileHit(Projectile projectile)
 {
     OnProjectileHit?.Invoke(projectile);
 }