Created
February 1, 2018 13:19
-
-
Save bibinba/3c114d33668ce0b79c93e8dad0b9dad4 to your computer and use it in GitHub Desktop.
大きさを変える
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using HoloToolkit.Unity.InputModule; | |
using UnityEngine.VR.WSA.Input; | |
public class height_change : MonoBehaviour,IInputClickHandler | |
{ | |
public Text text; | |
public GameObject yome; | |
int height=151; | |
float kiso = 151.0f; | |
public float v=1f; | |
private GestureRecognizer gesture; | |
private bool airTapped; | |
// Use this for initialization | |
void Start () { | |
} | |
public void OnInputClicked(InputClickedEventData eventData) | |
{ | |
height = height + 2; | |
Updateheight(height); | |
} | |
void Update () { | |
Updateheight(height); | |
} | |
void Updateheight(int height) | |
{ | |
v = (float)height / kiso; | |
yome.transform.localScale = new Vector3(v, v, v);////Unityちゃんの大きさをv倍 | |
string h = ((int)(v * kiso)).ToString(); | |
text.text = h + "cm"; | |
} | |
public void onue() | |
{ | |
height = height + 2; | |
Updateheight(height); | |
Debug.Log(height); | |
} | |
public void onsita() | |
{ | |
height = height - 4; | |
Updateheight(height); | |
Debug.Log(height); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment