コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        bool pause = Input.GetKeyDown(KeyCode.Joystick1Button9) || Input.GetKeyDown(KeyCode.Joystick1Button9) || Input.GetKeyDown(KeyCode.Delete);

        if (pause && gm.isPaused())
        {
            if (Time.unscaledTime > nextPause)
            {
                Debug.Log("UNPAUSE");
                gm.setCurrentMode(GameModeManager.Mode.RUNNING);
//				music.UnPause ();
                HideMenus();
                Time.timeScale = 1;
                nextPause      = Time.unscaledTime + pauseRate;
            }
        }
        else if (!gm.isPaused() && pause)
        {
            Debug.Log("PAUSE!");
            if (Time.unscaledTime > nextPause)
            {
                gm.setCurrentMode(GameModeManager.Mode.PAUSED);
//				music.Pause ();
                ShowSelectedMenu();
                Time.timeScale = 0;
                nextPause      = Time.unscaledTime + pauseRate;
            }
        }
        else if (gm.isPaused() && !pause)
        {
            Debug.Log("Paused");
            ShowSelectedMenu();
        }
    }
コード例 #2
0
 // Update is called once per frame
 void Update()
 {
     if (gm.isPaused() && Input.GetKeyDown(KeyCode.Joystick1Button13) && pm.currentMenu == PauseMenuManager.Menu.INFO)
     {
         Debug.Log("We're skipping INFO for some reason");
         pm.getPrevState();
     }
     if (gm.isPaused() && Input.GetKeyDown(KeyCode.Joystick1Button14) && pm.currentMenu == PauseMenuManager.Menu.INFO)
     {
         Debug.Log("We're skipping INFO for some reason");
         pm.getNextState();
     }
     PanelSelection();
     ProcessAction();
     resourceALabel.text   = rm.ResourceA.ToString();
     resourceBLabel.text   = rm.ResourceB.ToString();
     resourceCLabel.text   = rm.ResourceC.ToString();
     resourceDLabel.text   = rm.ResourceD.ToString();
     resourceGLabel.text   = rm.Gold.ToString();
     refinedALabel.text    = rm.RefinedA.ToString();
     refinedBLabel.text    = rm.RefinedB.ToString();
     refinedCLabel.text    = rm.RefinedC.ToString();
     refinedDLabel.text    = rm.RefinedD.ToString();
     minerALabel.text      = rm.MinerA.ToString();
     minerBLabel.text      = rm.MinerB.ToString();
     minerCLabel.text      = rm.MinerC.ToString();
     minerDLabel.text      = rm.MinerD.ToString();
     inventory.text        = rm.WIDGET_INVENTORY.ToString();
     generators.text       = rm.GENERATORS.ToString();
     generatorE.text       = rm.POWER_EFFICIENCY.ToString();
     marketing.text        = rm.MARKETING_LEVEL.ToString();
     demand.text           = rm.DEMAND.ToString();
     price.text            = rm.BASE_PRICE.ToString();
     factories.text        = rm.FACTORIES.ToString();
     factoryY.text         = rm.PRODUCTION_BASE_YIELD.ToString();
     factoryE.text         = rm.PRODUCTION_EFFICIENCY.ToString();
     refineries.text       = rm.REFINERIES.ToString();
     refineryE.text        = rm.REFINERY_EFFICIENCY.ToString();
     refineryY.text        = rm.REFINE_BASE_YIELD.ToString();
     distribution.text     = rm.DISTRIBUTION_FORCE.ToString();
     workforce.text        = rm.WORKFORCE.ToString();
     crypto.text           = rm.CRYPTO.ToString();
     nodes.text            = rm.CRYPTO_NODES.ToString();
     cryptoDifficulty.text = rm.CRYPTO_DIFFICULTY.ToString();
 }