40 lines
1.0 KiB
C#
Raw Permalink Normal View History

2025-05-18 01:04:31 +08:00
// ***********************************************************************
// 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_blur : MonoBehaviour
{
private Material _mat;
private void Awake()
{
_mat = this.GetComponentInChildren<Renderer>().material;
_mat.mainTextureOffset = Vector2.zero;
this.gameObject.SetActive(false);
}
private void Update()
{
Vector2 mainTextureOffset = _mat.mainTextureOffset;
if (mainTextureOffset.y > -1f)
{
_mat.mainTextureOffset -= Vector2.up * Time.deltaTime * 2f;
return;
}
_mat.mainTextureOffset = Vector2.zero;
this.gameObject.SetActive(false);
}
}
}