Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using UnityEngine;
- namespace Assets.Code.Scripts
- {
- public class AnimatedTileTexture_Script : MonoBehaviour
- {
- public int columns = 2;
- public int rows = 2;
- public float framesPerSecond = 10f;
- private Renderer rend;
- private WaitForSeconds sleepTime;
- //the current frame to display
- private int index = 0;
- void Start()
- {
- StartCoroutine(UpdateTileAnimation());
- sleepTime = new WaitForSeconds(1f / framesPerSecond);
- }
- private IEnumerator UpdateTileAnimation()
- {
- while (true)
- {
- // just testing
- yield return sleepTime;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement