CountAnimations
This function gets the number of animation sequences an entity contains.
Syntax
Returns
Returns the number of animations an entity contains.
Example
--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
local camera = Camera:Create()
camera:SetRotation(35,0,0)
camera:Move(0,0,-3)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)
--Load a model
local model = Model:Load("Models/Characters/Crawler/crawler.mdl")
while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end
Time:Update()
world:Update()
world:Render()
context:SetBlendMode(Blend.Alpha)
context:DrawText("The model contains "..model:CountAnimations().." animations.",2,2)
context:Sync()
end