Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
大きさを変える
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