public void UpdateScorePasser() { ScorePasser scorePasser = GameObject.Find("ScorePasser").GetComponent <ScorePasser>(); scorePasser.killCounterBandits = killCounterBandits; scorePasser.killCounterGunslingers = killCounterGunslingers; scorePasser.killCounterScorpions = killCounterScorpions; scorePasser.killCounterSnakes = killCounterSnakes; }
public new void die() { base.die(); GameObject.Find("MultiplierManager").GetComponent <MultiplierManager>().hitColoredBuilding(color); Transform prefab; float spawnX, spawnY; float spawnX2, spawnY2; if (Random.value > .5) { prefab = greenPeoplePrefab; spawnX = transform.position.x + greenPeopleOffset.x; spawnY = transform.position.y + greenPeopleOffset.y; spawnX2 = transform.position.x + greenPeopleOffset.x; spawnY2 = transform.position.y - greenPeopleOffset.y; } else { prefab = purplePeoplePrefab; spawnX = transform.position.x + purplePeopleOffset.x; spawnY = transform.position.y + purplePeopleOffset.y; spawnX2 = transform.position.x + purplePeopleOffset.x; spawnY2 = transform.position.y - purplePeopleOffset.y; } TransformFactory.make2dTransform(prefab, new Vector2(spawnX, spawnY), transform); Transform t2 = TransformFactory.make2dTransform(prefab, new Vector2(spawnX2, spawnY2), transform); t2.position = new Vector3(t2.position.x, t2.position.y, t2.position.z - .1f); t2.Rotate(new Vector3(0, 180, 180)); // up sass count for end screen ScorePasser sp = GameObject.Find("ScorePasser").GetComponent <ScorePasser>(); switch (color) { case Colors.Blue: sp.upOneBlue(); break; case Colors.Red: sp.upOneRed(); break; case Colors.Orange: sp.upOneOrange(); break; case Colors.Green: sp.upOneGreen(); break; } }
private void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
void Start() { scorePasser = GameObject.FindObjectOfType <ScorePasser>(); levelPasser = GameObject.FindObjectOfType <LevelPasser>(); banditScore.text = "Bandits Killed: " + scorePasser.killCounterBandits.ToString(); gsScore.text = "GunSlingers Killed: " + scorePasser.killCounterGunslingers.ToString(); snakeScore.text = "Snakes Killed: " + scorePasser.killCounterSnakes.ToString(); scorpionScore.text = "Scorpions Killed: " + scorePasser.killCounterScorpions.ToString(); floor.text = "Floor " + levelPasser.floor.ToString(); }
// Use this for initialization void Start() { ScorePasser sp = GameObject.Find("ScorePasser").GetComponent <ScorePasser> (); int totalScore = sp.getTotalScore(); int totalCombos = sp.getTotalCombos(); int redSass = sp.getRedSass(); int greenSass = sp.getGreenSass(); int orangeSass = sp.getOrangeSass(); int blueSass = sp.getBlueSass(); GameObject.Find("TotalScore").GetComponent <Text> ().text = "" + totalScore; GameObject.Find("TotalCombos").GetComponent <Text> ().text = "" + totalCombos; GameObject.Find("RedSass").GetComponent <Text> ().text = "" + redSass; GameObject.Find("GreenSass").GetComponent <Text> ().text = "" + greenSass; GameObject.Find("OrangeSass").GetComponent <Text> ().text = "" + orangeSass; GameObject.Find("BlueSass").GetComponent <Text> ().text = "" + blueSass; }
protected override void OnNavigatedTo(NavigationEventArgs e) { Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += GameOver_BackRequested; // Get the data fro ScorePasser scoreResult = e.Parameter as ScorePasser; scoreManagerVM = new ScoreManagerViewModel(); //Assign variables from ScorePasser to local variables int difficulty = scoreResult.difficulty; int score = scoreResult.score; int highScore = scoreResult.highScore; //Check if the new score is greater than the current highscore if (score > highScore) { //If so then replace the highscore with the current score scoreManagerVM.Add(difficulty, score); } //Display the players score to the Score textbox Score.Text = scoreResult.score.ToString(); }