Files
daluandou/Assets/TJGeneratorLibEffects/Scripts/ETFXLightFade.cs
T
huadexuan 23c559d9f7 ```
feat(gameplay): 提升单位检测范围并添加法师属性

- 将所有单位的检测范围从默认值提升至100
- 为法师预制体添加护盾、等级等新属性
- 为法师添加暴击、吸血、伤害减免等战斗属性
- 更换法师弹丸预设并调整相关参数
- 添加锚点交战Z线控制功能
- 更新玩家数据中配备的召唤师技能
- 移除多余的纹理配置文件
```
2026-10-07 23:59:17 +08:00

39 lines
1.0 KiB
C#

using UnityEngine;
using System.Collections;
namespace TJGeneratorLibEffects
{
public class ETFXLightFade : MonoBehaviour
{
[Header("Seconds to dim the light")]
public float life = 0.2f;
public bool killAfterLife = true;
private Light li;
private float initIntensity;
// Use this for initialization
void Start()
{
if (gameObject.GetComponent<Light>())
{
li = gameObject.GetComponent<Light>();
initIntensity = li.intensity;
}
else
print("No light object found on " + gameObject.name);
}
// Update is called once per frame
void Update()
{
if (gameObject.GetComponent<Light>())
{
li.intensity -= initIntensity * (Time.deltaTime / life);
if (killAfterLife && li.intensity <= 0)
//Destroy(gameObject);
Destroy(gameObject.GetComponent<Light>());
}
}
}
}