Ejemplo n.º 1
0
    /// <summary>
    /// Awake this instance.
    /// </summary>
    void Awake()
    {
        stingPlayer = GameObject.FindGameObjectWithTag("GameTools").GetComponent <StingPlayer>();


        //  gets the panels and displays them for the main menu
        instanceItem  = Toolbox.Instance;
        currentState  = MENU_STATES.START;
        selectedItem  = 0;
        mainMenuItems = mainMenuPanels.GetComponentsInChildren <Button> ();

        mainMenuItems [0].Select();

        saveFilesItems = loadGamePanels.GetComponentsInChildren <Button> (true);

        //skipLoadGame = SaveLoad.isAnySavedGame ();

        // load our current save load
        SaveLoad.Load();

        // load saved games
        SaveLoad.CreatedSavedGamesArray();

        // now, if we already have games, we also want to display them differently.
        // so let's do that
        updateGamePanel();
    }
Ejemplo n.º 2
0
    public WaitingForTime waitingObject;     // object to pause the game for something



    /// <summary>
    /// Start this instance.
    ///
    /// This just runs a loop that we only need to run once before we destroy the object.
    /// The Menu comes and goes and waits for input and gives options and highlights and
    /// then does commands based on inputit
    /// </summary>
    public IEnumerator Start()
    {
        // when we start, we want to have game tools initialized and some music sounds
        stingPlayer     = GameObject.FindGameObjectWithTag("GameTools").GetComponent <StingPlayer>();
        GUIdisplayItems = GameObject.FindGameObjectWithTag("GameTools").GetComponent <GUIDisplayItems>();


        if (optionsBox != null)
        {
            yield return(StartCoroutine(Initialize()));
        }

        hasAccepted = false;
    }