/// <summary> /// switch game scene /// </summary> /// <param name="show"></param> public void ShowSceneObject(bool show) { if (show) { MainController.InventorySystem.actionHintClicked += OnInventoryHintClicked; } else { HintArea hintArea = GetComponentInChildren <HintArea>(); if (hintArea != null) { Destroy(hintArea.gameObject); } MainController.InventorySystem.actionHintClicked -= OnInventoryHintClicked; } gameObject.SetActive(show); }
public void ShowHintAreaInScene(Transform hintAreaParent, Vector3 pos) { HintArea hintArea = GlobalTools.AddChild <HintArea>(hintAreaParent.gameObject, hintAreaPrefab); hintArea.transform.localPosition = hintAreaParent.InverseTransformPoint(pos); }