Unity 实现安卓返回键

在Unity中,KeyCode.Escape点击事件就是安卓的返回键。

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameApp : MonoBehaviour {
    void Update () {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Debug.Log("我是返回键 ̄ω ̄");
        }
            
    }
}

 

posted @ 2021-07-28 09:17  小糸侑  阅读(781)  评论(0)    收藏  举报