12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System;
- using UnityEngine;
- public class StaffRollImageCtrl : MonoBehaviour
- {
- private void Awake()
- {
- this.uiTexture.mainTexture = null;
- this.spriteBack.enabled = false;
- this.animator = base.GetComponent<Animator>();
- this.ReadTexture();
- }
- private void ReadTexture()
- {
- this.m_listTexture = Resources.LoadAll<Texture2D>("SceneStaffRoll/Texture");
- this.QueTexture(0);
- }
- public void CheckChange(float progress)
- {
- int num = this.m_listTexture.Length - 1;
- int num2 = (int)((float)num * progress);
- if (num2 >= this.m_listTexture.Length)
- {
- return;
- }
- if (this.latestTexIndex != num2)
- {
- this.latestTexIndex = num2;
- this.QueTexture(num2);
- this.animator.SetTrigger("ApplyTex");
- }
- }
- private void QueTexture(int index)
- {
- this.queTexture = this.m_listTexture[index];
- }
- public void ApplyTex()
- {
- this.spriteBack.enabled = true;
- this.uiTexture.mainTexture = this.queTexture;
- }
- public void Finish()
- {
- this.animator.SetTrigger("End");
- }
- private Animator animator;
- [SerializeField]
- private UITexture uiTexture;
- [SerializeField]
- private UITexture spriteBack;
- private Texture2D queTexture;
- private Texture2D[] m_listTexture;
- private const string LOAD_TEXTURE_PATH = "SceneStaffRoll/Texture";
- private int latestTexIndex;
- }
|