Ejemplo n.º 1
0
    /// <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);
    }
Ejemplo n.º 2
0
    public void ShowHintAreaInScene(Transform hintAreaParent, Vector3 pos)
    {
        HintArea hintArea = GlobalTools.AddChild <HintArea>(hintAreaParent.gameObject, hintAreaPrefab);

        hintArea.transform.localPosition = hintAreaParent.InverseTransformPoint(pos);
    }