Roman 5e29da1a25 任务:实装音乐,修复问题
1.实装每个场景的音乐,并安置好切歌功能

2.修复问题
(1.修复对话时能操作的问题
(2.修复开幕演出结束前玩家能够操作的问题
下班
(3.伊斯兰前置关掉怪太少了
(4.修复一边看板子一边走路会听不下来的问题
(5.调整了各怪物的攻击力和血量等信息
(6.调整各关卡图层,防止出现覆盖问题
(7.村右边空气墙忘加光滑材质
(8.敲钟音效太小声
(9.调整以撒粒子图层
(10.修改以撒Stage的转移点位置

*.不出意外的话,这就是最后的提交了
*.感慨万千,感慨万千
2021-12-28 17:08:26 +08:00

73 lines
1.9 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.InputSystem;
/// <summary>
/// 板子组件
/// </summary>
public class Board : Interactive
{
/// <summary>
/// 留言板内容
/// </summary>
public string text;
/// <summary>
/// 留言板主人的uid
/// </summary>
public int uid;
/// <summary>
/// 留言板位置
/// </summary>
public Vector2 postion;
private GameObject UI;
private Text textUI;
private Text UIDUI;
private MyPlayer player;
Board(Vector2 postion, int uid, string text){
this.postion = postion;
this.uid = uid;
this.text = text;
}
void Start(){
Init();
}
void Update(){
if(CheckComfirm()){
if(UI.activeSelf){
UI.SetActive(false);
player.GetComponent<PlayerInput>().SwitchCurrentActionMap("Normal");
}
}
}
private void Init(){
UI = GameObject.Find("留言板相关").transform.GetChild(1).gameObject;
textUI = UI.GetComponent<RectTransform>().GetChild(0).GetChild(0).GetComponent<Text>();
UIDUI = UI.GetComponent<RectTransform>().GetChild(0).GetChild(1).GetComponent<Text>();
player = FindObjectOfType<MyPlayer>();
}
/// <summary>
/// 当玩家与留言板互动
/// </summary>
public override void OnCall(){
UI.SetActive(true);
textUI.text = text;
UIDUI.text = "UID:"+uid;
player.GetComponent<PlayerInput>().SwitchCurrentActionMap("NullMap");
player.inputDir = 0;
}
private bool CheckComfirm(){
//如果按下此帧按下此二键中的一个
return (Gamepad.current!= null &&
Gamepad.current.buttonEast.wasPressedThisFrame) ||
Input.GetKeyDown(KeyCode.K);
}
}