← 목록

mLua · 문서 코드 예제

총 794개 · 페이지 6/27
🔀 랜덤
불러오는 중…

[source] | examples [title] | GlobalDataStorage [page] | apiReference/Misc/GlobalDataStorage [code] | local ds = _DataStorageService:GetGlobalDataStorage("StorageName") local keys = {} table.insert(keys, "Key1") table.insert(keys, "Key2") local errorCode, itemPages = ds:BatchGetAndWait(keys) while true do -- GetCurrentPageDatas()로 현재 페이지의 목록을 가져올 수 있습니다. local items = itemPages:GetCurr

[source] | examples [title] | GlobalDataStorage [page] | apiReference/Misc/GlobalDataStorage [code] | local ds = _DataStorageService:GetGlobalDataStorage("StorageName") local keys = {} table.insert(keys, "Key1") table.insert(keys, "Key2") local errorCode, deletedKeys = ds:BatchDeleteAndWait(keys)

[source] | examples [title] | GlobalDataStorage [page] | apiReference/Misc/GlobalDataStorage [code] | local ds = _DataStorageService:GetGlobalDataStorage("StorageName") local keyInfoValues = {} local keyInfo1 = DataStorageKeyInfo("Key1", "Version1", "Tag1") local keyInfo2 = DataStorageKeyInfo("Key2", "Version2", "Tag2") keyInfoValues[keyInfo1] = "Value1" keyInfoValues[keyInfo2] = "Value2" loca

[source] | examples [title] | GlobalDataStorage [page] | apiReference/Misc/GlobalDataStorage [code] | local ds = _DataStorageService:GetGlobalDataStorage("StorageName") local keyInfos = {} local keyInfo1 = DataStorageKeyInfo("Key1", "Version1", "Tag1") local keyInfo2 = DataStorageKeyInfo("Key2", "Version2", "Tag2") table.insert(keyInfos, keyInfo1) table.insert(keyInfos, keyInfo2) local errorCode

[source] | examples [title] | GlobalDataStorage [page] | apiReference/Misc/GlobalDataStorage [code] | local ds = _DataStorageService:GetGlobalDataStorage("StorageName") local errorCode, itemPages = ds:GetPagesAndWait("TestTag") while true do -- GetCurrentPageDatas()로 현재 페이지의 목록을 가져올 수 있습니다. local items = itemPages:GetCurrentPageDatas() for _, item in pairs(items) do

[source] | examples [title] | GlobalDataStorage [page] | apiReference/Misc/GlobalDataStorage [code] | local ds = _DataStorageService:GetGlobalDataStorage("StorageName") local minDate = DateTime(2023, 03, 09, 20, 20, 0, 0) local maxDate = DateTime(2023, 03, 09, 22, 20, 0, 0) -- 값을 저장할 때 버전 값을 함께 지정한 경우에만 조회할 수 있습니다. local errorCode, versionPages = ds:GetVersionsAndWait("Key", SortDirection.Ascend

[source] | examples [title] | GlobalDataStorage [page] | apiReference/Misc/GlobalDataStorage [code] | local ds = _DataStorageService:GetGlobalDataStorage("StorageName") local errorCode, oldValue = ds:GetAndWait("Key") if errorCode ~= 0 then log("failed") return end -- DataStorage 안에 예상하는 값이 저장되어 있을 경우 "NewValue"를 저장하고 다른 값이 저장되어 있을 경우 실패합니다. local errorCode2, newValue = ds:UpdateAndWait(

[source] | examples [title] | GlobalDataStorage [page] | apiReference/Misc/GlobalDataStorage [code] | local ds = _DataStorageService:GetGlobalDataStorage("StorageName") local keyInfo = DataStorageKeyInfo() keyInfo.Key = "Key" keyInfo.Version = "Version1" ds:SetByInfoAndWait(keyInfo, "Value") -- 기존 버전의 "Value" 값을 덮어 쓰는 대신 새로운 버전을 만들어 저장합니다. keyInfo.Key = "Key" keyInfo.Version = "Version2" ds:Se

[source] | examples [title] | GlobalDataStoragePages [page] | apiReference/Misc/GlobalDataStoragePages [code] | while true do local datas = pages:GetCurrentPageDatas() for _, data in pairs(datas) do log(data.Name) end -- IsLastPage 프로퍼티를 통해 현재 페이지가 마지막 페이지인지 확인할 수 있습니다. if pages.IsLastPage == true then return end -- 다음 페이지의 데이터를 미리 불러오고 다음 페이지가 유효하지 않은 경우 조회를 마칩니다. local loadResultCo

[source] | examples [title] | SortableDataStorage [page] | apiReference/Misc/SortableDataStorage [code] | local ds = _DataStorageService:GetSortableDataStorage("Storage") -- "Key"에 해당하는 값이 없을 경우 기본 값으로 생성 후 1을 증가시킵니다. local errorCode, value = ds:IncreaseAndWait("Key", 1)

[source] | examples [title] | SortableDataStorage [page] | apiReference/Misc/SortableDataStorage [code] | local ds = _DataStorageService:GetSortableDataStorage("Storage") ds:IncreaseAsync("Key", 1, function(errorCode, key, value) -- 작업이 완료되면 호출됩니다. end)

[source] | examples [title] | SortableDataStorage [page] | apiReference/Misc/SortableDataStorage [code] | local ds = _DataStorageService:GetSortableDataStorage("Storage") -- 데이터들을 정렬된 순서로 가져옵니다. local errorCode, itemPages = ds:GetSortedAndWait(SortDirection.Ascending, 0, 1000) while true do -- GetCurrentPageDatas()로 현재 페이지의 목록을 가져올 수 있습니다. local items = itemPages:GetCurrentPageDatas() fo

[source] | examples [title] | SortableDataStorageItemPages [page] | apiReference/Misc/SortableDataStorageItemPages [code] | while true do local datas = pages:GetCurrentPageDatas() for _, data in pairs(datas) do -- SortableDataStorageItem을 통해 키, 버전, 태그, 값을 조회할 수 있습니다. log(data.KeyInfo.Key) log(data.KeyInfo.Tag) log(data.KeyInfo.Version) log(data.Value) end -- IsLastPage 프로퍼티를 통해 현재 페이지가 마지막 페이지인지 확인할

[source] | examples [title] | SortableDataStoragePages [page] | apiReference/Misc/SortableDataStoragePages [code] | while true do local datas = pages:GetCurrentPageDatas() for _, data in pairs(datas) do log(data.Name) end -- IsLastPage 프로퍼티를 통해 현재 페이지가 마지막 페이지인지 확인할 수 있습니다. if pages.IsLastPage == true then return end -- 다음 페이지의 데이터를 미리 불러오고 다음 페이지가 유효하지 않은 경우 조회를 마칩니다. local loadResultCo

[source] | examples [title] | AreaParticleComponent [page] | apiReference/Components/AreaParticleComponent [code] | Property: [Sync] AreaParticleComponent ParticleComponent = nil Method: [client only] void OnBeginPlay() { self.ParticleComponent = self.Entity.AreaParticleComponent self.ParticleComponent.AreaSize.x = _UtilLogic:RandomDouble() * 2 self.ParticleComponent.ParticleCount = 2 } Event Handler: [ser

[source] | examples [title] | BasicParticleComponent [page] | apiReference/Components/BasicParticleComponent [code] | Property: [Sync] BasicParticleComponent ParticleComponent = nil Method: [client only] void OnBeginPlay() { self.ParticleComponent = self.Entity.BasicParticleComponent self.ParticleComponent.PlaySpeed = _UtilLogic:RandomDouble() * 2 self.ParticleComponent.ParticleCount = 2 } Event Handler: [s

[source] | examples [title] | DistanceJointComponent [page] | apiReference/Components/DistanceJointComponent [code] | Function: [server] void Connect () { local ball = _EntityService:GetEntityByPath("/maps/map01/Ball") self.Entity.DistanceJointComponent:AddJoint( ball, Vector2.zero, Vector2.zero, Vector2.Distance(ball.TransformComponent.WorldPosition:ToVector2(), self.Entity.TransformComponent.WorldPosi

[source] | examples [title] | GridViewComponent [page] | apiReference/Components/GridViewComponent [code] | Property: [None] GridViewComponent Inventory = nil [None] Entity InventorySlot = nil Method: [client only] void OnBeginPlay () { self.Inventory.ItemEntity = self.InventorySlot self.Inventory.OnRefresh = self.OnRefresh self.Inventory.OnClear = self.OnClear self.Inventory.TotalCount = 10 self.

[source] | examples [title] | LineRendererComponent [page] | apiReference/Components/LineRendererComponent [code] | Method: [server only] void OnBeginPlay () { self:DrawCircle(2, 20, Color.red, 1) } [server] void DrawCircle (number radius, integer vertexNum, Color color, number width) { -- radius: 반지름 -- vertexNum: 꼭지점 수 -- color: 선 색상 -- width: 선 두께 if vertexNum < 3 then log_error ("The \'vertexNum\'

[source] | examples [title] | PhysicsColliderComponent [page] | apiReference/Components/PhysicsColliderComponent [code] | Method: [server only] void OnBeginPlay () { self.Entity.PhysicsRigidbodyComponent:Sleep() } [server] void Change () { self.Entity.SpriteRendererComponent.SpriteRUID = "000000" self.Entity.PhysicsColliderComponent.CollisionGroup = CollisionGroups.Monster } Event Handler: [service: InputService]

[source] | examples [title] | PhysicsRigidbodyComponent [page] | apiReference/Components/PhysicsRigidbodyComponent [code] | Event Handler: [self] HandlePhysicsContactBeginEvent (PhysicsContactBeginEvent event) { --------------- Native Event Sender Info ---------------- -- Sender: PhysicsColliderComponent -- Space: Server, Client --------------------------------------------------------- -- Parameters local Contac

[source] | examples [title] | PhysicsRigidbodyComponent [page] | apiReference/Components/PhysicsRigidbodyComponent [code] | Event Handler: [self] HandlePhysicsContactBeginEvent (PhysicsContactBeginEvent event) { --------------- Native Event Sender Info ---------------- -- Sender: PhysicsColliderComponent -- Space: Server, Client --------------------------------------------------------- -- Parameters local Contact

[source] | examples [title] | PhysicsSimulatorComponent [page] | apiReference/Components/PhysicsSimulatorComponent [code] | Event Handler: [server only] [self] HandleTriggerEnterEvent (TriggerEnterEvent event) { --------------- Native Event Sender Info ---------------- -- Sender: InputService -- Space: Client --------------------------------------------------------- -- Parameters local inputValue = event.inputVal

[source] | examples [title] | PrismaticJointComponent [page] | apiReference/Components/PrismaticJointComponent [code] | Method: [server] void GoUp () { self.Entity.PrismaticJointComponent:SetMotorSpeed(1, 3) } [server] void GoDown () { self.Entity.PrismaticJointComponent:SetMotorSpeed(1, -3) } Event Handler: [service: InputService] HandleKeyDownEvent (KeyDownEvent event) { --------------- Native Event Sender Inf

[source] | examples [title] | RevoluteJointComponent [page] | apiReference/Components/RevoluteJointComponent [code] | Method: [server] void GoUp ( ) { self.Entity.RevoluteJointComponent:SetMotorSpeed(1, 10) } [server] void GoDown ( ) { self.Entity.RevoluteJointComponent:SetMotorSpeed(1, -10) } [server] void Stop ( ) { self.Entity.RevoluteJointComponent:SetMotorSpeed(1, 0) } Event Handler: [service: InputServi

[source] | examples [title] | SideviewbodyComponent [page] | apiReference/Components/SideviewbodyComponent [code] | Property: [None] table WallTile = {} Method: [client only] table GetWallTile () { return self.WallTile } Event Handler: [client only] [self] HandleRectTileCollisionBeginEvent (RectTileCollisionBeginEvent event) { ----------------- Native Emitter Info ------------------ -- Emitter: Kinematicbod

[source] | examples [title] | SpriteParticleComponent [page] | apiReference/Components/SpriteParticleComponent [code] | Property: [Sync] SpriteParticleComponent SpriteParticle = nil Method: [client only] void OnBeginPlay { self.SpriteParticle = self.Entity.SpriteParticleComponent self.SpriteParticle.SpriteRUID = "000000" self.SpriteParticle.ApplySpriteColor = true } Event Handler: [service: InputService] Hand

[source] | examples [title] | WebViewComponent [page] | apiReference/Components/WebViewComponent [code] | Method: [client only] void OnBeginPlay () { local webview = self.Entity.WebViewComponent if webview == nil then log_error("Entity doesn't have WebViewComponent") return end local webviewGroup = _EntityService:GetEntityByPath("/ui/WebViewGroup") if webviewGroup == nil then webv

[source] | examples [title] | WeldJointComponent [page] | apiReference/Components/WeldJointComponent [code] | Method: [server] void Connect (Entity target) { self.Entity.WeldJointComponent:AddJoint(target, Vector2(0, -1), Vector2.zero) } Event Handler: [self] HandlePhysicsContactBeginEvent (PhysicsContactBeginEvent event) { --------------- Native Event Sender Info ---------------- -- Sender: PhysicsColl

[source] | examples [title] | WheelJointComponent [page] | apiReference/Components/WheelJointComponent [code] | Method: [server] void Accelerate() { self.Entity.WheelJointComponent:SetMotorEnable(1, true) self.Entity.WheelJointComponent:SetMotorSpeed(1, -10) } [server] void Deaccelerate() { self.Entity.WheelJointComponent:SetMotorEnable(1, true) self.Entity.WheelJointComponent:SetMotorSpeed(1, 10) } [se

← → 방향키로 페이지 이동 · 숫자 입력 후 Enter로 점프