// Update is called once per frame void Update() { shop = GameObject.FindGameObjectWithTag("shop").GetComponent <Shop>(); // Gör så man kan komma åt Shop scriptet points = GameObject.FindGameObjectWithTag("score").GetComponent <Points>().score; // Kommer åt Points scriptet if (points >= 1 && PlayerPrefs.GetInt("achievement1gotten") == 0) //Om man når kraven för achievementen så får man det. Gäller alla nedan ner till if(startanim... { Dedication?.Invoke(); } if (points >= 10 && PlayerPrefs.GetInt("achievement2gotten") == 0) { Slurper?.Invoke(); } if (shop.Clicker >= 1 && PlayerPrefs.GetInt("achievement3gotten") == 0) { Auto?.Invoke(); } if (shop.Clicker >= 1 || shop.CentupleClicker >= 1 || shop.DecupleClicker >= 1 || shop.TenXClicker >= 1 || shop.doubleClicker >= 1 || shop.HundredXClicker >= 1) { if (PlayerPrefs.GetInt("achievement4gotten") == 0) { Buy?.Invoke(); } } if (shop.Clicker >= 1 && shop.CentupleClicker >= 1 && shop.DecupleClicker >= 1 && shop.TenXClicker >= 1 && shop.doubleClicker >= 1 && shop.HundredXClicker >= 1 && PlayerPrefs.GetInt("achievement5gotten") == 0) { Each.Invoke(); } if (points >= 50000000 && PlayerPrefs.GetInt("achievement6gotten") == 0) { Half.Invoke(); } if (startanimation1 == true) // om man animationen startat så sätter den achievementgotten till 1 och spelar upp animationen. { animator1.SetBool("start", true); StartCoroutine(AnimatorWait()); PlayerPrefs.SetInt("achievement1gotten", 1); } if (startanimation2 == true) { animator2.SetBool("start", true); StartCoroutine(AnimatorWait2()); PlayerPrefs.SetInt("achievement2gotten", 1); } if (startanimation3 == true) { animator3.SetBool("start", true); StartCoroutine(AnimatorWait3()); PlayerPrefs.SetInt("achievement3gotten", 1); } if (startanimation4 == true) { animator4.SetBool("start", true); StartCoroutine(AnimatorWait4()); PlayerPrefs.SetInt("achievement4gotten", 1); } if (startanimation5 == true) { animator5.SetBool("start", true); StartCoroutine(AnimatorWait5()); PlayerPrefs.SetInt("achievement5gotten", 1); } if (startanimation6 == true) { animator6.SetBool("start", true); StartCoroutine(AnimatorWait6()); PlayerPrefs.SetInt("achievement6gotten", 1); } }