private void Start() { jumping = GetComponent <AudioSource>(); GM = GameObject.FindWithTag("GameManager").GetComponent <GameManagerEndless>(); _rigidBody = GetComponent <Rigidbody2D>(); Anim = GetComponent <Animator>(); //soundCenter = GetComponent<PlayerSoundController>(); _upgradeCenter = UpgradeCenter.GetInstance(); }
private void SetContent() { if (HighScoreIndex >= indexOfFirst && HighScoreIndex < indexOfFirst + 3) { SetMultiplyPoints(HighScoreIndex - indexOfFirst, UpgradeCenter.GetInstance().GetValue(UpgradeCenter.MultiplyPointsValue)); HS.transform.localScale = new Vector3(1, 1, 1); } else { HS.transform.localScale = new Vector3(0, 0, 0); } if (JetpackIndex >= indexOfFirst && JetpackIndex < indexOfFirst + 3) { SetJetpack(JetpackIndex - indexOfFirst, UpgradeCenter.GetInstance().GetValue(UpgradeCenter.JetpackDuration)); JP.transform.localScale = new Vector3(1, 1, 1); } else { JP.transform.localScale = new Vector3(0, 0, 0); } if (HooverIndex >= indexOfFirst && HooverIndex < indexOfFirst + 3) { SetHoover(HooverIndex - indexOfFirst, UpgradeCenter.GetInstance().GetValue(UpgradeCenter.HooverDuration)); HV.transform.localScale = new Vector3(1, 1, 1); } else { HV.transform.localScale = new Vector3(0, 0, 0); } if (HighJumpIndex >= indexOfFirst && HighJumpIndex < indexOfFirst + 3) { SetHighJump(HighJumpIndex - indexOfFirst, UpgradeCenter.GetInstance().GetValue(UpgradeCenter.HighJumpDuration)); HJ.transform.localScale = new Vector3(1, 1, 1); } else { HJ.transform.localScale = new Vector3(0, 0, 0); } if (FreezeIndex >= indexOfFirst && FreezeIndex < indexOfFirst + 3) { SetFreeze(FreezeIndex - indexOfFirst, UpgradeCenter.GetInstance().GetValue(UpgradeCenter.FreezeDuration)); FZ.transform.localScale = new Vector3(1, 1, 1); } else { FZ.transform.localScale = new Vector3(0, 0, 0); } UpdateMoney(); }