-
Notifications
You must be signed in to change notification settings - Fork 0
/
finish.cs
53 lines (29 loc) · 788 Bytes
/
finish.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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class finish : MonoBehaviour {
public GameObject finish1;
public buttonActive button; // Manggil Script
public Transform finishpoint;
// Use this for initialization
void Start () {
button = FindObjectOfType<buttonActive> (); // Declarasi script yang dipanggil
finish1.SetActive (false);
}
// Update is called once per frame
void Update () {
}
public void MainMenu(){
}
void OnTriggerEnter2D(Collider2D other){
if (other.name == "Player") {
Debug.Log ("Finish");
finish1.SetActive (true);
Time.timeScale = 0;
button.buttonOff = true;
other.transform.position = finishpoint.position;
}
}
void OnTriggerExit2D(Collider2D other){
}
}