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

55 lines
1.2 KiB
C#

// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2020-09-02
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "Bullet_delay2" company="Kimch"></copyright>
// <summary></summary>
// ***********************************************************************
using UnityEngine;
namespace G
{
/// <summary>
///
/// </summary>
public class Bullet_delay2 : MonoBehaviour
{
public float show_delay;
public float disable_delay;
public bool moveleft;
private void OnEnable()
{
Invoke(nameof(StartObj), show_delay);
Invoke(nameof(FinishObj), disable_delay);
this.GetComponent<Collider>().enabled = false;
}
private void StartObj()
{
this.gameObject.SetActive(true);
this.GetComponent<Collider>().enabled = true;
}
private void FinishObj()
{
this.gameObject.SetActive(false);
this.GetComponent<Collider>().enabled = false;
}
private void Update()
{
if (moveleft)
{
this.transform.position -= transform.right * (Time.deltaTime * 0.2f);
}
}
}
}