Resets









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

Featured Snippets


File name: RPGMovement.cs Copy
30     void Update()
31     {
32         if( m_PhotonView.isMine == true )
33         {
34             ResetSpeedValues();
35
36             UpdateRotateMovement();
37
38             UpdateForwardMovement();
39             UpdateBackwardMovement();
40             UpdateStrafeMovement();
41
42             MoveCharacterController();
43             ApplyGravityToCharacterController();
44
45             ApplySynchronizedValues();
46         }
47
48         UpdateAnimation();
49     }
File name: RPGMovement.cs Copy
85     void ResetSpeedValues()
86     {
87         m_CurrentMovement = Vector3.zero;
88         m_CurrentTurnSpeed = 0;
89     }
File name: GameManager.cs Copy
341  public static void ResetScores() {
342   PlayerPrefs.DeleteKey(PLAYER_WHITE);
343   PlayerPrefs.DeleteKey(PLAYER_BLACK);
344   PlayerPrefs.DeleteKey(GAME_CURRENT);
345  }
File name: SliderValueScore.cs Copy
20  public void OnValueChanged() {
21   int value = ((int)slider.value);
22   sliderText.text = value.ToString();
23
24   PlayerPrefs.SetInt(GameManager.SCORE_MAX, value);
25
26   int maxGame = value * 2 - 1;
27   PlayerPrefs.SetInt(GameManager.GAME_MAX, maxGame);
28
29   if (init) {
30    GameManager.ResetScores();
31   }
32  }
File name: WinManager.cs Copy
27  public void LoadScores() {
28   int white = PlayerPrefs.GetInt(GameManager.PLAYER_WHITE,0);
29   int black = PlayerPrefs.GetInt(GameManager.PLAYER_BLACK,0);
30   whiteScoreText.text = "White: " + white.ToString();
31   blackScoreText.text = "Black: " + black.ToString();
32
33   if (white > black) {
34    winnerText.text = "WHITE";
35   } else if (white < black) {
36    winnerText.text = "BLACK";
37   } else {
38    winnerText.text = "NO ONE";
39   }
40   int maxGames = PlayerPrefs.GetInt(GameManager.GAME_MAX,0);
41   maxGamesText.text = "OUT OF " + maxGames + " GAMES";
42   GameManager.ResetScores();
43  }
File name: Info.cs Copy
19  void Update () {
20         resetSprite();
21
22         if (!isVisible)
23         {
24             isVisible = true;
25             gameObject.SetActive(true);
26         }
27  }
File name: Info.cs Copy
29     private void resetSprite()
30     {
31         gameObject.GetComponent().sprite = Sprite.Create(texture, rect, Vector2.zero);
32         dis = 100 * Time.deltaTime;
33         rect.y -= dis;
34
35         updateRect();
36     }

Download file with original file name:Resets

Resets 109 lượt xem

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