private void OnMouseDown() { if (!EventSystem.current.IsPointerOverGameObject(-1)) { AchievmentManager.Instance().EarnAchievment(achievmentName); } }
public static AchievmentManager Instance() { if (instance == null) { instance = GameObject.FindObjectOfType <AchievmentManager>(); } return(instance); }
public void LoadAchievment() { unlocked = PlayerPrefs.GetInt(name) == 1 ? true: false; if (unlocked) { AchievmentManager.Instance().textPoints.text = "point: " + PlayerPrefs.GetInt("Points"); currentProgression = PlayerPrefs.GetInt("Progression" + name); achievmentRef.GetComponent <Image>().sprite = AchievmentManager.Instance().unlockedSprite; } }
public bool EarnAchievment() { if (!unlocked && !dependencies.Exists(x => x.unlocked == false) && CheckProgress()) { unlocked = true; achievmentRef.GetComponent <Image>().sprite = AchievmentManager.Instance().unlockedSprite; SaveAchievment(true); if (child != null) { AchievmentManager.Instance().EarnAchievment(child); } return(true); } return(false); }
public void Start() { LoadData(); if (guiManager == null) { guiManager = FindObjectOfType <GuiManager>(); } if (controller == null) { controller = FindObjectOfType <GameController>(); } if (realTimeManager == null) { realTimeManager = FindObjectOfType <RealtimeManager>(); } if (buildingManager == null) { buildingManager = FindObjectOfType <BuildingsManager>(); } if (timerManager == null) { timerManager = FindObjectOfType <TimerManager>(); } if (achievmentManager == null) { achievmentManager = FindObjectOfType <AchievmentManager>(); } if (shop == null) { shop = FindObjectOfType <Shop>(); } if (skyboxSwitcher == null) { skyboxSwitcher = FindObjectOfType <SkyboxSwitcher>(); } if (uiProfile == null) { uiProfile = FindObjectOfType <UIProfile>(); } if (spawner == null) { spawner = FindObjectOfType <CarSpawner>(); } }