Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
pangweiwei committed Jan 24, 2019
1 parent 47c5e7b commit 2a50fea
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,34 @@ Output is:

Slua: call from bp 1024 Hello World 3.1400001049042 UObject: 0x136486168

## 使用lua扩展Actor

## Using lua extend Actor

```lua
-- LuaActor.lua
local actor={}

-- override event from blueprint
function actor:BeginPlay()
self.bCanEverTick = true
print("actor:BeginPlay")
end

function actor:Tick(dt)
print("actor:Tick",self,dt)
-- call actor function
local pos = self:K2_GetActorLocation()
-- can pass self as Actor*
local dist = self:GetHorizontalDistanceTo(self)
print("actor pos",pos,dist)
end

return actor
```

![](luaactor.png)

## 性能

slua-unreal提供3中技术绑定lua接口,包括:
Expand Down
Binary file added luaactor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2a50fea

Please sign in to comment.