Roman 3476256694 任务:替换现有美术素材和动画、完善游戏的流程化
场景【第一关】
1.添加事件【打完电码后】,包含以下内容:
(1.关闭电报机界面
(2.在玩家周围生成一颗导弹
(3.导弹炸不到玩家,但是仍触发玩家被炸死的动画,表示被震晕
(4.震晕动画结束后若干秒,屏幕全黑
(5.转移到场景【第二关】

场景【第二关】
1.替换场景美术素材
2.将场景翻转
3.布置电报机
4.布置电报线
5.创建对话【醒来】,使其在改场景一开始就触发
6.给损坏的电报机添加代码,使玩家跟电报机互动后,电报机背在身上。
7.创建事件【若没拿包】,当玩家走到坡的一半并且没有拿损坏的电报机触发,弹出对话要求玩家拿电报机
8.创建对话【还没拿包】
9.修改地形
10.布置碉堡灯光敌人,具有以下特性:
(1.当玩家暴露在灯光下且没有模板遮挡时,判定玩家死亡
(2.碉堡的灯每若干秒都会过热关闭一段事件
11.安排坑的上下坑功能
2021-09-03 01:55:24 +08:00

54 lines
2.1 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 UnityEngine.SceneManagement;
using UnityEngine.InputSystem;
public class AfterCoding : Event
{
//事件:第一关打完码后
[Tooltip("要召唤,得先有,对吧?拖进炮弹的预制体")]
public GameObject shell;
[Tooltip("召唤的炮弹需要知道自己属于哪个轰炸区,请拖入其轰炸区")]
public BombingArea bombingArea;
[Tooltip("请拖入黑幕")]
public GameObject BlackUI;
void Start()
{
OnCall();
}
public override void OnCall()
{
//*关闭玩家操控地图
FindObjectOfType<PlayerInput>().SwitchCurrentActionMap("NullMap");
//1.关闭电报机界面
FindObjectOfType<Machine>().m_interface.SetActive(false);
//2.在玩家旁边生成一颗导弹
Shell thisShell = Instantiate(shell,new Vector3(119.539998f,5.96999979f,-4.01295185f),Quaternion.identity).
GetComponent<Shell>();
thisShell.M_BombingArea = bombingArea;
thisShell.YouAreSpecal();
//3.导弹爆炸后触发玩家死亡动画,这一段写在导弹类里面
}
//4.玩家被炸死开始执行后触发此段,镜头开始缓慢聚焦到主角
public void OnDeadAnimation()
{
StartCoroutine("OnDeadAnimationEnd");//若干秒后执行死亡动画播放完毕后代码
StartCoroutine("StopDead");//本帧结束后停止死亡动画条件防止反复触发
}
private IEnumerator StopDead()
{
yield return new WaitForEndOfFrame();
FindObjectOfType<M_Player>().GetComponent<Animator>().SetBool("IsBoomDead",false);
}
//5.当玩家被炸死动画结束后触发此段
private IEnumerator OnDeadAnimationEnd()
{
yield return new WaitForSeconds(1.1f + 3f);//炸死动画1.1秒 + 3秒留给玩家反应
//黑屏一张铺满的黑色UI显示
BlackUI.SetActive(true);
yield return new WaitForSeconds(2f);//两秒后,转移场景
SceneManager.LoadScene("第二关");
}
}