private void Awake() { if (DeviceInfo.IsDesktop) { this.m_PrizeProbability = this.m_PrizeProbabilityDesktop; } this.m_scrollList = this.m_menu.transform.Find("ScrollList").GetComponent <ScrollList>(); this.m_scrollList.SetListener(this); this.m_hudCam = Singleton <GuiManager> .Instance.FindCamera(); this.m_mainCam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); this.m_kingPig = (UnityEngine.Object.FindObjectOfType(typeof(KingPig)) as KingPig).gameObject; CapsuleCollider component = GameObject.FindGameObjectWithTag("KingPigMouth").GetComponent <CapsuleCollider>(); component.enabled = true; this.m_CurGrowScale = GameProgress.GetFloat("KingPigFeedScale", this.m_InitialScale, GameProgress.Location.Local, null); this.m_kingPig.transform.parent.localScale = this.m_CurGrowScale * Vector3.one; int value = Singleton <GameConfigurationManager> .Instance.GetValue <int>("king_pig_prize_probabilities", "Prize"); if (value > 0) { this.m_PrizeProbability = (float)value / 100f; } float num = 0f; List <FeedingPrize> list; if (Singleton <BuildCustomizationLoader> .Instance.IsChina) { list = this.m_FeedingPrizesChina; } else if (Singleton <BuildCustomizationLoader> .Instance.IsOdyssey) { list = this.m_FeedingPrizesOdyssey; } else { list = this.m_FeedingPrizes; } foreach (FeedingPrize feedingPrize in list) { int value2 = Singleton <GameConfigurationManager> .Instance.GetValue <int>("king_pig_prize_probabilities", feedingPrize.type.ToString()); if (value2 > 0) { feedingPrize.rangeWidth = (float)value2; } num += feedingPrize.rangeWidth; } this.m_totalRangeWidth = num; ScrapButton.Instance.EnableButton(false); }
private void Start() { this.m_traveledDistance = GameProgress.GetFloat("traveledDistance", 0f, GameProgress.Location.Local, null); this.m_rolledDistance = GameProgress.GetFloat("rolledDistance", 0f, GameProgress.Location.Local, null); }