예제 #1
0
 void Start()
 {
     snakeHead     = GameObject.FindGameObjectWithTag("snakeHead").GetComponent <snakeMovement>();
     speed         = snakeHead.speed * 4f * Time.deltaTime * 80;
     tailTargetObj = snakeHead.snakeBody[snakeHead.snakeBody.Count - 2];
     index         = snakeHead.snakeBody.IndexOf(gameObject);
 }
예제 #2
0
파일: GameOver.cs 프로젝트: mahwd/Worm3D
 public static void OnGameOver(snakeMovement snake)
 {
     hs = PlayerPrefs.GetFloat("HighScore", 0);
     if (hs < snake.score)
     {
         PlayerPrefs.SetFloat("HighScore", snake.score);
     }
     PlayerPrefs.SetFloat("score", snake.score);
     snake.score = 0;
     SceneManager.LoadScene("gameOver");
 }