2021-08-07 01:31:29 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
2021-08-12 00:53:48 +08:00
|
|
|
|
using UnityEngine.SceneManagement;
|
2021-09-12 02:19:08 +08:00
|
|
|
|
using Fungus;
|
|
|
|
|
using UnityEngine.InputSystem;
|
2021-08-07 01:31:29 +08:00
|
|
|
|
|
|
|
|
|
public class AFakeMachine : Interactive
|
|
|
|
|
{
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
//一个假的电报机类,因为“序章-战场”中的电报机不需要实际打码功能,为了方便我这里单独写一些代码
|
|
|
|
|
//继承可交互物体基类
|
2021-09-10 23:06:40 +08:00
|
|
|
|
public AudioSource onAudio;
|
2021-09-11 02:04:32 +08:00
|
|
|
|
[Tooltip("拖入黑幕游戏物体")]
|
|
|
|
|
public GameObject blackUI;
|
2021-09-12 02:19:08 +08:00
|
|
|
|
[Tooltip("请拖入序章家中前两幕的背景音乐")]
|
|
|
|
|
public AudioClip clip;
|
2021-08-07 01:31:29 +08:00
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnCall()
|
|
|
|
|
{
|
|
|
|
|
//当这个假的电报机被唤醒
|
|
|
|
|
//1.检查总线
|
|
|
|
|
AllLinesInfo info = FindObjectOfType<AllLinesInfo>();
|
|
|
|
|
if(info.AreYouOK())
|
|
|
|
|
{
|
|
|
|
|
//若所有线路OK
|
|
|
|
|
//转到场景“序章-家中”,给记录员发信息,让“序章-家中”表现为正确状态
|
2021-08-12 00:53:48 +08:00
|
|
|
|
IndexRecoder indexRecoder = FindObjectOfType<IndexRecoder>();
|
|
|
|
|
indexRecoder.ChangeStageName("序章-家中-已打码");
|
2021-09-10 23:06:40 +08:00
|
|
|
|
onAudio.Play();
|
2021-09-11 02:04:32 +08:00
|
|
|
|
blackUI.SetActive(true);
|
2021-09-12 02:19:08 +08:00
|
|
|
|
FindObjectOfType<BGMPlayer>().ChangedTheBGM(clip);
|
2021-09-11 02:04:32 +08:00
|
|
|
|
Invoke("loadSceneHome",indexRecoder.blackUITime);
|
2021-08-07 01:31:29 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//若还没OK,之后等策划编写新的内容
|
|
|
|
|
Debug.Log("还有线路没有联通");
|
2021-09-12 02:19:08 +08:00
|
|
|
|
FindObjectOfType<PlayerInput>().SwitchCurrentActionMap("NullMap");
|
|
|
|
|
Flowchart.BroadcastFungusMessage("没修完呢");
|
|
|
|
|
|
2021-08-07 01:31:29 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-09-10 23:06:40 +08:00
|
|
|
|
|
|
|
|
|
void loadSceneHome()
|
|
|
|
|
{
|
|
|
|
|
SceneManager.LoadScene("序章-家中");
|
|
|
|
|
}
|
2021-08-07 01:31:29 +08:00
|
|
|
|
}
|