57 lines
1.5 KiB
C#
57 lines
1.5 KiB
C#
// ***********************************************************************
|
|
// Assembly : Unity
|
|
// Author : Kimch
|
|
// Created : 2017-11-14
|
|
//
|
|
// Last Modified By : Kimch
|
|
// Last Modified On :
|
|
// ***********************************************************************
|
|
// <copyright file= "Tank_Destroy" company=""></copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
using UnityEngine;
|
|
|
|
namespace G
|
|
{
|
|
public class Tank_Destroy : MonoBehaviour
|
|
{
|
|
public Transform pt_fog;
|
|
|
|
private float _delay;
|
|
|
|
private bool _fogOn;
|
|
|
|
private Animation _myAnimation;
|
|
|
|
|
|
private void Awake()
|
|
{
|
|
_myAnimation = this.GetComponent<Animation>();
|
|
_myAnimation["tank_destroy"].speed = 0.25f;
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
//pt_fog.particleEmitter().emit = true;
|
|
_delay = 0f;
|
|
_fogOn = true;
|
|
_myAnimation.Stop();
|
|
_myAnimation.Play("tank_destroy");
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (_delay > 2.5f)
|
|
{
|
|
this.transform.position = Vector3.up * 25f;
|
|
this.gameObject.SetActive(false);
|
|
}
|
|
if (_delay > 0.5f && _fogOn)
|
|
{
|
|
//pt_fog.particleEmitter().emit = false;
|
|
_fogOn = false;
|
|
}
|
|
_delay += Time.deltaTime;
|
|
}
|
|
}
|
|
} |