chenxin
2020-11-18 8e2286bc3f5f237dc628b828ffcfe25ef61b2a97
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
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;
        }
    }
}