Unity 泛型方法参数判空问题

项目tolua使用过程中出现了这样一个问题,一个unity的object在 如下方法中,ret 为空,而作为参数传到ToLua.PushSealed(L,ret) 中判断o == null 却返回false.

	static int get_sprite(IntPtr L)
	{
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			UnityEngine.UI.Image obj = (UnityEngine.UI.Image)o;
			UnityEngine.Sprite ret = obj.sprite;
			ToLua.PushSealed(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception ...

Continue reading

Yearly archives