示例#1
0
    public override void Die(string killer, int weaponID)
    {
        //TODO check comments on Death
        //Do we need to reset the available weapon list here like this? Probably not...
        //Actually, do we need to reset the references on any of these components?
        //I thought death was a simple death animation combined with being moved around to your new spawn location.
        AvailableWeapons = new List <IWeapon>();
        Debug.Log("Player " + Username + " was killed by " + killer + " using weapon #" + weaponID);
        //we need to tell the server that we died so that it can respawn us
        DeathEvent evnt = DeathEvent.Create(Bolt.GlobalTargets.OnlyServer, Bolt.ReliabilityModes.ReliableOrdered);

        evnt.Killer   = killer;
        evnt.Player   = Username;
        evnt.WeaponID = weaponID;
        evnt.Send();
        this.Health = MaxHealth;
    }