UnityScriptだがこう作った
しかし1.0fでリセットされるから少し違和感感じるかも・・・
#pragma strict var speed:float; private var _myMaterial:Material; private var _offset:float; function Awake() { var uITexture:UITexture = GetComponent.<UITexture>(); _myMaterial = uITexture.material; } function Update() { _offset += speed; if (_offset >= 1.0f) { _offset -= 2.0f; // いい具合に反転する } _myMaterial.mainTextureOffset.x = _offset; }
これらも参考になるかも?
http://forum.unity3d.com/threads/33263-Anyway-to-get-animated-textures-in-Unity-Indie
http://wiki.unity3d.com/index.php?title=Animating_Tiled_texture