本文整理汇总了C#中GameManager类的典型用法代码示例。如果您正苦于以下问题:C# GameManager类的具体用法?C# GameManager怎么用?C# GameManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GameManager类属于命名空间,在下文中一共展示了GameManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start () {
root = GameObject.Find("UI Root");
gm = GameObject.Find("GameManager").GetComponent<GameManager>();
nameLabel = root.transform.Find("Avg_Panel/Label_Name").GetComponent<UILabel>();
dialogLabel = root.transform.Find("Avg_Panel/Label_Dialog").GetComponent<UILabel>();
nameLabel.fontSize = 22;
}
示例2: Start
void Start()
{
tParent = transform.parent;
networkView = tParent.GetComponent <NetworkView>();
gameObject.SetActive(networkView.isMine);
gm = GameManager.Instance;
}
示例3: Init
private void Init(){
this.gameManager = GameObject.Find ("GameManager").GetComponent<GameManager> ();
this.player = GameObject.Find ("Player").GetComponent<PlayerScript> ();
this.enemy = GameObject.Find ("Enemy").GetComponent<EnemyScript> ();
this.mPlayerShieldHP = Constants.ShieldPoint;
this.mEnemyShieldHP = Constants.ShieldPoint;
}
示例4: Start
// Use this for initialization
void Start()
{
PlayerCam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>(); // Find the Camera's GameObject from its tag
_GameManager = gameObject.GetComponent<GameManager>();
_player1AI = _GameManager.player1AI;
_player2AI = _GameManager.player2AI;
}
示例5: Update
// Update is called once per frame
void Update()
{
if (gManager == null) {
gManager=GameManager.Instance();
}
//Debug.Log (interactions.getIsGrabbed());
if (gManager.currentLevel != GameManager.LevelStatus.planting) {
gameObject.SetActive(false);
}
Debug.Log (this.name + " " + interactions.getIsGrabbed ());
if (interactions.getIsGrabbed()&&!downTime&&!gManager.isHandGrabbing())
{
//Debug.Log("I have seeds");
GameObject newObject;
newObject= (GameObject)(Instantiate(thisIsABagOf,interactions.getCursorPosition(), Quaternion.identity));
newObject.SendMessage("SetGrabbed", SendMessageOptions.DontRequireReceiver);
downTime= true;
someTime= Time.time;
}
if (!interactions.getIsGrabbed()&&downTime&&(Time.time-someTime)>1)
{
downTime= false;
}
}
示例6: Initialize
public void Initialize(float speed, GameObject player, GameManager manager)
{
SetSpeed (speed);
this.player = player;
this.manager = manager;
scored = false;
}
示例7: Start
// Use this for initialization
void Start()
{
if (GameObject.Find("GameManager"))
{
gameManager = GameObject.Find("GameManager").GetComponent<GameManager>();
}
}
示例8: OnEnable
void OnEnable()
{
if (gm == null)
{
gm = GameObject.FindGameObjectWithTag("GM").GetComponent<GameManager>();
}
}
示例9: CreateScorePanel
private void CreateScorePanel(GameManager.LevelScore levelScore)
{
var spi = Instantiate(ScorePanelItemPrefab);
spi.GetComponentInChildren<Text>().text = string.Format("Level {0}{3}Score: {1}{3}Faults: {4}{3}{2}",
levelScore.LevelNumber, levelScore.Score, levelScore.Time.Minutes+"m " + levelScore.Time.Seconds + "s " + levelScore.Time.Milliseconds + "ms", Environment.NewLine, levelScore.Faults);
spi.transform.SetParent(ScoresPanel);
}
示例10: TileMapData
// tile map
public TileMapData(int x_size, int y_size)
{
this.size_x = x_size;
this.size_y = y_size;
map_tiles = new DTile[size_x, size_y];
// gameManager Stuff
go = GameObject.Find("GameManager(Clone)");
gameManagerScript = go.GetComponent<GameManager>();
// Debug.Log("ITs not null");
// Construct Data map with Tiles from XML
// Example without XML
for (int x = 0; x < size_x; x++)
{
for (int y = 0; y < size_y; y++)
{
map_tiles[x, y] = new DBuildTile(x, y);
}
}
if (gameManagerScript.getWaypoints() != null) {
List<Vector2> wayPointsList = gameManagerScript.getWaypoints();
// add path to tile
// Debug.Log("Starting Pathing");
int mini;
int maxi;
for (int i = 0; i < wayPointsList.Count - 1; i++)
{
Vector2 current = wayPointsList[i];
Vector2 next = wayPointsList[i + 1];
// vertical
if (current.x == next.x)
{
// loop from start to next mark path tile
int x = (int)current.x;
mini = Mathf.Min((int)current.y, (int)next.y);
maxi = Mathf.Max((int)current.y, (int)next.y);
for (int y = mini; y < maxi + 1; y++)
{
map_tiles[x, y] = new DWalkableTile(x, y);
}
}
// horizontal
else {
int y = (int)current.y;
mini = Mathf.Min((int)current.x, (int)next.x);
maxi = Mathf.Max((int)current.x, (int)next.x);
// loop from start to next mark
for (int x = mini; x < maxi + 1; x++)
{
map_tiles[x, y] = new DWalkableTile(x, y);
}
}
}
}
}
示例11: Awake
void Awake ()
{
onFire = false;
announcerAudio = GetComponents<AudioSource> () [1];
playerAttack = GetComponent<PlayerAttack> ();
canvas = GameObject.Find ("HUDCanvas");
//Debug.Log ("PlayerHealthUI_" + playerAttack.playerNum);
inGameHealthUI = canvas.GetComponent<RectTransform> ().Find ("PlayerHealthUI_" + playerAttack.playerNum)
.GetComponent<InGameHealthUI>();
inGameHealthUI.playerHealth = this;
rigid = GetComponent<Rigidbody> ();
gm = GameObject.Find ("GameManager").GetComponent<GameManager> ();
uim = GameObject.Find ("GameManager").GetComponent<UI_Manager> ();
joystickNum = playerAttack.joystickNum;
damageReduction = 1;
allgrounds = GameObject.FindGameObjectsWithTag("Island");
anim = GetComponent <Animation> ();
playerAudio = GetComponent <AudioSource> ();
playerMovement = GetComponent <PlayerMovement> ();
//playerShooting = GetComponentInChildren <PlayerShooting> ();
currentHealth = startingHealth;
SetupHealthUI ();
}
示例12: Start
// Use this for initialization
void Start()
{
gm = FindObjectOfType<GameManager>();
rigidbody = GetComponent<Rigidbody2D>();
ResetBall();
}
示例13: Start
// Use this for initialization
void Start()
{
SilhouetteBG = gameObject.transform.GetChild(0).GetComponent<RectTransform>();
Boat = GameObject.Find("Boat");
mGame = GameObject.FindGameObjectWithTag("Manager").GetComponent<GameManager>();
//SilhouetteCanvas = SilhouetteCanvasObj.GetComponent<
}
示例14: MultiplayerRaceMode
public MultiplayerRaceMode(GameManager gameInstance, int laps, int noOfCheckpoints, RaceTrack raceTrack, Car localCar)
: base(gameInstance, laps, noOfCheckpoints, raceTrack, localCar)
{
this.Mode = Mode.Multiplayer;
players.AddRange(gameInstance.GetService<ServerClient>().Players.Values);
AddLapTriggers();
}
示例15: Start
/// <summary>
/// Inicia o jogador
/// </summary>
void Start()
{
playerPhysics = GetComponent<PlayerPhysics>();
animator = GetComponent<Animator>();
manager = Camera.main.GetComponent<GameManager>();
animator.SetLayerWeight(0, 0);
}