简体   繁体   中英

Destroy a Animator object ursina

I have an animator object in ursina. I want to destroy it.

from ursina import *
app = Ursina()
walka = Animation("assets/zombies/zombie1/walk/",fps = 5,loop=True)
animator1 =  Animator(animations= {"walk":walka})
animator1.state = "walk"
destroy(animator1)
app.run()

Do this:

from ursina import *

app = Ursina()
walka = Animation("assets/zombies/zombie1/walk/", fps=5, loop=True)
animator1 = Animator(animations={"walk": walka})
animator1.state = "walk"
walka.disable() # disables the animation.

app.run()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM