-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPostcardMenu.cs
More file actions
63 lines (47 loc) · 1.66 KB
/
PostcardMenu.cs
File metadata and controls
63 lines (47 loc) · 1.66 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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PostcardMenu : MonoBehaviour
{
public GameObject[] postcards;
public bool active;
// Start is called before the first frame update
void Awake()
{
for(int i = 0; i < 12; i++)
{
if(GameObject.Find("InventoryManager").GetComponent<InventoryManager>().postcardInventory[i] == true)
{
postcards[i].GetComponent<PostcardWarp>().unlocked = true;
}
}
LeanTween.scale(gameObject, new Vector3(0f, 0f, 0f), 0f).setIgnoreTimeScale(true);
OnOpen();
active = false;
}
// Update is called once per frame
void Update()
{
}
void OnOpen()
{
LeanTween.scale(gameObject, new Vector3(7f, 7f, 7f), 0.5f).setIgnoreTimeScale(true).setOnComplete(SetActive);
GameObject.Find("Player").GetComponent<PlayerController>().midTele = true;
GameObject.Find("RootShoot").GetComponent<Shoot>().shootEnable = false;
}
public void OnClose()
{
LeanTween.scale(gameObject, new Vector3(0f, 0f, 0f), 0.5f).setIgnoreTimeScale(true).setOnComplete(DestroyMe);
GameObject.Find("Player").GetComponent<PlayerController>().midTele = false;
GameObject.Find("RootShoot").GetComponent<Shoot>().shootEnable = true;
}
void DestroyMe()
{
//tiedInteractable.GetComponent<Interactable>().canInteract = true;
Destroy(gameObject);
}
void SetActive()
{
active = true;
}
}