コード例 #1
0
    /// <summary>
    /// Checks if the Continent should be locked or not
    /// </summary>
    public void CheckLock()
    {
        lastContinent = PlayerPrefs.GetInt("LastContinent");
        lastExercise = PlayerPrefs.GetInt("lastExercise");
        if (continentNum == 0)
        {
            isLocked = false;
        }

        if (lastContinent >= continentNum && amountOfExercises == lastExercise && lastContinent != 0)
        {
            ps.Play();
        }

        if (lastPlanet >= planetNum && isLocked == true && lastPlanet != 0)
        {
            isLocked = false;
        }

        if (lastContinent >= continentNum && isLocked == true)
        {
            isLocked = false;
        }



        if (isLocked == true)
        {
            lightSource.enabled = false;
            ps.Stop();
        }
        else if (isLocked == false)
        {
            lightSource.enabled = true;
            ps.Stop();
        }
        if(lastContinent > continentNum)
        {
            ps.Play();
            objectScript.ChangeImage(doneObject, destroy, objectiveName);
            objectScript.clickToDestroy.onClick.AddListener(() => OnClickSprite(1));
        }
    }