2021-08-12 00:53:48 +08:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
|
|
|
|
public class WhenTheCodeAndConversationAreCompleted : Event
|
|
|
|
{
|
|
|
|
// Start is called before the first frame update
|
|
|
|
//事件,当在序章中完成教学并且完成和父亲的第二段对话后
|
2021-09-11 02:04:32 +08:00
|
|
|
[Tooltip("请拖入黑幕游戏物体")]
|
|
|
|
public GameObject blackUI;
|
|
|
|
private IndexRecoder indexRecoder;
|
2021-09-12 02:19:08 +08:00
|
|
|
[Tooltip("请拖入序章-战场的BGM")]
|
|
|
|
public AudioClip clip;
|
2021-08-12 00:53:48 +08:00
|
|
|
void Start()
|
|
|
|
{
|
2021-09-11 02:04:32 +08:00
|
|
|
indexRecoder = FindObjectOfType<IndexRecoder>();
|
2021-08-12 00:53:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnCall()
|
|
|
|
{
|
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("LoadScene",indexRecoder.blackUITime);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void LoadScene()
|
|
|
|
{
|
2021-08-12 00:53:48 +08:00
|
|
|
indexRecoder.ChangeStageName("序章-战场");
|
|
|
|
SceneManager.LoadScene("序章-战场");
|
|
|
|
}
|
2021-09-11 02:04:32 +08:00
|
|
|
|
|
|
|
|
2021-08-12 00:53:48 +08:00
|
|
|
}
|