| | |
| | | /// <param name="autoDestroy">是否自动销毁,默认为true</param> |
| | | /// <param name="destroyDelay">自动销毁延迟时间,默认为5秒</param> |
| | | /// <returns>特效游戏对象</returns> |
| | | public EffectPlayer PlayUIEffect(int id, Transform parent = null, bool autoDestroy = true, float destroyDelay = 5f) |
| | | public EffectPlayer PlayUIEffect(int id, Transform parent = null) |
| | | { |
| | | // 使用默认值 |
| | | if (parent == null) parent = transform; |
| | | |
| | | EffectPlayer player = parent.gameObject.AddComponent<EffectPlayer>(); |
| | | |
| | | player.effectId = id; |
| | | player.autoDestroy = autoDestroy; |
| | | player.destroyDelay = destroyDelay; |
| | | player.canvas = canvas; |
| | | |
| | | return player; |
| | | return EffectPlayer.Create(id, parent, false); |
| | | } |
| | | |
| | | #endregion |