-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scale.cs
38 lines (35 loc) · 1023 Bytes
/
Scale.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using UnityEngine;
using System.Collections;
public class Scale : MonoBehaviour
{
void Update () {
//物体のスケール拡大縮小
if (Input.GetButtonDown("Fire1"))
{
transform.localScale += new Vector3(0.3f, 0.3f, 0.3f);
}
if (Input.GetButtonDown("Fire2"))
{
transform.localScale += new Vector3(-0.3f, -0.3f, -0.3f);
}
//押している間スローモーションとハイスピード
//PS3版
if (Input.GetButton("Fire3"))
{
Time.timeScale = 0.5F;
}
else if (Input.GetButtonUp("Fire3"))
Time.timeScale = 1.2F;
//押しているハイだ半重力発生
{
if (Input.GetButton("Gravity"))
{
Physics.gravity = new Vector3(0, 4.4f, 0);
}
else if (Input.GetButtonUp("Gravity"))
{
Physics.gravity = new Vector3(0, -9.8f, 0);
}
}
}
}