Resume









How do I use Resume
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: GameManagerScript.cs Copy
63  public void resumeGame () {
64   pausePanel.SetActive (false);
65   scoreText.text = "Score: " + PlayerMoveScript.instance.scoreCount;
66   Time.timeScale = 1f;
67  }
File name: GameplayController.cs Copy
233  public void ResumeButton(){
234   pausePanel.SetActive (false);
235   Time.timeScale = 1;
236   gameInProgress = true;
237  }
File name: UIgame.cs Copy
100     public void Pause_btn()
101     {
102         if (SystemScr.paused)
103         {
104             Resume_btn();
105         }
106         else
107         {
108             sounds.PlaySoundsUI(false);
109
110             SystemScr.Pause(true);
111             GameScreen.SetActive(false);
112             PauseScreen.SetActive(true);
113         }
114     }
File name: UIgame.cs Copy
116     public void Resume_btn()
117     {
118         sounds.PlaySoundsUI(false);
119
120         SystemScr.Pause(false);
121         GameScreen.SetActive(true);
122         PauseScreen.SetActive(false);
123         OptionsScreen.SetActive(false);
124     }
File name: GameplayController.cs Copy
275  public void ResumeGame(){
276   Time.timeScale = 1;
277   gameInProgress = true;
278   pausePanel.SetActive (false);
279  }
File name: PauseLayerClickListener.cs Copy
29         public override void OnTouchUp()
30         {
31             if (InputController.Name != InputNames.DIALOG) return;
32             base.OnTouchUp();
33             switch (buttonIndex)
34             {
35                 case 0://music
36                     SoundManager.isMusic = !SoundManager.isMusic;
37                     pauseLayer.changeSprite(0, SoundManager.isMusic);
38                     break;
39                 case 1://sound
40                     SoundManager.isSound = !SoundManager.isSound;
41                     pauseLayer.changeSprite(1, SoundManager.isSound);
42                     break;
43                 case 2://help
44
45                     pauseLayer.gameObject.SetActive(false);
46                     gameScreen.guideGame();
47
48                     break;
49                 case 3://resume
50                     gameScreen.resumeGame();
51                     break;
52                 case 4://restart
53                     Application.LoadLevel("GameScreen");
54                     break;
55                 case 5://menu
56                     Application.LoadLevel("MapScreen");
57                     SoundManager.LoadBgMusic("Sounds/menu", true);
58                     break;
59             }
60         }
File name: CounterLayer.cs Copy
22         public void Update()
23         {
24             stateTime += Time.deltaTime;
25             if (isFinish)
26             {
27                 if (stateTime >= 0.1f)
28                 {
29                     //play game
30                     gameScreen.resumeGame();
31                     InputController.Name = InputNames.GAMESCREEN;
32                     Destroy(gameObject);
33                     SoundManager.LoadBgMusic("Sounds/bg1", true);
34                 }
35             }else if (stateTime >= 1)
36             {
37                 stateTime = 0;
38                 numberObject.GetComponent().sprite = numbers[number];
39                 number++;
40                 if (number >= 3)
41                     isFinish = true;
42             }
43         }
File name: GameScreen.cs Copy
379         public void LateUpdate()
380         {
381             if (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space))
382             {
383                 if (InputController.Name == InputNames.GAMESCREEN)
384                 {
385                     if (InputController.IsScreen)
386                     {
387                         if(Time.timeScale != 0)
388                             animals.getAnimal(0).GetComponent().Jump();
389                         //createBuiTien(-1.2f, 1f);
390                     }
391                 }
392             }
393             else if (Input.GetMouseButtonUp(0))
394             {
395                 InputController.IsScreen = true;
396             }
397             if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Backspace))
398             {
399                 if (!isPrepare)
400                 {
401                     if (dialog != null && dialog.activeSelf && InputController.Name == InputNames.DIALOG)
402                     {
403                         dialog.GetComponent().hideDialog();
404                         pauseLayer.SetActive(true);
405                     }else if (InputController.Name == InputNames.GAMESCREEN)
406                     {
407                         pauseGame();
408                         dialog.GetComponent().showDialog();
409                         pauseLayer.SetActive(false);
410                     }
411                     else if (pauseLayer.activeSelf)
412                     {
413                         resumeGame();
414                     }
415                 }
416             }
417             if (isPrepare)
418             {
419                 isPrepare = false;
420
421                 buttonSkills.setFonts(shopFont);
422                 prepareGame();
423             }
424         }
File name: GameScreen.cs Copy
539         public void resumeGame()
540         {
541             InputController.Name = InputNames.GAMESCREEN;
542             animals.setRunning(true);
543             pauseLayer.SetActive(false);
544             background.setRuning(true);
545             isRunning = true;
546             revivalTask.setRunning(true);
547             setAnimationRunning(true);
548             setBulletRunning(true);
549             SoundManager.ResumeMusic("Sounds/bg1");
550         }
File name: GameManager.cs Copy
61     public void ResumeGame() {
62         Time.timeScale = 1f;
63         pausePanel.SetActive(false);
64     }

Resume 118 lượt xem

Gõ tìm kiếm nhanh...