chenxin
2020-11-14 719a8a206e5167a28e5d968e13c38a3114082b7a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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()
        {
            // cx test
            // if (!isStart)
            // {
            //     isStart = true;
            // }
            // else
            // {
            //     Debug.Log($"--------------------- {duration} ---------------------");
            //     duration = 0;
            // }
            Affector.FireProjectile();
        }
 
        private void Update()
        {
            if (isStart)
                duration += Time.deltaTime;
        }
    }
}