private void Awake() { _soundManager = FindObjectOfType <SoundManager>(); _gamplayHud = FindObjectOfType <GamplayHUD>(); _scoreTracking = FindObjectOfType <ScoreTracking>(); _timeScaleZero = FindObjectOfType <TimeScaleZero>(); }
//When the player picks up a coin, update the how many you have, play a sound and destroy the coin private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { _soundManager.Play("Coin"); _scoreTracking = FindObjectOfType <ScoreTracking>(); _scoreTracking.AddToCoinsPickedUp(coinValue); _scoreTracking.AddToScore(500); Destroy(gameObject); } }
// Start is called before the first frame update protected virtual void Awake() { baseRenderer = gameObject.GetComponent <SpriteRenderer>(); fluidRenderer = transform.Find("Fluid").GetComponent <SpriteRenderer>(); uiMan = GameObject.Find("uiMan").GetComponent <ScoreTracking>(); if (fluids == null) { const int MAX_ID = 3; fluids = new Dictionary <int, Sprite[]>(); for (int i = 1; i <= MAX_ID; i++) { fluids.Add(i, Resources.LoadAll <Sprite>("Fluids/" + i.ToString())); } } }
public ActionResult Create([Bind(Include = "Id,Title,Body,OwnerId")] Question question) { if (ModelState.IsValid) { var OwnerId = User.Identity.GetUserId(); //Create Question question.Created = DateTime.Now; question.OwnerId = OwnerId; db.Questions.Add(question); db.SaveChanges(); //Add to Score and Log Event ScoreTracking.QCreate(OwnerId); } return(View(question)); }