-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathFunctionOverload.cs
More file actions
66 lines (52 loc) · 1.19 KB
/
FunctionOverload.cs
File metadata and controls
66 lines (52 loc) · 1.19 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using UnityEngine;
using System.Collections;
public class FunctionOverload : MonoBehaviour {
public int variable = 2;
// Use this for initialization
void Start () {
/*
if(variable == 3)
{
print("this is 2");
}
else if(variable == 4)
{
print("japan is great");
}
else if(variable == 6)
{
print("Sometimes I feel like dying in UIET");
}
else{
print("yaaron ki baarat");
}*/
}
void Update()
{
if(Input.GetKey(KeyCode.UpArrow))
{
transform.Translate(new Vector3(1.0f, 0.0f, 0.0f) * variable * Time.deltaTime) ;
}
if(Input.GetKey(KeyCode.DownArrow))
{
transform.Translate(-Vector3.forward * variable * Time.deltaTime) ;
}
if(Input.GetKey(KeyCode.LeftArrow))
{
transform.Rotate(Vector3.left* variable * Time.deltaTime);
}
if(Input.GetKey(KeyCode.RightArrow))
{
transform.Rotate(-Vector3.left * variable * Time.deltaTime) ;
}
}
}
/*
*
* new Vector3(1, 0, 0) -----> Vector3.right
* new Vector3(-1, 0, 0) -----> Vector3.left
* new Vector3(0, 1, 0) ------> Vector3.up
* new Vector3(0, -1, 0) -------> Vector3.down
* new Vector3(0, 0, 1) -------> Vector3.forward
* new Vector3(0, 0, -1) -------> Vector3.back
*/