74 lines
2.1 KiB
C#
74 lines
2.1 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Game
|
|||
|
// Author : Kimch
|
|||
|
// Created : 2020-09-02
|
|||
|
// Description :
|
|||
|
// Last Modified By :
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "Ef_blur" company="Kimch"></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
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<Collider>().isTrigger = true;
|
|||
|
this.GetComponent<Renderer>().enabled = true;
|
|||
|
}
|
|||
|
|
|||
|
private void Update()
|
|||
|
{
|
|||
|
if (this.GetComponent<Renderer>().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<Renderer>().enabled = false;
|
|||
|
this.transform.localScale = new Vector3(0f, 0f, 0f);
|
|||
|
var = 0;
|
|||
|
this.GetComponent<Collider>().isTrigger = false;
|
|||
|
}
|
|||
|
this.GetComponent<Renderer>().material.mainTextureOffset = offset;
|
|||
|
this.GetComponent<Renderer>().material.mainTextureScale = scale;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|