Learn Unity by Creating a 3D Multi-Level Platformer Gamethe next section, we'll keep track of the score of the player in an object we'll call GameManager, which will keep track of game-level information (score, high score, level). Currently, if you script and call it GameManager. The following code will help us keep track of the score. using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameManager : MonoBehaviour to repeat the steps we took when attaching the coin audio source to our player (creating a "gameManager" public property and dragging the "Game Manager" object to the player's Inspector)0 码力 | 60 页 | 2.24 MB | 1 年前3
Godot Game Development for BeginnersMake a Strategy Game in Godot - Part 2 Introduction Project Files Finishing the Map Script GameManager Script UI Script Connecting Everything Together Conclusion # How to Make Your First Game with [Image](/uploads/documents/e/d/0/b/ed0bd3539e4b327969717ceea42970e1/p190_1.jpg) GameManager Script The GameManager script is what's going to manage our resources and states. Go to the MainScene MainScene and select the MainScene node. Create a new script attached to it called GameManager. We can start with our variables. # current amount of each resource we have var curFood : int = 0 var curMetal : int0 码力 | 199 页 | 12.53 MB | 1 年前3
共 2 条
- 1













