public static CGUIOptions GetInstance()
    {
        if (instance == null)
            instance = new CGUIOptions();

        return instance;
    }
Exemple #2
0
    public static CGUIOptions GetInstance()
    {
        if (instance == null)
        {
            instance = new CGUIOptions();
        }

        return(instance);
    }
Exemple #3
0
    void Update()
    {
        if (m_playerEntity.CurrentGameState == GameState.Running)
        {
            return;
        }

        CGUIOptions.GetInstance().OnUpdate();
    }
Exemple #4
0
    void OnGUI()
    {
        if (m_playerEntity.CurrentGameState == GameState.Running)
        {
            return;
        }

        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), PauseMenuBackground);

        GUI.skin = MainMenuSkin;
        CGUIOptions.GetInstance().OnGUI(false);
    }
    void OnGUI()
    {
        GUI.skin     = MainMenuSkin;
        m_itemCenter = new Vector2((Screen.width * 0.3f) - (Title.width * 0.5f), 0.0f);

        Rect logo = new Rect(m_itemCenter.x, m_itemCenter.y, Title.width, Title.height);

        GUI.Label(logo, Title);

        switch (m_menuState)
        {
        case MenuState.Main:
            DoMainMenu();
            break;

        case MenuState.Play:
            Application.LoadLevel("CutScene");
            break;

        case MenuState.Continue:
            DoContinueMenu();
            break;

        case MenuState.Options:
            CGUIOptions.GetInstance().OnGUI(true);
            if (CGUIOptions.GetInstance().GetMenuState() == CGUIOptions.PausedMenuState.Main)
            {
                m_menuState   = MenuState.Main;
                m_highlighted = "options";
                m_pressedOK   = false;
            }

            if (m_highlighted == "back" && m_pressedOK)
            {
                m_menuState   = MenuState.Main;
                m_highlighted = "options";
                m_pressedOK   = false;
            }

            break;

        case MenuState.Exit:
            DoQuitMenu();
            break;
        }
        ;

        if (m_usingController)
        {
            GUI.FocusControl(m_highlighted);
        }
    }
Exemple #6
0
    /*
     * \brief Called when the object is created. At the start.
     *        Only called once per instaniation.
     */
    public void Start()
    {
        if (INSTANCE == null)
        {
            INSTANCE = this;
            CGUIOptions.GetInstance().ApplyOptions();
        }

        m_transform        = this.transform;
        DistanceFromPlayer = InitialDistanceFromPlayer;
        m_playerEntity     = CEntityPlayer.GetInstance();
        if (m_playerEntity == null)
        {
            m_playerEntity = GameObject.Find("Player Spawn").GetComponent <CEntityPlayer>();
        }
        m_playerPelvis = m_playerEntity.transform.FindChild("Player_Mesh/Bip001/Bip001 Pelvis");

        m_currentTransform = m_playerPelvis;

        m_storedPositions = new ArrayList();
        m_storedPositions.Add(m_currentTransform.position);
        m_countIgnoredFrames = 0;

        m_storedCameraPositions = new ArrayList();

        m_credits = this.gameObject.GetComponentInChildren <CEndCredits>();
        if (m_credits)
        {
            m_credits.gameObject.SetActiveRecursively(false);
        }
        if (this.transform.FindChild("Background"))
        {
            m_creditsBackground = this.transform.FindChild("Background").gameObject;
            if (m_creditsBackground)
            {
                m_creditsBackground.SetActiveRecursively(false);
            }
        }
    }