public void ResetCounter() { count = 0; maxCount = 0; //set up buttons upButton.onClick.RemoveAllListeners(); downButton.onClick.RemoveAllListeners(); acceptButton.onClick.RemoveAllListeners(); upButton.onClick.AddListener(IncreaseCount); downButton.onClick.AddListener(DecreaseCount); acceptButton.onClick.AddListener(AcceptDeal); //get max if (pm == null) { pm = PlayerManager.instance; } Lord currentLord = pm.currentLord; maxCount = currentLord.GetMaxRecruit(); armiesRecruited.text = 0.ToString(); wealthAfterExpand.text = currentLord.GetWealth().ToString(); homelessSoldiers.text = pm.currentLord.NumberLandlessSoldiers(count + pm.currentLord.GetArmies()).ToString(); }
public void ResetCounter() { count = 0; maxCount = 0; //set up buttons upButton.onClick.RemoveAllListeners(); downButton.onClick.RemoveAllListeners(); acceptButton.onClick.RemoveAllListeners(); upButton.onClick.AddListener(IncreaseCount); downButton.onClick.AddListener(DecreaseCount); acceptButton.onClick.AddListener(AcceptDeal); //get max if (pm == null) { pm = PlayerManager.instance; } Lord currentLord = pm.currentLord; switch (counterType) { case UICounterType.Recruit: maxCount = currentLord.GetMaxRecruit(); break; case UICounterType.Expand: maxCount = currentLord.GetMaxExpand(); break; case UICounterType.Attack: maxCount = currentLord.GetArmies(); break; } playerResourceText.text = 0.ToString(); Debug.Log("Max Count1: " + maxCount); }