3176人加入学习
(58人评价)
《暗黑战神》3D网游ARPG实战案例(第一季)(Unity 2017.3)
价格 ¥ 450.00
该课程属于 Unity - A计划(一年有效期) 请加入后再学习

为什么我这边物效只能播放一次呢?PlayerController.cs中设置特效函数:

public override void SetFX(string name,float destroy)
    {
        GameObject go;
        if(fxDic.TryGetValue(name,out go))
        {
            go.SetActive(true);
            timerSvc.AddTimeTask((int tid) =>
            {
                PECommon.Log("FX Played.");
                go.SetActive(false);
            }, destroy);

            PECommon.Log("FX Found in fxDic");
        }
        //else
        //{
        //    PECommon.Log("FX was not Found in fxDic");
        //}
    }

 

其中调试信息都能输出,就是特效只在第一次能播放。

[展开全文]