40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
// ***********************************************************************
|
|
// Assembly : Game
|
|
// Author : Kimch
|
|
// Created : 2020-09-02
|
|
// Description :
|
|
// Last Modified By :
|
|
// Last Modified On :
|
|
// ***********************************************************************
|
|
// <copyright file= "Bullet_arrowshower_sub" company="Kimch"></copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
using UnityEngine;
|
|
|
|
namespace G
|
|
{
|
|
public class Bullet_arrowshower_sub : MonoBehaviour
|
|
{
|
|
private void Awake()
|
|
{
|
|
Object.Destroy(this.gameObject, 1f);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
Vector3 position = transform.position;
|
|
if (position.y > 0.2f)
|
|
{
|
|
transform.position = position - Vector3.up * (Time.deltaTime * 3f);
|
|
return;
|
|
}
|
|
Vector3 localScale = transform.localScale;
|
|
if (localScale.y > 0f)
|
|
{
|
|
transform.position = position - Vector3.up * Time.deltaTime;
|
|
transform.localScale = localScale - Vector3.up * Time.deltaTime;
|
|
}
|
|
}
|
|
}
|
|
}
|