Example #1
0
    public override void OnThisThingDead()
    {
        //死亡时重置

        if (NetID != -1)
        {
            RemoveCharacterData();
        }

        if (UnitZ.NetworkGameplay.scoreManager)
        {
            UnitZ.NetworkGameplay.scoreManager.AddDead(1, NetID);
            if (NetID != LastHitByID)
            {
                UnitZ.NetworkGameplay.scoreManager.AddScore(1, LastHitByID);
            }
        }

        if (isServer)
        {
            ItemDropAfterDead dropafterdead = this.GetComponent <ItemDropAfterDead> ();
            if (dropafterdead)
            {
                dropafterdead.DropItem();
            }
        }

        base.OnThisThingDead();
    }
    public override void OnThisThingDead()
    {
        if (NetID != -1)
        {
            RemoveCharacterData();
        }

        CharacterItemDroper itemdrop = this.GetComponent <CharacterItemDroper>();

        if (itemdrop)
        {
            itemdrop.DropItem();
        }

        if (isServer)
        {
            ItemDropAfterDead dropafterdead = this.GetComponent <ItemDropAfterDead>();
            if (dropafterdead)
            {
                dropafterdead.DropItem();
            }
        }

        base.OnThisThingDead();
    }