//changing tabs in the achievement category public void ChangeCategory(GameObject button) { btnAch achievementButton = button.GetComponent <btnAch>(); //switching to the content of each tab scrollRect.content = achievementButton.achievementList.GetComponent <RectTransform>(); //changing through the tabs in the achievement panel achievementButton.Click(); activeButton.Click(); activeButton = achievementButton; }
// Use this for initialization void Start() { //setting what player is alive right now GameObject gameO = GameObject.Find("GameController"); GameController gameC = (GameController)gameO.GetComponent(typeof(GameController)); User currentPlayer = gameC.getCurrentPlayer(); // the actual player currentPlayerName = currentPlayer.GetUsername(); collectedChicks = currentPlayer.GetCollectables(); //setting achievement tab to be active activeButton = GameObject.Find("GenBtn").GetComponent <btnAch> (); //adding achievements to the achievement lists achList.Add(achievement1); achList.Add(achievement2); achList.Add(achievement3); //create the 3 achievements CreateAchievement("General", "Saved 10 Chickens", "Chicken Saviour", 5, 0, 0); CreateAchievement("General", "Saved 50 Chickens", "Chicken Saint", 5, 0, 1); CreateAchievement("General", "Saved 100 Chickens", "Chicken God", 10, 0, 2); //for the tabs activeButton.Click(); }