Beispiel #1
0
        public void playNextVFX()
        {
            if (b_vfx_running || my_buffs.Count == 0)
            {
                return;
            }
            if (index_buff_vfx >= my_buffs.Count)
            {
                index_buff_vfx = 0;
            }
            if (my_buffs[index_buff_vfx].my_buff_info.effect == eBuff_Effect.Halo)
            {
                index_buff_vfx++;
                return;
            }
            GameObject obj = BKTools.addVFX(PrefabPath.VFX_Buff_Prefix + my_buffs[index_buff_vfx].my_buff_info.duration_vfx + ".prefab");

            if (obj)
            {
                obj.transform.SetParent(transform, true);
                //my_buffs[index_buff_vfx].vfx_duration.Add(obj);   暂时仅对halo有效
                obj.transform.localPosition = Buff_Info.vfx_off_buff;
                BuffAnimator ba = obj.GetComponent <BuffAnimator>();
                ba.owner = this;
                Debug.Log("增加" + belong.ToString() + ":" + ba.gameObject.name);
                b_vfx_running = true;
            }
            index_buff_vfx++;
        }
Beispiel #2
0
        /*已经通过接口实现*/
        // 更新为加载事件统一处理
        public static void addBuff(ref List <BuffAdder> list_adder, CBuffContain container, Chess ch, ChessContainer chc, string dancer_key)
        {
//             {
//                 Buff new_buff = new Buff();
//                 //new_buff.my_buff_info.id = buff_id;
//                 new_buff.my_buff_info = Data.Inst.buff_data[buff_id];
//                 c.my_buffs.Add(new_buff);
//             }
            BuffAdder[] adds = new BuffAdder[list_adder.Count];
            list_adder.CopyTo(adds);
            list_adder.Clear();

            List <Buff> my_buffs = container.getBuffList();

            //异步添加BUFF
            foreach (BuffAdder buff_id in adds)
            {
                //做法修改后不再需要判断重复
                //             if (my_buffs.ContainsKey(buff_id))
                //             {
                //                 Debug.Log("加buff失败,找不到buff,ID:" + buff_id);
                //                 return;
                //             } else if (!my_buffs.ContainsKey(buff_id))
                {
                    Buff new_buff = new Buff();
                    new_buff.stand_side   = buff_id.from;
                    new_buff.my_buff_info = Data.Inst.buff_data[buff_id.id];
                    new_buff.my_Duration  = new_buff.my_buff_info.duration;
                    my_buffs.Add(new_buff);
                    new_buff.owner_ch  = ch;
                    new_buff.owner_chc = chc;
                    new_buff.owner     = container;

                    BuffContrllor.analyseBuff_Effect(new_buff, eBuffEvent.Buff_Add);
                    BK_AnimEvts av = BKTools.addVFX_Dancer(new_buff.my_buff_info.start_vfx);
                    if (av)
                    {
                        av.transform.position = container.getContainer().transform.position;
                    }
                    // 持续特效
                    if (new_buff.my_buff_info.effect == eBuff_Effect.Halo)
                    {
                        GameObject obj = BKTools.addVFX(PrefabPath.VFX_Buff_Prefix + new_buff.my_buff_info.duration_vfx + ".prefab");
                        if (obj)
                        {
                            obj.transform.SetParent(container.transform, true);
                            new_buff.vfx_duration.Add(obj);                                //暂时仅对halo有效
                            obj.transform.localPosition = Vector3.forward * 0.2f;
                        }
                    }
                    else
                    {
                        container.playNextVFX();
                    }
                }
                Main.Inst.redDancer(dancer_key);
            }
        }