示例#1
0
    void ReceviceRemoveBuff(EntityBase entity, params object[] objs)
    {
        //Debug.Log("ReceviceRemoveBuff");

        AddComp(entity);

        BuffEffectComponent bec = entity.GetComp <BuffEffectComponent>();
        PlayerComponent     pc  = entity.GetComp <PlayerComponent>();
        PerfabComponent     pec = entity.GetComp <PerfabComponent>();

        BuffInfo bi = (BuffInfo)objs[0];

        if (bi.BuffData.m_BuffExitFX != "null")
        {
            EffectManager.ShowEffect(bi.BuffData.m_BuffExitFX, pec.perfab.transform.position, 0.5f);
        }

        BuffEffectPackage bep = bec.GetBuffEffectPackage(bi.buffID);

        //Debug.Log("bep >" + bep + "<");

        if (bep != null && bep.buffEffectID != 0)
        {
            m_world.DestroyEntity(bep.buffEffectID);
            bep.buffEffectID = 0;
        }
    }
示例#2
0
    public int buffEffectID;     //buff持续特效

    public BuffEffectPackage DeepCopy()
    {
        BuffEffectPackage bep = new BuffEffectPackage();

        bep.buffID       = buffID;
        bep.buffEffectID = buffEffectID;

        return(bep);
    }
示例#3
0
    void BuffEffect(EntityBase entity, BuffInfo bi, BuffEffectComponent bec)
    {
        BuffEffectPackage bep = bec.GetBuffEffectPackage(bi.buffID);

        if (bep == null)
        {
            bep        = new BuffEffectPackage();
            bep.buffID = bi.buffID;

            bec.effectList.Add(bep);
        }

        if (bi.BuffData.m_BuffFX != "null")
        {
            if (bep.buffEffectID != 0 && !m_world.GetEntityIsExist(bep.buffEffectID))
            {
                bep.buffEffectID = 0;
            }

            if (bep.buffEffectID == 0)
            {
                TransfromComponent mc = new TransfromComponent();
                mc.parentID = entity.ID;

                AssetComponent ac = new AssetComponent();
                ac.m_assetName = bi.BuffData.m_BuffFX;

                string identifier = "BuffEffect" + entity.ID + bi.buffID;

                int EffectID = m_world.GetEntityID(identifier);

                m_world.CreateEntity(identifier, mc, ac);

                bep.buffEffectID = EffectID;

                Debug.Log("创建BUFF " + EffectID);
            }
            else
            {
                Debug.Log("已存在");
            }
        }
    }