本文整理汇总了C#中LuaInterface.LuaFunction.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# LuaFunction.Dispose方法的具体用法?C# LuaFunction.Dispose怎么用?C# LuaFunction.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LuaInterface.LuaFunction
的用法示例。
在下文中一共展示了LuaFunction.Dispose方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SafeRelease
private void SafeRelease(ref LuaFunction func)
{
if (func != null)
{
func.Dispose();
func = null;
}
}
示例2: OnLoadAsset
IEnumerator OnLoadAsset(string abname, string assetName, LuaFunction func) {
// Load asset from assetBundle.
string abName = abname.ToLower() + AppConst.ExtName;
AssetBundleAssetOperation request = ResourceManager.LoadAssetAsync(abName, assetName, typeof(GameObject));
if (request == null) yield break;
yield return StartCoroutine(request);
// Get the asset.
GameObject prefab = request.GetAsset<GameObject>();
if (func != null) {
func.Call(prefab);
func.Dispose();
func = null;
}
}
示例3: OnComplete
public static void OnComplete(Tweener tweener, LuaFunction func)
{
tweener.OnComplete(() =>
{
try
{
func.Call();
}
catch (Exception e)
{
Debug.LogError(e);
}
func.Dispose();
func = null;
});
}
示例4: SafeRelease
void SafeRelease(ref LuaFunction luaRef) {
if (luaRef != null) {
luaRef.Dispose();
luaRef = null;
}
}
示例5: TweenVector2
public static Tweener TweenVector2(Vector2 start, Vector2 end, float duration, LuaFunction OnUpdate)
{
return DOTween.To(() => start, x =>
{
try
{
OnUpdate.Call(x);
}
catch (Exception e)
{
Debug.LogError(e);
}
}, end, duration).OnComplete(() =>
{
OnUpdate.Dispose();
OnUpdate = null;
});
}
示例6: TweenFloat
public static Tweener TweenFloat(float start, float end, float duration, LuaFunction OnUpdate)
{
return DOTween.To(() => start, x =>
{
try
{
OnUpdate.Call(x);
}
catch (Exception e)
{
Debug.LogError(e);
}
}
, end, duration).SetEase(Ease.Linear).OnComplete(() =>
{
OnUpdate.Dispose();
OnUpdate = null;
});
}
示例7: TweenVector3
public static Tweener TweenVector3(Vector3 start, Vector3 end, float duration, LuaFunction OnUpdate)
{
return DOTween.To(() => start, x => OnUpdate.Call(x), end, duration).OnComplete(() =>
{
OnUpdate.Dispose();
OnUpdate = null;
});
}