50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
// ***********************************************************************
|
|
// Assembly : Game
|
|
// Author : Kimch
|
|
// Created : 2020-09-02
|
|
// Description :
|
|
// Last Modified By :
|
|
// Last Modified On :
|
|
// ***********************************************************************
|
|
// <copyright file= "Bullet_tornado_b1" company="Kimch"></copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
using UnityEngine;
|
|
|
|
namespace G
|
|
{
|
|
/// <summary>
|
|
/// 龙卷风
|
|
/// </summary>
|
|
public class Bullet_tornado_b1 : MonoBehaviour
|
|
{
|
|
private float _timer;
|
|
|
|
private void Awake()
|
|
{
|
|
_timer = 2f;
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
this.GetComponent<Animation>()["tornado"].speed = 0.3f;
|
|
this.transform.position += this.transform.forward * 0.1f;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
_timer -= Time.deltaTime;
|
|
float delta = 0.5f * Time.deltaTime;
|
|
this.transform.position += this.transform.forward * delta;
|
|
if (_timer <= 0f)
|
|
{
|
|
Destroy(this.gameObject);
|
|
}
|
|
}
|
|
}
|
|
}
|