2.添加了三个关卡的视差效果 3.添加了第一关的机枪兵的开枪时的火光 4.实装了第二关的挡板遮挡灯光效果 5.增加了第一关中的大型烟雾 6.实装了第二关的水面反射 (以上更改均有或多或少修改程序的代码) 7.增加了玩家脚底的跑动灰尘效果 8.增加了战场上时不时飘过的黑色烟雾(有时可能有些违和)
45 lines
740 B
C#
45 lines
740 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
|
|
public class GunLight : MonoBehaviour
|
|
{
|
|
private bool upLight = true;
|
|
public GameObject light;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
InvokeRepeating("ChangeLight",1f,0.05f);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
void ChangeLight()
|
|
{
|
|
if (upLight)
|
|
{
|
|
light.SetActive(upLight);
|
|
upLight = false;
|
|
}
|
|
|
|
else
|
|
{
|
|
light.SetActive(upLight);
|
|
upLight = true;
|
|
|
|
}
|
|
}
|
|
|
|
public void Gundead()
|
|
{
|
|
CancelInvoke();
|
|
light.SetActive(false);
|
|
}
|
|
}
|