Tanoda
SpawningPOI.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using GILES;
4using GILES.Interface;
5using UnityEngine;
6
7public class SpawningPOI : pb_MonoBehaviourSingleton<SpawningPOI>
8{
9 public bool NextSpawnIsPOI = false;
10 public Transform SpawnParent;
11
12 public GameObject POIPrefab;
13
14 public void Spawn()
15 {
16 PopupManager.instance.ShowPopup("SETUP_POI", "SETUP_POI_TEXT");
17 StartCoroutine(GetSpawnedPOI());
18 }
19
20 private IEnumerator GetSpawnedPOI()
21 {
22 var prefabButton = GetComponent<pb_PrefabBrowserItemButton>();
23 prefabButton.Instantiate();
24 yield return new WaitForEndOfFrame();
25 SpawnParent = pb_Selection.activeGameObject /*should be our POI prefab*/.transform
26 .GetChild(0) /*our ShowOnHover GameObject*/.transform;
27 NextSpawnIsPOI = true;
28 }
29
30 private void Start()
31 {
32 var prefabButton = GetComponent<pb_PrefabBrowserItemButton>();
33 prefabButton.asset = POIPrefab;
34 }
35}
static GameObject activeGameObject
Definition: pb_Selection.cs:82
Transform SpawnParent
Definition: SpawningPOI.cs:10
void Spawn()
Definition: SpawningPOI.cs:14
GameObject POIPrefab
Definition: SpawningPOI.cs:12
bool NextSpawnIsPOI
Definition: SpawningPOI.cs:9