예제 #1
0
    public void OnProjectileHit(int projectileId)
    {
        //When we receive a projectile hit, it means that the projectile was destroyed on another client and we have to destroy it to
        //So we try to find the appropriate projectile through its ID and then destroy it as well

        m_Projectiles.RemoveAll(item => item == null);

        ProjectileBase projectile = m_Projectiles.Find(item => item.ProjectileId == projectileId);

        if (projectile != null)
        {
            projectile.OnProjectileHit();
            m_Projectiles.Remove(projectile);
        }
    }