lua/wrappers/game/lua_dialogue_component.cpp
/**
	 * Attaches this dialogue component to a game object, can be nil.
	 * @param am.game_object game_object The game object to attach to.
	 * @returns am.dialogue_component This
	 */
Attaches this dialogue component to a game object, can be nil.
@param am.game_object game_object The game object to attach to.
Attaches this dialogue component to a game object can be nil . @param am . game_object game_object The game object to attach to .
int DialogueComponent_attached_to(lua_State *lua)
	{
		DialogueComponent *comp = castUData<DialogueComponent>(lua, 1);
		if (comp)
		{
			if (lua_gettop(lua) == 1)
			{
				wrapGameObject(lua, comp->getAttachedTo());
				return 1;
			}
			if (lua_isnil(lua, 2))
			{
				comp->setAttachedTo(nullptr);
				lua_first(lua);
			}
			GameObject *obj = getGameObject(lua, 2);
			if (obj)
			{
				comp->setAttachedTo(obj);
				lua_first(lua);
			}
			return LuaState::expectedArgs(lua, "attached_to", "am.game_object game_object");
		}
		return LuaState::expectedContext(lua, "attached_to", "am.dialogue_component");
	}
int DialogueComponent_attached_to ( lua_State * lua ) { DialogueComponent * comp = castUData < DialogueComponent > ( lua , 1 ) ; if ( comp ) { if ( lua_gettop ( lua ) == 1 ) { wrapGameObject ( lua , comp -> getAttachedTo ( ) ) ; return 1 ; } if ( lua_isnil ( lua , 2 ) ) { comp -> setAttachedTo ( nullptr ) ; lua_first ( lua ) ; } GameObject * obj = getGameObject ( lua , 2 ) ; if ( obj ) { comp -> setAttachedTo ( obj ) ; lua_first ( lua ) ; } return LuaState :: expectedArgs ( lua , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Attaches this dialogue component to a game object, can be nil.
Attaches this dialogue component to a game object can be nil .