예제 #1
0
 private void OnMouseDown()
 {
     if (!EventSystem.current.IsPointerOverGameObject(-1))
     {
         AchievmentManager.Instance().EarnAchievment(achievmentName);
     }
 }
예제 #2
0
 public static AchievmentManager Instance()
 {
     if (instance == null)
     {
         instance = GameObject.FindObjectOfType <AchievmentManager>();
     }
     return(instance);
 }
예제 #3
0
 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;
     }
 }
예제 #4
0
    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);
    }
예제 #5
0
    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>();
        }
    }