62 lines
1.5 KiB
C#
62 lines
1.5 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Game
|
|||
|
// Author : Kimch
|
|||
|
// Created : 2020-08-28
|
|||
|
// Description :
|
|||
|
// Last Modified By :
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "SkillBird" company="Kimch"></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
namespace G
|
|||
|
{
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class Jin : MonoBehaviour
|
|||
|
{
|
|||
|
public Transform cyl;
|
|||
|
|
|||
|
private float _tuneTime;
|
|||
|
private float _finishDelay;
|
|||
|
private Material _cylMat;
|
|||
|
|
|||
|
private void Awake()
|
|||
|
{
|
|||
|
_cylMat = cyl.GetComponent<Renderer>().sharedMaterial;
|
|||
|
this.gameObject.SetActive(false);
|
|||
|
cyl.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
|
|||
|
private void OnEnable()
|
|||
|
{
|
|||
|
transform.localScale = Vector3.zero;
|
|||
|
cyl.gameObject.SetActive(true);
|
|||
|
}
|
|||
|
|
|||
|
private void Update()
|
|||
|
{
|
|||
|
if (Time.timeScale != 0f)
|
|||
|
{
|
|||
|
_tuneTime = Time.deltaTime / Time.timeScale;
|
|||
|
}
|
|||
|
_finishDelay += _tuneTime;
|
|||
|
_cylMat.mainTextureOffset += Vector2.up * _tuneTime * 3f;
|
|||
|
if (_finishDelay > 4f)
|
|||
|
{
|
|||
|
this.gameObject.SetActive(false);
|
|||
|
cyl.gameObject.SetActive(false);
|
|||
|
_finishDelay = 0f;
|
|||
|
}
|
|||
|
else if (_finishDelay > 3f)
|
|||
|
{
|
|||
|
transform.localScale = Vector3.Lerp(transform.localScale, Vector3.zero, _tuneTime * 3f);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
transform.localScale = Vector3.Lerp(transform.localScale, Vector3.one * 1.1f, _tuneTime * 3f);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|