-
Notifications
You must be signed in to change notification settings - Fork 0
/
clickoncar.cs
72 lines (65 loc) · 1.54 KB
/
clickoncar.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
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
67
68
69
70
71
72
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class clickoncar : MonoBehaviour
{
Vector3 d, s, m;
public GameObject fold;
private bool rnr = false;
public GameObject go_tr;
public GameObject fold4;
// Start is called before the first frame update
void Start()
{
d = gameObject.transform.position;
s = fold.transform.localScale;
m = fold4.transform.position;
}
// Update is called once per frame
void Update()
{
if (rnr)
{
if ((d[2] < 300) && (s[0] != 2))
{
d[2] += 1;
gameObject.transform.position = d;
}
if (d[2] == 300)
{
s[0] = 2;
gameObject.transform.localScale = new Vector3(6, 10, 17);
}
if ((d[2] > -4.2) && (s[0] == 2))
{
d[2] -= 1;
gameObject.transform.position = d;
}
m[0] = 1f;
fold4.transform.position = m;
}
if (go_tr.transform.position.x == 1f)
{
if (s[0] != 2)
rnr = true;
else
{
rnr = false;
s[0] = 1;
}
}
}
private void Asw()
{
if (fold4.transform.position.x == 1f)
{
if (s[0] != 2)
rnr = true;
else
{
rnr = false;
s[0] = 1;
}
}
}
}