2022-07-26 00:00:56 +08:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using Sirenix.OdinInspector;
|
2022-07-30 20:02:28 +08:00
|
|
|
using UnityEngine.SceneManagement;
|
2022-07-26 00:00:56 +08:00
|
|
|
|
|
|
|
public class DebugHelper : MonoBehaviour
|
|
|
|
{
|
2022-07-30 00:47:44 +08:00
|
|
|
|
2022-07-30 20:02:28 +08:00
|
|
|
[Header("到此进入下一个场景")]
|
|
|
|
public GameObject getHereToContinue;
|
|
|
|
|
2022-07-30 00:47:44 +08:00
|
|
|
void Start()
|
|
|
|
{
|
2022-07-30 20:02:28 +08:00
|
|
|
if(ObstacleManager.Instance != null)ObstacleManager.Instance.StartCreatObstacle();
|
|
|
|
if(getHereToContinue != null)
|
|
|
|
getHereToContinue.AddComponent<GetHereToConut>();
|
2022-07-30 00:47:44 +08:00
|
|
|
}
|
2022-07-26 00:00:56 +08:00
|
|
|
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
// 按下R重启场景
|
|
|
|
if(Input.GetKeyDown(KeyCode.R))
|
|
|
|
{
|
|
|
|
Debug.Log("R");
|
2022-07-30 20:02:28 +08:00
|
|
|
UnityEngine.SceneManagement.SceneManager.LoadScene(SceneManager.GetActiveScene().name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private class GetHereToConut : MonoBehaviour
|
|
|
|
{
|
|
|
|
private void OnTriggerEnter2D(Collider2D other) {
|
|
|
|
SceneManager.LoadScene("中期提交场景");
|
2022-07-26 00:00:56 +08:00
|
|
|
}
|
|
|
|
}
|
2022-07-30 20:02:28 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-26 00:00:56 +08:00
|
|
|
}
|