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= "Bullet_lightning" company="Kimch"></copyright>
// <summary></summary>
// ***********************************************************************
using UnityEngine;
namespace G
{
/// <summary>
///
/// </summary>
public class Bullet_lightning : MonoBehaviour
{
private Renderer _renderer;
private void Awake()
{
_renderer = this.GetComponent<Renderer>();
}
private void OnEnable()
{
}
private void Update()
{
if (_renderer.enabled)
{
var position = this.transform.position;
if (position.y > 0f)
{
position.y -= 5f * Time.deltaTime;
this.transform.position = position;
}
else
{
position.y = 0f;
this.transform.position = position;
}
}
}
}
}