mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
feat: animation track as asset (WIP)
This commit is contained in:
parent
df5bc1f9fe
commit
104c74e653
10 changed files with 86 additions and 24 deletions
|
|
@ -2,9 +2,10 @@ local rig = entity.skeleton
|
|||
|
||||
local states = {}
|
||||
|
||||
function create_state(name, track, max_intencity)
|
||||
function create_state(name, track_id, max_intencity)
|
||||
states[name] = {
|
||||
track = track,
|
||||
track = nil,
|
||||
track_id = track_id,
|
||||
timer = 0.0,
|
||||
fade_time = 0.0,
|
||||
fade_timer = 0.0,
|
||||
|
|
@ -47,6 +48,7 @@ local function update(delta)
|
|||
end
|
||||
end
|
||||
|
||||
state.track = state.track or animation.get_track(state.track_id)
|
||||
if state.track and intensity > 0.0 then
|
||||
state.track.func(rig, state.timer, intensity * state.max_intencity)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -332,6 +332,8 @@ end
|
|||
world.raycast = entities.__world_raycast
|
||||
entities.__world_raycast = nil
|
||||
|
||||
animation = require "core:animation"
|
||||
|
||||
__vc_scripts_registry = require "core:internal/scripts_registry"
|
||||
|
||||
file.open = require "core:internal/stream_providers/file"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue