Esempio n. 1
0
    //void OnCollisionEnter(Collision hit)
    //{
    //    StatsController playerStats = hit.gameObject.GetComponent<StatsController>();
    //    if (playerStats != null)
    //    {
    //        playerStats.AddPlayerHitId(shooterId);
    //    }

    //    // Always handle collision, even if not hitting a player.
    //    HandleCollision(hit.collider);
    //}

    void OnTriggerEnter(Collider target)
    {
        StatsController playerStats = target.gameObject.GetComponent <StatsController>();

        if (playerStats != null)
        {
            playerStats.AddPlayerHitId(shooterId);
        }

        HandleCollision(target);
    }