Beispiel #1
0
    private void OnTriggerEnter(Collider other)
    {
        PlayerInventory player = other.GetComponent <PlayerInventory>();

        if (player != null && gameModeCTF != null)
        {
            if (player.GetWeaponTeamID() != teamID)
            {
                return;
            }

            if (player.IsHoldingFlag())
            {
                gameModeCTF.AddScore(player.teamID, 1);
                player.ReturnWeapon(1);
            }
        }
    }
Beispiel #2
0
    private void OnTriggerEnter(Collider other)
    {
        Player player = other.GetComponent <Player>();

        if (player != null && gameModeCTF != null)
        {
            if (player.GetWeaponTeamID() != teamID)
            {
                return;
            }

            //slot 1 in player weapons is always flag
            //we should find a different way to find the flag
            //but for now this is fine.
            if (player.IsHolding(1))
            {
                gameModeCTF.AddScore(player.teamID, 1);
                player.ReturnWeapon(1);
            }
        }
    }