@@ -65,7 +65,7 @@ namespace ET.Client
go = await GameObjectPool.Instance.Acquire("Effect_" + effect.Name);
var timeComponent = go.GetComponent<EffectTime>();
- if (time == 0f) time = timeComponent.duration;
+ if (time == 0f) time = timeComponent != null ? timeComponent.duration : EffectPlayInfo.TIME_DEFAULT;
if (time < 0f) time = EffectPlayInfo.TIME_FOREVER;
setupEffect(go, effect, render, pos, rotation);
}
@@ -24,4 +24,5 @@ public class EffectPlayInfo
return ++_id; ;
public readonly static float TIME_FOREVER = 86400f;
+ public readonly static float TIME_DEFAULT = 3.0f;