Tag:public atime als not http Type conversion how much format str
Animated array public object[] anim; Limit how many frames a second public float fps = 30; Frame sequence private int nowfram; Record current time private float switchtime; public string path = "Texture/33"; public bool Isloop = FALSE; Public image Image; public texture2d texture; void Awake () {anim = Resources.loadall (path); } void Update () {if (Anim = = null) {Anim = Resources.loadall (path); } drawanimation (Anim); } void Drawanimation (object[] tx) {switchtime + = Time.deltatime; if (switchtime >= 1.0/fps) {nowfram++; Switchtime = 0; if (Nowfram >= TX. Length) {if (isloop) Nowfram = 0; else return; }} if (Nowfram < TX. Length) {texture = (texture2d) Tx[nowfram]; Sprite sp = sprite.create (texture, new Rect (0, 0, Texture.width, texture.height), New Vector2 (0.5f, 0.5f)); Image.sprite = SP; } }
If the error occurs at run time, it is said that the type cannot be converted. Maybe you converted the picture type to a sprite. We're not going to get an error when we convert the tower to texture format in unity.
about using sequence frame animations in unity