void Awake() { current = 0; smu = GetComponent <SimultaneousUpdater>(); cm = GetComponent <CoinMultiplier>(); scl = timerBar.GetComponent <BasicImageScalar>(); }
public void Die() { //add coins to player GameObject coins = (GameObject)Instantiate(Resources.Load("CoinDrop")); // position coins.transform.position = transform.position; // coins coins.GetComponent <CoinComponent>().Coins = goldDrop; dead = true; // Die sound eac.PlayDie(); // boom Destroy(gameObject); // Increment multiplier. GameObject controller = GameObject.FindGameObjectsWithTag("Controller")[0]; if (controller != null) { CoinMultiplier cm = controller.GetComponent <CoinMultiplier>(); cm.AddMult(); } }
// Use this for initialization void Awake() { gm = GetComponent <GridMovement>(); smu = updater.GetComponent <SimultaneousUpdater>(); wt = updater.GetComponent <WorldTimer>(); pcc = GetComponent <PlayerCoinController>(); wcm = updater.GetComponent <CoinMultiplier>(); gst = GetComponentInChildren <GridSpriteTranslate>(); anim = body.GetComponent <Animator>(); anim_head = head.GetComponent <Animator>(); eac = GetComponent <EntityAudioController>(); }
public void DealDamage(int dmg) { // Recalculate health and UI health -= dmg; redrawUIHearts(); eac.PlayHurt(); if (health <= 0) { loseGame(); } GameObject controller = GameObject.FindGameObjectsWithTag("Controller")[0]; if (controller != null) { CoinMultiplier cm = controller.GetComponent <CoinMultiplier>(); cm.Reset(); } }