Exemplo n.º 1
0
    public void Drop(MeteorUnit player)
    {
        //player.Attr;
        //List<GameObject> obj = new List<GameObject>();
        //一定爆出角色主武器,有Flag爆出Flag,并且这个Flag,会持续一定时间,若无人拾取,则会重置Flag归位.
        int mainWeapon = player.Attr.Weapon;

        ItemDatas.ItemDatas     ib = Main.Ins.DataMgr.GetData <ItemDatas.ItemDatas>(mainWeapon);
        WeaponDatas.WeaponDatas wb = U3D.GetWeaponProperty(ib.UnitId);
        GameObject trigget         = CreateTriggerObj(wb.WeaponR, player.transform, -player.transform.forward);

        //obj.Add(trigget);
        //ExplosionObject01.iTweenExplosion01(1, ref obj, player.transform.position);
        ExplosionObject01.DropItem(trigget, player.transform.position, -player.transform.forward);
        //如果角色拥有第二武器,那么第一武器扔掉时,切换到第二武器
        player.DropAndChangeWeapon();

        //扔掉Flag道具
        if (player.GetFlag)
        {
            trigget = CreateObj(player.GetFlagItem.model, player.transform, -player.transform.forward);
            ExplosionObject01.DropItem(trigget, player.transform.position, Quaternion.AngleAxis(30, Vector3.up) * -player.transform.forward);
            player.SetFlag(null, 0);
        }
    }