// 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(); }
/// <summary> /// Instantiates a new category button and category area for achievement display /// </summary> /// /// <param name="category"> /// String that contains the category to be displayed /// </param> public void Createcategory(string category) { GameObject buttonPre = (GameObject)Instantiate(catPre); buttonPre.name = "Cat" + category; buttonPre.transform.SetParent(GameObject.Find("CatList").transform); buttonPre.transform.GetChild(0).GetComponent <Text>().text = category; buttonPre.transform.GetComponent <Button>().onClick.AddListener(() => Changecategory(buttonPre)); buttonPre.transform.localScale = new Vector3(1, 1, 1); GameObject listPre = (GameObject)Instantiate(catList); listPre.name = category; listPre.transform.SetParent(GameObject.Find("MainMask").transform); listPre.transform.GetComponent <RectTransform>().offsetMin = new Vector2(0, 0); listPre.transform.GetComponent <RectTransform>().offsetMax = new Vector2(0, 0); buttonPre.GetComponent <AchievementButton>().achList = listPre; if (catagories.Count == 0) { active = GameObject.Find("Cat" + category).GetComponent <AchievementButton>(); scroll.content = active.achList.GetComponent <RectTransform>(); } catagories.Add(category); }
// Use this for initialization void Start() { PlayerPrefs.DeleteAll(); // Add achievments to GeneralAchievments // CreateAchievement("GeneralAchievements", "Star collector", "Are those stars?"); CreateAchievement("Feats", "All star champion", "Collect all stars"); CreateAchievement("Feats", "All or nothing", "Win the game first time will all stars"); CreateAchievement("GeneralAchievements", "White boys can't jump", "Jump boy jump"); CreateAchievement("GeneralAchievements", "Bunny", "Jump, stop, jump"); CreateAchievement("GeneralAchievements", "ScarabaDABBER", "Dab!"); CreateAchievement("GeneralAchievements", "Vine Channel", "Dab x100"); CreateAchievement("GeneralAchievements", "GODLIKE", "Dab x 1000"); CreateAchievement("Feats", "LUDICROUS", "Dab 1,000,000 times or lie"); CreateAchievement("GeneralAchievements", "Boom", "Shoot your weapon"); CreateAchievement("GeneralAchievements", "Got moves!", "Try them out?", new string[] { "White boys can't jump", "ScarabaDABBER", "Boom" }); CreateAchievement("Feats", "Ninja", "Ninjas can triple jump"); CreateAchievement("GeneralAchievements", "Air dab", "Was this implemented?"); CreateAchievement("GeneralAchievements", "Save", "Reach a checkpoint"); CreateAchievement("GeneralAchievements", "WASTED", "GTA V STYLE"); CreateAchievement("Feats", "Not a noob. Promise.", "Die 1337 times"); CreateAchievement("GeneralAchievements", "Lost a hearth", "But not my love for music"); CreateAchievement("GeneralAchievements", "Neverending ammo", "You can shoot more than 10 times"); CreateAchievement("Feats", "Spam and waste of sound", "Just shoot like crazy"); CreateAchievement("Feats", "That's my JAM", "Win the game"); //CreateAchievement ("G //............................./// setAllFalse(); activeButton = GameObject.Find("GeneralBtn").GetComponent <AchievementButton> (); activeButton.SetClicked(); achievementMenu.SetActive(false); }
// 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); }
public void ChangeCategory(GameObject button) { AchievementButton achievementButton = button.GetComponent <AchievementButton>(); scrollRect.content = achievementButton.achievementList.GetComponent <RectTransform>(); achievementButton.Click(); activeButton.Click(); activeButton = achievementButton; }
// * * * * * * * * * * * * * GUI METHODS * * * * * * * * * * * * * // public void SetupAchievementContainer(Transform achievementContainer, string achievementName) { for (int i = 0; i < achievementContainer.childCount; i++) { GameObject child = achievementContainer.GetChild(i).gameObject; AchievementButton achievementButton = child.GetComponent <AchievementButton> (); achievementButton.Init(achievementName, i); } }
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; }
void Start() { foreach (Achievement a in achList) { em = ps.emission; GameObject temp = Instantiate(achIconPrefab, achParentGo.transform); AchievementButton ab = temp.GetComponent <AchievementButton>(); ab.stats = a; ab.achIcon = menuAchIcon; ab.achTitle = menuAchTitle; ab.achDescription = menuAchDescription; } }
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); }
public void Open() { if (unviewed) { unviewed = false; } field.text = "Selecciona un logro para ver de qué se trata"; panel.SetActive(true); NewAchievement.SetActive(false); Utils.RemoveAllChildsIn(container); foreach (Achievement ach in AchievementsManager.Instance.all) { AchievementButton b = Instantiate(button); b.transform.SetParent(container); b.transform.localScale = Vector3.one; b.Init(this, ach); } Events.OnIngameUIPopup(true); }
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); }
/// <summary> /// 実績ボタンの作成 /// </summary> private void CreateAchivementButton() { for (int i = 0; i < store.StoreItems.Count; i++) { // カタログと一致するアイテムの取得 var catalogItem = store.CatalogItems.Find(x => x.ItemId == store.StoreItems[i].ItemId); var info = reach.GetInfo(store.StoreItems[i].ItemId); //-------------------------------------------------------------------------------- // ボタンオブジェクトの生成と初期化 Button button = Instantiate(achivementButton, this.transform); AchievementButton achievementButtonScript = button.GetComponent <AchievementButton>(); button.transform.localPosition = new Vector3(button.transform.localPosition.x + i % buttonHorizonNum * buttonHorizonInterval, button.transform.localPosition.y - (int)(i / buttonHorizonNum) * buttonVerticalInterval, button.transform.localPosition.z); button.name = store.StoreItems[i].ItemId; //-------------------------------------------------------------------------------- // 実績名をセット TextMeshProUGUI textMesh = button.transform.Find("AchievementTitle").GetComponent <TextMeshProUGUI>(); textMesh.text = catalogItem.DisplayName; //-------------------------------------------------------------------------------- // 進捗度をセット textMesh = button.transform.Find("ProgressText").GetComponent <TextMeshProUGUI>(); textMesh.text = info.progressValue + "/" + info.progressMax; // 実績達成済みなら達成済みフラグをON if (info.reach) { achievementButtonScript.ReachAchievement = true; } } // ボタン生成数に応じてスワイプの移動の制限値を変える swipeMove.moveLimitRect.height = swipeMove.moveLimitRect.yMin + store.StoreItems.Count / buttonHorizonNum * buttonVerticalInterval; }
public void ChangeCategory(GameObject button){ AchievementButton achievementButton = button.GetComponent<AchievementButton> (); scrollRect.content = achievementButton.achievementList.GetComponent<RectTransform> (); achievementButton.Click (); activeButton.Click (); activeButton = achievementButton; }