-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tutorial.cs
54 lines (46 loc) · 1.56 KB
/
Tutorial.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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Tutorial : MonoBehaviour
{
Referances referances;
[SerializeField] GameObject y;
[SerializeField] GameObject Cube;
[SerializeField] GameObject uiText;
[SerializeField] GameObject hand;
public bool check;
void Start()
{
check = false;
referances = GameObject.FindGameObjectWithTag("GameManager").GetComponent<Referances>();
uiText.SetActive(false);
hand.SetActive(false);
}
void Update()
{
if (check)
{
//y.gameObject.transform.GetComponent<PlatformLine>().STopMovemant();
uiText.SetActive(false);
hand.SetActive(false);
check = false;
}
}
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag =="Player")
{
GameObject x;
x = Instantiate(Cube, new Vector3(transform.position.x - 1, transform.position.y - 2.5f, transform.position.z + 3.5f),Quaternion.Euler(0,-90,0));
x.AddComponent<tut2>();
x.AddComponent<Rigidbody>().useGravity = false;
referances.player.GetComponent<Follo>().StopMovemant();
referances.player.GetComponent<Follo>().coroutineAllowed = false;
referances.player.GetComponent<Follo>().runing = false;
referances.manager.stop = true;
uiText.SetActive(true);
hand.SetActive(true);
GetComponent<BoxCollider>().enabled = false;
}
}
}