58 lines
1.3 KiB
C#
58 lines
1.3 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Game
|
|||
|
// Author : Kimch
|
|||
|
// Created : 2020-09-02
|
|||
|
// Description :
|
|||
|
// Last Modified By :
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "Bullet_particle2" company="Kimch"></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace G
|
|||
|
{
|
|||
|
public class Bullet_particle2 : MonoBehaviour
|
|||
|
{
|
|||
|
public float emitfinishdelay;
|
|||
|
|
|||
|
public float disable_delay;
|
|||
|
|
|||
|
public float expand_factor;
|
|||
|
|
|||
|
private Vector3 _originScale;
|
|||
|
|
|||
|
private void Awake()
|
|||
|
{
|
|||
|
_originScale = transform.localScale;
|
|||
|
}
|
|||
|
|
|||
|
private void OnEnable()
|
|||
|
{
|
|||
|
Invoke(nameof(StopEmit), emitfinishdelay);
|
|||
|
Invoke(nameof(FinishObj), disable_delay);
|
|||
|
GetComponent<ParticleSystem>().Play();
|
|||
|
|
|||
|
transform.localScale = _originScale;
|
|||
|
this.GetComponent<Collider>().enabled = true;
|
|||
|
}
|
|||
|
|
|||
|
private void StopEmit()
|
|||
|
{
|
|||
|
GetComponent<ParticleSystem>().Stop();
|
|||
|
this.GetComponent<Collider>().enabled = false;
|
|||
|
}
|
|||
|
|
|||
|
private void FinishObj()
|
|||
|
{
|
|||
|
this.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
|
|||
|
private void Update()
|
|||
|
{
|
|||
|
this.transform.localScale += Vector3.one * (expand_factor * Time.deltaTime);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|