Esempio n. 1
0
    float startTime;//buff起效时间

    public virtual void Start()
    {
        target.RegisterBuff(this);

        Dictionary <int, SpecialEffect> effectDic = Util.GetDic <MsgSpecialEffect, SpecialEffect>();
        int startEffectId = (int)buffData.startEffect;

        if (startEffectId != 0)
        {
            startEffectConfig = effectDic[startEffectId];
            startEffectName   = Util.GetConfigString(startEffectConfig.name);
        }
        int processEffectId = (int)buffData.processEffect;

        if (processEffectId != 0)
        {
            processEffectConfig = effectDic[processEffectId];
            processEffectName   = Util.GetConfigString(processEffectConfig.name);
        }
        int endEffectId = (int)buffData.endEffect;

        if (endEffectId != 0)
        {
            endEffectConfig = effectDic[endEffectId];
            endEffectName   = Util.GetConfigString(endEffectConfig.name);
        }

        startTime = Time.time;
        StartCoroutine(DisplayEffect(startEffectName, startEffectConfig, EffectId.StartEffect));
        StartCoroutine(DisplayEffect(processEffectName, processEffectConfig, EffectId.ProcessEffect));

        BuffStart();

        float interval = buffData.interval;

        if (interval > 0)
        {
            StartCoroutine(StartBuffProcess(interval));
        }
    }