// Use this for initialization void Start() { //PlayerPrefs.DeleteAll(); gc = FindObjectOfType <GameController>(); activeButton = GameObject.Find("GeneralBtn").GetComponent <AchievementButton>(); CreateAchievement("General", "Mission Started!", "You placed your satellite in hopes of rescue, will you make it?", 10, 0); CreateAchievement("General", "Making Upgrades!", "You're quite the engineer, Soldier! You upgraded your first turret!", 10, 0); CreateAchievement("General", "Spare Change?", "I see you're struggling to upkeep your defence? You sold your first turret!", 10, 0); CreateAchievement("Kills", "System Error!", "You sent you first scrap of metal back to the Junkyard. Good work, Soldier!", 10, 0); CreateAchievement("Kills", "System Crash!", "10 enemies defeated! You're really getting the hang of these Metalheads, huh?", 25, 1); CreateAchievement("Kills", "Blue Screen of Death!", "50 enemies down! When will you let up? You're a machine!", 50, 2); CreateAchievement("Kills", "System32 Deleted!", "100 enemies defeated! You're wiping their systems clean!", 100, 3); CreateAchievement("Money", "Pocket Money", "I see you're saving up for a big upgrade! Have $500 saved in your war effort.", 10, 0); CreateAchievement("Money", "Savings Account", "What are you planning on buying, Soldier!? Have $1000 saved in your account.", 25, 0); CreateAchievement("Money", "Retirement Fund", "We won't make it to retirement if you don't start spending that money! Have $2500 in your account.", 50, 0); CreateAchievement("Money", "Money Bags!", "Now you're just showing off your saving skills! Have $5000 saved in your account", 100, 0); CreateAchievement("Money", "Rothschild?", "How have you managed to penny pinch during this mechanical onslaught!? Have $10,000 saved in your account.", 500, 0); foreach (GameObject achievementList in GameObject.FindGameObjectsWithTag("AchievementList")) { achievementList.SetActive(false); } activeButton.Click(); gc.toggleAchievementMenu(); }
// Use this for initialization void Start () { // REMEMBER TO REMOVE PlayerPrefs.DeleteAll (); activeButton = GameObject.Find("GeneralBtn").GetComponent<AchievementButton> (); CreateAchievement ("General", "Death to them All!","Let all the Civillians die.",5,0); CreateAchievement ("General", "The Savior","Defeat Mercury before he devours any civillian.",5,0); CreateAchievement ("General", "Too Quick for You", "Defeat Mercury.", 5, 0); CreateAchievement ("General", "Quick as Lightning", "Obtain Mercury's Haste Skill.", 10, 0, new string[] { "Too Quick for You", "Death to them All!" }); CreateAchievement ("Dungeon","Err!", "Test!", 10,1); CreateAchievement ("Dungeon","Err2!", "Test!", 10,1); CreateAchievement ("Other","Err3!!", "Test!",10,2); CreateAchievement ("Other","Err4!!", "Test!", 10,2); CreateAchievement ("Other","Err!a!", "Test!", 10,2); foreach( GameObject achievementList in GameObject.FindGameObjectsWithTag("AchievementList")){ achievementList.SetActive(false); } activeButton.Click (); achievementMenu.SetActive (false); }
/// <summary> /// Pulls the achievements from player preferences, creates each one in the scene and adds the total points for display /// </summary> void Start() { FizzyoFramework.Instance.Load(); if (FizzyoFramework.Instance.Achievements == null || FizzyoFramework.Instance.Achievements.allAchievements == null) { return; } totalPoints = 0; GameObject text = GameObject.Find("Total"); Text total = text.GetComponent <Text>(); for (int i = 0; i < FizzyoFramework.Instance.Achievements.allAchievements.Length; i++) { AchievementData achievment = FizzyoFramework.Instance.Achievements.allAchievements[i]; if (!(catagories.Contains(achievment.category))) { Createcategory(achievment.category); } if (achievment.unlock == 1) { totalPoints += achievment.points; } CreateAch(achievment.category, achievment.title, achievment.description, achievment.points, achievment.unlock, achievment.unlockProgress, achievment.unlockRequirement); } foreach (GameObject achList in GameObject.FindGameObjectsWithTag("AchList")) { achList.SetActive(false); } if (active != null) { active.Click(); } total.text = "Total Achievement Points: " + totalPoints; }
public void ChangeCategory(GameObject button) { AchievementButton achievementButton = button.GetComponent <AchievementButton>(); scrollRect.content = achievementButton.achievementList.GetComponent <RectTransform>(); achievementButton.Click(); activeButton.Click(); activeButton = achievementButton; }
public void ChangeCategory(GameObject button) { AchievementButton achievementButton = button.GetComponent <AchievementButton>(); scrollRect.content = achievementButton.achievementList.GetComponent <RectTransform>(); //Sets the current scrollRect to show the clicked category achievementButton.Click(); activeButton.Click(); activeButton = achievementButton; //Sets the activeCategory so the game knows when another button is clicked, it should change category. }
/// <summary> /// Instantiates a new category button and category area for achievement display /// </summary> /// /// <param name="button"> /// GameObject which holds the button which is selected /// </param> public void Changecategory(GameObject button) { AchievementButton achButton = button.GetComponent <AchievementButton>(); // Changes scroll content on the main mask. Allows for scrolling of all categories scroll.content = achButton.achList.GetComponent <RectTransform>(); // Sets the active to false and the new button to true achButton.Click(); active.Click(); active = achButton; }
// Use this for initialization void Start() { //Debug.Log("started achievement manager"); notificationPanel = GameObject.Find("NotificationPanel").transform; //REMEMBER to Delete or Comment after game release //PlayerPrefs.DeleteAll(); //activeButon = GameObject.Find("GeneralButton").GetComponent<AchievementButton>(); //create achievements: category, title, description, points, sprite(can be added/dragged on scipt), (optional)script dependancies CreateAchievement("General", "Press W", "Press W to unlock", 5, 1, 0); CreateAchievement("General", "Press A", "Press A to unlock", 5, 1, 0); CreateAchievement("General", "Press S", "Press S to unlock", 5, 1, 0); CreateAchievement("General", "Press D", "Press D to unlock", 5, 1, 0); CreateAchievement("Other", "Get Moving", "all the movement keys", 10, 1, 0, new string[] { "Press W", "Press A", "Press S", "Press D" }); CreateAchievement("Other", "Press L", "Press L 3 times to unlock", 5, 1, 3); foreach (GameObject achievementList in GameObject.FindGameObjectsWithTag("AchievementList")) { achievementList.SetActive(false); } activeButon.Click(); achievementMenu.SetActive(false); }
void Start() { InitAchievements(); GameObject generalCategory = GameObject.Find("GeneralCategory"); generalCategory.GetComponent <Button>().Select(); activeButton = generalCategory.GetComponent <AchievementButton>(); foreach (GameObject achievementList in GameObject.FindGameObjectsWithTag("AchievementList")) { achievementList.SetActive(false); } activeButton.Click(); achieveMentPanel.SetActive(false); }
void Start() { // --- DEBUG OPTIONS --- PlayerPrefs.DeleteAll(); //PlayerPrefs.DeleteKey("Points"); activeButton = GameObject.Find("GeneralBtn").GetComponent <AchievementButton>(); CreateAchievement("General", "SPACE ! SPAAACE !", "Congratulations, you made your first jump !", 5, 0); CreateAchievement("General", "Press S", "S to rejoice.", 5, 0); CreateAchievement("General", "All keys", "All keys to rejoice.", 10, 0, new string[] { "SPACE ! SPAAACE !", "Press S" }); foreach (GameObject achievementList in GameObject.FindGameObjectsWithTag("AchievementList")) { achievementList.SetActive(false); } activeButton.Click(); achievementMenu.SetActive(false); }
// Use this for initialization void Start() { //Comment out when in need of saving data PlayerPrefs.DeleteAll(); //delete all the saved data activeButton = GameObject.Find("GeneralBtn").GetComponent <AchievementButton>(); createAchievment("General", "Keep the doctor away", "Collect 25 Apples", 10, 1, 0); //Call this function to generate an achievment createAchievment("General", "Press S", "Press S to Unlock", 5, 2, 0); createAchievment("General", "Press W", "Press W to Unlock", 5, 3, 0); createAchievment("General", "Key Master", "Press all keys to Unlock", 20, 0, 0, new string[] { "Press S", "Press W" }); createAchievment("General", "Press X", "Press X 3 times to Unlock", 5, 7, 3); foreach (GameObject achievmentList in GameObject.FindGameObjectsWithTag("AchievmentList")) { achievmentList.SetActive(false); achievmentMenu.SetActive(false); } activeButton.Click(); }
// Use this for initialization void Start() { //THIS DELETES ALL SAVED PROGRESS BY A PLAYER(S) PlayerPrefs.DeleteAll(); activeButton = GameObject.Find("GeneralBtn").GetComponent <AchievementButton>(); CreateAchievement("General", "Apple Apprentice", "Pick up 10 Apples", 5, 0); CreateAchievement("General", "Apple Padawan", "Pick up 50 Apples", 15, 0); CreateAchievement("General", "Apple Master", "Pick up 100 Apples", 25, 0); CreateAchievement("General", "Johnny Appleseed", "Pick up 150 Apples", 50, 0); CreateAchievement("General", "Beginning Student", "Answer 5 Questions Correctly", 5, 0); CreateAchievement("General", "Studious", "Answer 25 Questions Correctly", 15, 0); CreateAchievement("General", "Master", "Answer 75 Questions Correctly", 25, 0); CreateAchievement("General", "Brain Boss", "Answer 100 Questions Correctly", 40, 0); CreateAchievement("General", "Living Encyclopedia", "Answer 150 Questions Correctly", 75, 0); CreateAchievement("General", "King of Games", "Beat the Developer's best time on Hard", 100, 0); //CreateAchievement("General", "Press W", "Press W to unlock this achievement", 5, 0); //CreateAchievement("General", "Press S", "Press S to unlock this achievement", 5, 0); CreateAchievement("General", "Do a Race", "Complete 1 race to unlock this achievement", 5, 0); CreateAchievement("General", "Do 2 Races", "Complete 2 races to unlock this achievement", 15, 0); //CreateAchievement("General", "All Keys", "Press all keys to unlock", 10, 0, new string[] { "Press W", "Press S" }); foreach (GameObject achievementList in GameObject.FindGameObjectsWithTag("AchievementList")) { achievementList.SetActive(false); } activeButton.Click(); achievementMenu.SetActive(false); }