Example #1
0
 public void actavateMenuOverlay( GUIGlobals.menuTypeDefs overlay )
 {
     if( _menuRefList[ (int)overlay ].activeSelf == false )
     {
         _currentOverlay = overlay;
         _menuRefList[ (int)_currentOverlay ].SetActive( true );
         _menuRefList[ (int)_currentMenu ].GetComponent<MenuBase>()._overlay = true;
     }
 }
Example #2
0
    public void setCurrentMenu( GUIGlobals.menuTypeDefs menuType )
    {
        // Start setCurrentMenu.

        if( !_menuRefList[ (int)menuType ].activeSelf && menuType != GUIGlobals.menuTypeDefs.NONE )
        {
            _menuRefList[(int)_currentMenu ].SetActive(false);
            _previousMenu = _currentMenu;
            _currentMenu = menuType;
            _menuRefList[(int)_currentMenu ].SetActive(true);
        }
        else
            _menuRefList[(int)_currentMenu ].SetActive(false);
    }
Example #3
0
    // Use this for initialization
    public void initialize( GUIGlobals.menuTypeDefs menuType, string backgroundPath, string[] buttonPathList, string[] toolTipList, Rect[] buttonPositionList )
    {
        // Start Constructor.

        // Misc:
        _nothingActive = GUIGlobals.NOTHING;

        // Setting the menuType and name:
        _menuType = menuType;
        _menuName = GUIGlobals.menuNameList[ (int)menuType ];

        // Tool Tip Settings:
        _toolTipList = toolTipList;
        _toolTipTimmer = 0.0f;
        ToolTipDelay = GUIGlobals.toolTipDelay;

        // Setting the active button to null just in case:
        _currentActiveButtonTexture = null;
        _currentActiveButtonIndex = _nothingActive;

        // Axis input related variables:
        if( axesInputDelayControl == null )
            axesInputDelayControl = AxesInputDelayControl.getInstance();
        _mouseInputSecondary = false;

        // Keyboard Input Variables:
        menuHardCodedOkButton = KeyCode.Return;

        // Loading the background:
        _backgroundTexture = (Texture2D)Resources.Load( backgroundPath, typeof(Texture2D));

        // Loading the button Graphics and calculating the number of buttons seprate of states:
        listCount = buttonPathList.Length;
        _buttonTextureList = new List<Texture2D>();
        for( i = 0; i < listCount; i++ )
        {
            if( buttonPathList[i] != null )
                _buttonTextureList.Add( (Texture2D)Resources.Load( buttonPathList[i], typeof(Texture2D)) );
        }
        _numberOfButtons = ( _buttonTextureList.Count / GUIGlobals.numberOfButtonStates );

        // Setting the button positions:
        listCount = _numberOfButtons;
        _buttonRectList = new List<Rect>();
        for( i = 0; i < listCount; i++ )
        {
            // No need for null checking since we alerady know how many buttons there are.
            _buttonRectList.Add( buttonPositionList[i] );
        }

        // Grabing Game Object Refernces:
        //if( gameData == null )
            //gameData = GameObject.FindGameObjectWithTag("GameData").GetComponent<GameData>();

        if( menuGenerator == null && menuType != GUIGlobals.menuTypeDefs.PAUSE )
            menuGenerator = MenuGenerator.getInstance();

        // Setting Menu draw size and order:
        if( menuType == GUIGlobals.menuTypeDefs.PAUSE || menuType == GUIGlobals.menuTypeDefs.TROPHIES_WARNING || menuType == GUIGlobals.menuTypeDefs.SCORE_WARNING  )
        {
            MenuRectangle = new Rect( ( 1280 - _backgroundTexture.width ) / 2, ( 720 - _backgroundTexture.height ) / 2, _backgroundTexture.width, _backgroundTexture.height );
            guiDepth = 0;
        }
        else
        {
            MenuRectangle = new Rect( 0, 0, 1280, 720 );
            guiDepth = 1;
        }

        // Misc variables:
        bool overlay;

        // Calling the Initalize on the inheriting class:
        OnInitialize();
    }