// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2020-09-02 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using UnityEngine; namespace G { public class Ef_meteospash : MonoBehaviour { private int uvAnimationTileX = 4; private int uvAnimationTileY = 4; private int framesPerSecond = 22; private float index; private float starttime; private float currenttime; private int lastframe; private int var; private void Start() { starttime = Time.time; currenttime = Time.time; lastframe = uvAnimationTileX * uvAnimationTileY; this.transform.localScale = new Vector3(1.3f, 1.3f, 1.3f); this.transform.parent = GameObject.Find("SkillEf").transform; this.GetComponent().isTrigger = true; this.GetComponent().enabled = true; } private void Update() { if (this.GetComponent().enabled) { Vector3 localScale = base.transform.localScale; if (localScale.x < 3.5f) { this.transform.localScale += new Vector3(1f, 1f, 1f) * Time.deltaTime; } currenttime = Time.time - starttime; index = currenttime * framesPerSecond; index = (int)(index % lastframe); var -= (int)index; Vector2 scale = new Vector2(1f / uvAnimationTileX, 1f / uvAnimationTileY); float num = index % uvAnimationTileX; int num2 = (int)index / uvAnimationTileX; Vector2 offset = new Vector2(num * scale.x, 1f - scale.y - num2 * scale.y); if (index == 0f && var != 0) { this.GetComponent().enabled = false; this.transform.localScale = new Vector3(0f, 0f, 0f); var = 0; this.GetComponent().isTrigger = false; } this.GetComponent().material.mainTextureOffset = offset; this.GetComponent().material.mainTextureScale = scale; } } } }