Advertisement
Krythic

fdgdfggg

Jun 6th, 2022
1,095
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. using System.Collections;
  2. using UnityEngine;
  3.  
  4. namespace Assets.Code.Scripts
  5. {
  6.     public class AnimatedTileTexture_Script : MonoBehaviour
  7.     {
  8.         public int columns = 2;
  9.         public int rows = 2;
  10.         public float framesPerSecond = 10f;
  11.  
  12.         private Renderer rend;
  13.         private WaitForSeconds sleepTime;
  14.  
  15.         //the current frame to display
  16.         private int index = 0;
  17.  
  18.         void Start()
  19.         {
  20.  
  21.             StartCoroutine(UpdateTileAnimation());
  22.             sleepTime = new WaitForSeconds(1f / framesPerSecond);
  23.         }
  24.  
  25.         private IEnumerator UpdateTileAnimation()
  26.         {
  27.             while (true)
  28.             {
  29.                 // just testing
  30.  
  31.                 yield return sleepTime;
  32.             }
  33.  
  34.         }
  35.     }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement