Skip to content

Commit

Permalink
numpad
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyoshiaki committed Jul 15, 2019
1 parent 267a44d commit 1954312
Show file tree
Hide file tree
Showing 4 changed files with 3,126 additions and 102 deletions.
39 changes: 39 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
// IntelliSense を使用して利用可能な属性を学べます。
// 既存の属性の説明をホバーして表示します。
// 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Unity Editor",
"type": "unity",
"path": "/e:/Unity/quest-rdp/Library/EditorInstance.json",
"request": "launch"
},
{
"name": "Windows Player",
"type": "unity",
"request": "launch"
},
{
"name": "OSX Player",
"type": "unity",
"request": "launch"
},
{
"name": "Linux Player",
"type": "unity",
"request": "launch"
},
{
"name": "iOS Player",
"type": "unity",
"request": "launch"
},
{
"name": "Android Player",
"type": "unity",
"request": "launch"
}
]
}
46 changes: 46 additions & 0 deletions Assets/QrdpUiNumpad.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using UnityEngine.UI;

namespace Qrdp
{
public class QrdpUiNumpad : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
var transforms = GetComponentsInChildren<Button>();
var buttons = from t in transforms select t.gameObject;
Debug.Log(buttons.ToArray().Length + "lengt");

foreach (var item in buttons.Select((v, i) => new { v, i }))
{
var txt = item.v.GetComponentInChildren<Text>();
var btn = item.v.GetComponent<Button>();

if (item.i < 10)
{
txt.text = item.i.ToString();
}
else if (item.i == 10)
{
txt.text = ".";
}
else if (item.i == 11)
{
txt.text = "enter";
}
}
}

// Update is called once per frame
void Update()
{

}
}
}


11 changes: 11 additions & 0 deletions Assets/QrdpUiNumpad.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1954312

Please sign in to comment.