using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using TowerDefense.Affectors;
|
|
/**
|
* 精灵塔攻击发射子弹触发
|
* @Author: chenxin
|
* @Date: 2020-11-13 16:34:24
|
*/
|
namespace KTGMGemClient
|
{
|
public class TowerFireTrigger : MonoBehaviour
|
{
|
public AttackAffector Affector;
|
|
private bool isStart;
|
|
private float duration;
|
|
public void OnFire()
|
{
|
if (!isStart)
|
{
|
isStart = true;
|
}
|
else
|
{
|
Debug.Log($"--------------------- {duration} ---------------------");
|
duration = 0;
|
}
|
Affector.FireProjectile();
|
}
|
|
private void Update()
|
{
|
if (isStart)
|
duration += Time.deltaTime;
|
}
|
}
|
}
|