static int _CreateMissingComponentException(IntPtr L) { int count = LuaDLL.lua_gettop(L); if (count == 0) { MissingComponentException obj = new MissingComponentException(); LuaScriptMgr.PushObject(L, obj); return(1); } else if (count == 1) { string arg0 = LuaScriptMgr.GetString(L, 1); MissingComponentException obj = new MissingComponentException(arg0); LuaScriptMgr.PushObject(L, obj); return(1); } else if (count == 2) { string arg0 = LuaScriptMgr.GetString(L, 1); Exception arg1 = LuaScriptMgr.GetNetObject <Exception>(L, 2); MissingComponentException obj = new MissingComponentException(arg0, arg1); LuaScriptMgr.PushObject(L, obj); return(1); } else { LuaDLL.luaL_error(L, "invalid arguments to method: MissingComponentException.New"); } return(0); }
public static int constructor(IntPtr l) { int result; try { int num = LuaDLL.lua_gettop(l); if (num == 1) { MissingComponentException o = new MissingComponentException(); LuaObject.pushValue(l, true); LuaObject.pushValue(l, o); result = 2; } else if (num == 2) { string message; LuaObject.checkType(l, 2, out message); MissingComponentException o = new MissingComponentException(message); LuaObject.pushValue(l, true); LuaObject.pushValue(l, o); result = 2; } else if (num == 3) { string message2; LuaObject.checkType(l, 2, out message2); Exception innerException; LuaObject.checkType <Exception>(l, 3, out innerException); MissingComponentException o = new MissingComponentException(message2, innerException); LuaObject.pushValue(l, true); LuaObject.pushValue(l, o); result = 2; } else { result = LuaObject.error(l, "New object failed."); } } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
private Animator GetAnimatorController(SerializedProperty property) { var component = property.serializedObject.targetObject as Component; if (component == null) { Debug.LogException(new InvalidCastException("Couldn't cast targetObject")); } var anim = component.GetComponent <Animator>(); if (anim == null) { var exception = new MissingComponentException("Missing Aniamtor Component"); Debug.LogException(exception); return(null); } return(anim); }