Warcorrespondents/Assets/Scripts/事件/AfterReparedTheMachine.cs
Roman d61a850951 *合并了SAIPOVersion
任务:实装和完善部分音效,修复场景问题
1.增加走路时的脚步声音效
2.将Listener转移到玩家身上防止立体声出现问题
3.删除了跑步扬尘效果
4.增加了跑步时的脚步声音效
5.加快了跑步动画为原来的1.2倍,使之步频加快,看起来更加真实。
6.加快了导弹的下落速度,但是加长了导弹的下落前阴影提示时间
7.加强了阴影的闪烁幅度和宽度
8.提高了阴影的阿尔法值
9.提高了修完第一根电报线后生成导弹的高度,防止其漏个头出来
10.添加了修复电报线的音效
11.添加了打开任务书的音效
12.削弱地雷音效的3D特性,使得其爆炸时音量不至于过小
13.增加了爬坑音效
14.修复了电报机音效
15.降低了电报机音量
16.增加了跳下坑的音效
17.关闭了战场背景音的3D特性
18.调整了水流音效的影响范围和衰弱等级
19.降低了水流声的音量
(*:拾取投掷物的音效过于机械,建议更换
20.实装了投掷系统的音效(拾取物品、丢出物品、投掷物着地)
(*:着地音效太重了,而投掷物是很轻的石块
(*:投出音效太假了,像是什么棍子挥动的声音
2021-09-09 00:59:27 +08:00

97 lines
3.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Fungus;
using UnityEngine.InputSystem;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using Cinemachine;
public class AfterReparedTheMachine : Event
{
private RepairBench repairBench;
private CinemachineVirtualCamera Vcamera;
[Tooltip("请拖入巡逻敌人")]
public Patrolman patrolman1;
[Tooltip("请拖入巡逻敌人")]
public Patrolman patrolman2;
private M_Player player;
[Tooltip("请拖入电报机UI界面")]
public GameObject MachineUI;
[Tooltip("请拖入倒计时UI")]
public Text countDown;
private int leftTime = 10;
public GameObject blackUI;
private Machine machine;
public WVParallax parallax;
public AudioSource gunAudio;
void Start()
{
repairBench = FindObjectOfType<RepairBench>();
Vcamera = FindObjectOfType<CinemachineVirtualCamera>();
player = FindObjectOfType<M_Player>();
machine = FindObjectOfType<Machine>();
//OnCall();
}
//事件,当修完电报机
public override void OnCall()
{
StartCoroutine("Process");
}
private IEnumerator Process()
{
parallax.canParallax = false;
//1.关闭玩家操作地图
FindObjectOfType<PlayerInput>().
SwitchCurrentActionMap("NullMap");
//2.给玩家若干反应时间,然后关闭修理电报机界面
yield return new WaitForSeconds(0f);
repairBench.m_interface.SetActive(false);
//3.再过若干时间,镜头跟踪物改为敌人
yield return new WaitForSeconds(2f);
Vcamera.Follow = patrolman1.transform;
//4.同时敌人的targe改为玩家
patrolman1.ChangeTargetTo(player.transform);
patrolman2.ChangeTargetTo(player.transform);
patrolman1.GetComponent<Animator>().SetBool("IsRush",true);
patrolman2.GetComponent<Animator>().SetBool("IsRush",true);
//5.若干时间后,镜头跟踪物改为玩家
yield return new WaitForSeconds(4f);
Vcamera.Follow = player.transform;
//6.若干短时间后敌人的target改为普通巡逻点
yield return new WaitForSeconds(1f);
patrolman1.ChangeTargetTo(patrolman1.point1);
patrolman2.ChangeTargetTo(patrolman1.point1);
//7.若干时间后,弹出对话【被发现了】
Flowchart.BroadcastFungusMessage("被发现了");
}
public void AfterChat()
{
machine.OnCall();
player.catched = machine;
MachineUI.SetActive(true);
player.GetComponent<PlayerInput>().
SwitchCurrentActionMap("PlayerInCoding");
countDown.gameObject.SetActive(true);
InvokeRepeating("CountDown",0,1);
}
private void CountDown()
{
countDown.text = "倒计时" + leftTime;
leftTime--;
if(leftTime == 0)
{
//当倒计时结束
blackUI.SetActive(true);
}
}
private void PlayGunAudio()
{
gunAudio.Play();
}
}