2025-05-18 01:04:31 +08:00

51 lines
1.0 KiB
C#

// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2020-09-02
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "SplashPetPoison" company="Kimch"></copyright>
// <summary></summary>
// ***********************************************************************
using UnityEngine;
namespace G
{
/// <summary>
///
/// </summary>
public class SplashPetPoison : MonoBehaviour
{
private float _delay = 2.5f;
private void Awake()
{
this.gameObject.SetActive(false);
}
private void OnEnable()
{
_delay = 2.5f;
}
private void Update()
{
if (_delay < 0f)
{
Vector3 pos = this.transform.position - Vector3.up * (Time.deltaTime * 0.05f);
this.transform.position = pos;
if (pos.y < -0.05f)
{
this.gameObject.SetActive(false);
}
}
else
{
_delay -= Time.deltaTime;
}
}
}
}