Exemplo n.º 1
0
    public void RemoveSfx(int actionID)
    {
        List <uint> sfxs = null;

        sfxTimerIDDic.TryGetValue(actionID, out sfxs);
        if (sfxs == null)
        {
            return;
        }
        foreach (var item in sfxs)
        {
            FrameTimerHeap.DelTimer(item);
        }
        Dictionary <int, float> sfx = SkillAction.dataMap[actionID].sfx;

        if (sfx == null)
        {
            return;
        }
        SfxHandler cueHandler = theOwner.sfxHandler;

        foreach (var item in sfx)
        {
            if (cueHandler)
            {
                cueHandler.RemoveFXs(item.Key);
            }
        }
        sfxs.Clear();
    }
Exemplo n.º 2
0
    public void RemoveSfx(int actionID)
    {
        var sfxs = sfxTimerIDDic.GetValueOrDefault(actionID, new List <uint>());

        foreach (var item in sfxs)
        {
            FrameTimerHeap.DelTimer(item);
        }
        Dictionary <int, float> sfx = SkillAction.dataMap[actionID].sfx;

        if (sfx == null)
        {
            return;
        }
        SfxHandler cueHandler = theOwner.sfxHandler;

        foreach (var item in sfx)
        {
            if (item.Key < 1000)
            {
                StopUIFx(item.Key);
            }
            else
            {
                if (cueHandler)
                {
                    cueHandler.RemoveFXs(item.Key);
                }
            }
        }
        sfxs.Clear();
    }
Exemplo n.º 3
0
 /// <summary>
 /// 处理淡入淡出
 /// </summary>
 /// <param name="fx"></param>
 private void HandleFade(FXData fx)
 {
     if (fx.fadeStart != fx.fadeEnd)
     {
         try
         {
             if (m_mat != null)
             {
                 var color = GetMatColor("_Color");
                 if (color.a == fx.fadeEnd)
                 {
                     if (m_randerer != null && fx.fadeEnd == 0)
                     {
                         SetRanderEnable(false);
                     }
                     return;
                 }
             }
         }
         catch (System.Exception ex)
         {
             Debug.LogException(ex);
         }
         var startTime = Time.realtimeSinceStartup;
         Debug.Log("startTime: " + startTime);
         var repeatTimer = FrameTimerHeap.AddTimer((uint)fx.fadeDelay, 100, () =>
         {
             if (m_mat != null)
             {
                 var deltaTime = Time.realtimeSinceStartup - startTime;
                 //Debug.Log("deltaTime: " + deltaTime);
                 var target = fx.fadeStart + ((fx.fadeEnd - fx.fadeStart) * deltaTime * 1000 / fx.fadeDulation);
                 Debug.Log("target: " + target);
                 SetMatColor("_Color", new Color(1, 1, 1, target));
             }
         });
         FrameTimerHeap.AddTimer((uint)(fx.fadeDelay + fx.fadeDulation), 0, () =>
         {
             FrameTimerHeap.DelTimer(repeatTimer);
             if (m_randerer != null && fx.fadeEnd == 0)
             {
                 SetRanderEnable(false);
             }
         });
     }
 }