lua/wrappers/game/lua_game_object.cpp
/**
	 * Sets a dialogue component onto this GameObject, can be nil.
	 * @param am.dialogue_component comp The dialogue component to attach to this GameObject, can be nil.
	 * @param boolean [true] set_attached When true it also sets that this GameObject
	 * is the game object attached to the dialogue component.
	 */
Sets a dialogue component onto this GameObject, can be nil.
@param am.dialogue_component comp The dialogue component to attach to this GameObject, can be nil.
@param boolean [true] set_attached When true it also sets that this GameObject
is the game object attached to the dialogue component.
Sets a dialogue component onto this GameObject can be nil . @param am . dialogue_component comp The dialogue component to attach to this GameObject can be nil . @param boolean [ true ] set_attached When true it also sets that this GameObject is the game object attached to the dialogue component .
int GameObject_dialogue_component(lua_State *lua, GameObject *obj)
	{
		if (!obj)
		{
			return 0;
		}
		if (lua_gettop(lua) == 1)
		{
			DialogueComponent *comp = obj->getDialogueComp();
			if (comp)
			{
				wrapRefObject<DialogueComponent>(lua, comp);
				return 1;
			}
		}
		else if (lua_isnil(lua, 2))
		{
			obj->setDialogueComp(nullptr);
			lua_first(lua);
		}
		else
		{
			DialogueComponent *comp = castUData<DialogueComponent>(lua, 2);
			if (comp)
			{
				if (lua_isbool(lua, 3))
				{
					obj->setDialogueComp(comp, lua_tobool(lua, 3));
				}
				else
				{
					obj->setDialogueComp(comp);
				}
				lua_first(lua);
			}
		}
		return LuaState::expectedArgs(lua, "dialogue_component", 2, "am.dialogue_component comp, boolean [true] set_attached", "nil comp");
	}
int GameObject_dialogue_component ( lua_State * lua , GameObject * obj ) { if ( ! obj ) { return 0 ; } if ( lua_gettop ( lua ) == 1 ) { DialogueComponent * comp = obj -> getDialogueComp ( ) ; if ( comp ) { wrapRefObject < DialogueComponent > ( lua , comp ) ; return 1 ; } } else if ( lua_isnil ( lua , 2 ) ) { obj -> setDialogueComp ( nullptr ) ; lua_first ( lua ) ; } else { DialogueComponent * comp = castUData < DialogueComponent > ( lua , 2 ) ; if ( comp ) { if ( lua_isbool ( lua , 3 ) ) { obj -> setDialogueComp ( comp , lua_tobool ( lua , 3 ) ) ; } else { obj -> setDialogueComp ( comp ) ; } lua_first ( lua ) ; } } return LuaState :: expectedArgs ( lua , " " , 2 , " " , " " ) ; }
Sets a dialogue component onto this GameObject, can be nil.
Sets a dialogue component onto this GameObject can be nil .