Warcorrespondents/Assets/Scripts/事件/AfterReparedTheMachine.cs
Roman 655fe9cb55 任务:实装和完善部分音效,修复场景问题
1.修复了部分元素没有按键提示的问题
2.实装建议,给死亡的士兵加上调查事件
3.实装追逐战
4.更换修理电报机系统的美术素材
5.给修理电报机系统添加音效
6.稍微更改了打码教学的语言
7.修复老兵的脸和火焰穿模的问题
8.修复了第二关玩家背包图层穿模问题
9.为最后打码添加倒计时音效
10.更新需要打的句子为图片
11.增加打完划掉效果
12.增加实时翻译显示

(*:第二关的炮火已经越来越好了,但是目前只有炮火,晚上肯定也会开枪吧?希望增加一些随机快速闪烁的光源表示晚上的枪。

xx:人声问题请待定,加上音乐后好像又不是很违和了
(*:碉堡警告音效系统做完了,但是人声感觉上非常奇怪,建议修改
(*:敌人被石头吸引系统实装完成,但是很突兀,建议还是不要出现语言了

接下来的任务:
4.制作开始界面
5.制作Thanks 4 Play
7.实装死亡和自动重新开始
2021-09-14 20:30:57 +08:00

106 lines
3.4 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("请拖入电报机操作提示界面")]
public GameObject OpUI;
[Tooltip("请拖入倒计时UI")]
public Text countDown;
private int leftTime = 10;
public GameObject blackUI;
private Machine machine;
public WVParallax parallax;
public AudioSource gunAudio;
public AudioSource countDownSE;
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);
OpUI.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);
countDownSE.Play();
InvokeRepeating("CountDown",0,1);
}
private void CountDown()
{
countDown.text = "倒计时" + leftTime;
leftTime--;
if(leftTime == 0)
{
//当倒计时结束
blackUI.SetActive(true);
countDownSE.Stop();
CancelInvoke("CountDown");
countDown.gameObject.SetActive(false);
Invoke("PlayGunAudio",1.5f);
}
}
private void PlayGunAudio()
{
gunAudio.Play();
}
}