73 lines
1.4 KiB
C#
73 lines
1.4 KiB
C#
// ***********************************************************************
|
|
// Assembly : Game
|
|
// Author : Kimch
|
|
// Created : 2021-09-23
|
|
// Description :
|
|
// Last Modified By :
|
|
// Last Modified On :
|
|
// ***********************************************************************
|
|
// <copyright file= "Ef_Dead" company="Kunpo"></copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace G
|
|
{
|
|
/// <summary>
|
|
/// 死亡效果
|
|
/// </summary>
|
|
public class Ef_Dead : MonoBehaviour
|
|
{
|
|
private float _delayFinish;
|
|
private float _downAccel = 1f;
|
|
|
|
|
|
|
|
public void FinishNow()
|
|
{
|
|
_delayFinish = 5f;
|
|
}
|
|
|
|
public void TextureChange(Texture a, Vector3 scale, int kind)
|
|
{
|
|
_delayFinish = 0f;
|
|
_downAccel = 0f;
|
|
}
|
|
|
|
private void Awake()
|
|
{
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
private void FixedUpdate()
|
|
{
|
|
if (_delayFinish > 3f)
|
|
{
|
|
this.gameObject.SetActive(false);
|
|
this.transform.position = Vector3.one * 6f;
|
|
_delayFinish = 0f;
|
|
}
|
|
else
|
|
{
|
|
_delayFinish += Time.deltaTime;
|
|
}
|
|
|
|
Vector3 position = this.transform.position;
|
|
if (position.y > 0f)
|
|
{
|
|
_downAccel += 5f * Time.deltaTime;
|
|
position.y -= _downAccel * Time.deltaTime;
|
|
this.transform.position = position;
|
|
}
|
|
else
|
|
{
|
|
position.y = 0f;
|
|
this.transform.position = position;
|
|
}
|
|
}
|
|
}
|
|
}
|