でユニティゲームが実行されているかどうかを検出する方法は、基本的に、モバイルデバイスの物理キーボードとタッチスクリーンでサポートされているユニティゲームがあります。私はすでに物理的なキーボードのための私の動きのスクリプトを終えました、そして今、私はタッチスクリーンのためにコーディングしています。(ウェブキーボード)または(モバイルタッチ)
どうすればその機能を検出できますか?
私はそのような何かを考えていた...
private void HandleInput()
{
if (detect if physical keyboard here...)
{
if (Input.GetKey(KeyCode.RightArrow))
{
_normalizedHorizontalSpeed = 1;
}
else if (Input.GetKey(KeyCode.LeftArrow))
{
_normalizedHorizontalSpeed = -1;
}
} else if (detect touch screen here...)
{
for (int i = 0; i < Input.touchCount; ++i)
{
if (Input.GetTouch(i).phase == TouchPhase.Began)
{
some code here...
}
}
}
}
あなたはApplication.platform
を探している
@ Pablo-darde:どのようなフィードバックもコミュニティにとって非常に高く評価されています。 – Hellium
助けてくれてありがとう@Hellium –