Game Development Reference
In-Depth Information
Sandbox.lua :
function Sandbox_Update(sandbox, deltaTimeInMillis)
-- Update the animation state machines to handle
blending
-- and animation playback.
soldierAsm:Update(
deltaTimeInMillis,
Sandbox.GetTimeInMillis(sandbox));
weaponAsm:Update(
deltaTimeInMillis,
Sandbox.GetTimeInMillis(sandbox));
-- Always send both state machines back to the idle
animation.
if (soldierAsm:GetCurrentStateName() ~= "idle_aim") then
soldierAsm:RequestState("idle_aim");
end
if (weaponState == "sniper") then
if (weaponAsm:GetCurrentStateName() ~=
"sniper_idle") then
weaponAsm:RequestState("sniper_idle");
end
elseif (weaponState == "smg") then
if (weaponAsm:GetCurrentStateName() ~= "smg_idle")
then
weaponAsm:RequestState("smg_idle");
end
end
end
Search WWH ::




Custom Search