Ejemplo n.º 1
0
    private void ShowStats(Collider uiElement)
    {
        // Get the stats panel gameobject and set active to true
        HubWorldStatsPanelHide statPanelHide = uiElement.gameObject.GetComponent <HubWorldStatsPanelHide>();
        GameObject             statsPanel    = statPanelHide.StatsPanel;
        // Get panel name
        string panelName = statsPanel.transform.parent.gameObject.name;

        // Check if level is completed
        // If its been completed, show the stats panel
        // else hide the stats panel
        Debug.Log(panelName);
        if (panelName == "GammaLevel" && CheckIfLevelIsCompleted(panelName))
        {
            _debugText.text = "Gamma level completed";
        }
        else if (panelName == "GammaLevel" && !CheckIfLevelIsCompleted(panelName))
        {
            _debugText.text = "Gamma level not completed";
        }

        if (CheckIfLevelIsCompleted(panelName))
        {
            statsPanel.SetActive(true);
        }
    }
Ejemplo n.º 2
0
    private void HideStatsPanel(Collider uiElement)
    {
        // Get the stats panel and deactive it
        HubWorldStatsPanelHide statPanelHide = uiElement.gameObject.GetComponent <HubWorldStatsPanelHide>();
        GameObject             statsPanel    = statPanelHide.StatsPanel;

        statsPanel.SetActive(false);
    }