浏览代码

Back button on Android returns to the main menu

/4.1
Tim Mowrer 4 年前
当前提交
c83e50b0
共有 1 个文件被更改,包括 16 次插入9 次删除
  1. 25
      Assets/Scripts/UX/BackButton.cs

25
Assets/Scripts/UX/BackButton.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR.Management;
namespace UnityEngine.XR.ARFoundation.Samples
{

GameObject m_BackButton;
public GameObject backButton
{
get { return m_BackButton; }
set { m_BackButton = value; }
get => m_BackButton;
set => m_BackButton = value;
}
void Start()

}
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
BackButtonPressed();
}
}
SceneManager.LoadScene("Menu", LoadSceneMode.Single);
LoaderUtility.Deinitialize();
if (Application.CanStreamedLevelBeLoaded("Menu"))
{
SceneManager.LoadScene("Menu", LoadSceneMode.Single);
LoaderUtility.Deinitialize();
}
}
}
}
正在加载...
取消
保存