GetBool() 공개 정적인 메소드

public static GetBool ( string name ) : bool
name string
리턴 bool
예제 #1
0
 void Update()
 {
     if (PlayerPrefsBool.GetBool(packOfObjects.name) == true)
     {
         buyButton.sprite = purchased;
     }
 }
예제 #2
0
 void Update()
 {
     if (PlayerPrefsBool.GetBool("Pack") == true && PlayerPrefsBool.GetBool("Pack (1)") == true && PlayerPrefsBool.GetBool("Pack (2)") == true)
     {
         buyButton.sprite = purchased;
     }
 }
예제 #3
0
    public void NextLevelBtn()
    {
        if (Application.loadedLevelName == "Level3Beta")
        {
            GameObject.FindGameObjectWithTag(Constants.Tags.WindowManager).GetComponent <WindowHandler>().CreateInfoDialog("Phrases/LastLevelHeader", "Phrases/LastLevelInfo", "Phrases/LastLevelButton", MainMenuBtn);
            return;
        }

        if (NextLevel == "Level3Beta" && !PlayerPrefsBool.GetBool("Level7"))
        {
            var bls = GameObject.FindGameObjectWithTag(Constants.Tags.GameMaster).GetComponent <BuyLevelSeven>();
            if (PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) >= bls.cost)
            {
                bls.DoYouWannaBuy();
            }
            else
            {
                bls.NotEnoughOrbs();
            }
        }
        else
        {
            Application.LoadLevel(NextLevel);
        }
    }
예제 #4
0
 // Use this for initialization
 void Start()
 {
     if (PlayerPrefsBool.GetBool("firstTime"))
     {
         PlayerPrefsBool.SetBool("firstTime", false);
         TutShopController.tutorial = true;
     }
 }
예제 #5
0
 void IsBought()
 {
     if (PlayerPrefsBool.GetBool(packOfObjects.name) == true)
     {
         buyButton.sprite = purchased;
         APack(packOfObjects);
     }
 }
예제 #6
0
    void Awake()
    {
        audioSource = GetComponent <AudioSource>();

        bool  On = (PlayerPrefsBool.HasBoolKey("Music"))?PlayerPrefsBool.GetBool("Music"):true;
        float v  = (On)?1f:0f;

        SetVolume(v);
    }
예제 #7
0
        //GameObject hat;

        void Start()
        {
            Hat.SetActive(false);
            if (PlayerPrefsBool.GetBool(gameObject.tag + Constants.ShopItems.Hat))
            {
                Hat.SetActive(true);
                Hat.GetComponent <Renderer>().material.color = Color.blue;
            }
        }
예제 #8
0
 void IsBought()
 {
     if (PlayerPrefsBool.GetBool("Pack (3)") == true && PlayerPrefsBool.GetBool("Pack (4)") == true && PlayerPrefsBool.GetBool("Pack (5)") == true)
     {
         buyButton.sprite = purchased;
         APack(pack3);
         APack(pack4);
         APack(pack5);
     }
 }
예제 #9
0
 void IsBought()
 {
     if (PlayerPrefsBool.GetBool("Pack") == true && PlayerPrefsBool.GetBool("Pack (1)") == true && PlayerPrefsBool.GetBool("Pack (2)") == true)
     {
         buyButton.sprite = purchased;
         APack(pack);
         APack(pack1);
         APack(pack2);
     }
 }
예제 #10
0
 public void RefreshAchievements()
 {
     if (LeverPulls.leverpulls == 7 && !PlayerPrefsBool.GetBool(achievement.name))
     {
         PlayerPrefsBool.SetBool(achievement.name, true);
         achievement.SetActive(true);
     }
     else
     {
         achievement.SetActive(false);
     }
 }
예제 #11
0
    /// <summary>
    /// determine if the level has been won
    /// </summary>
    /// <returns><c>true</c>, if won was ised, <c>false</c> otherwise.</returns>
    /// <param name="LevelNum">Level number.</param>
    public static bool isWon(int LevelNum)
    {
        string PPLevelKey = getPPLevelKey(LevelNum);

        if (PlayerPrefsBool.HasBoolKey(PPLevelKey + "isWon"))
        {
            return(PlayerPrefsBool.GetBool(PPLevelKey + "isWon"));
        }
        else
        {
            PlayerPrefsBool.SetBool(PPLevelKey + "isWon", false);
            return(false);
        }
    }
예제 #12
0
    /// <summary>
    /// determine if the Level is Locked
    /// </summary>
    /// <returns><c>true</c>, if locked was ised, <c>false</c> otherwise.</returns>
    /// <param name="LevelNum">Level number.</param>
    public static bool isLocked(int LevelNum)
    {
        string PPLevelKey = getPPLevelKey(LevelNum);

        if (PlayerPrefsBool.HasBoolKey(PPLevelKey + "isLocked"))
        {
            return(PlayerPrefsBool.GetBool(PPLevelKey + "isLocked"));
        }
        else
        {
            PlayerPrefsBool.SetBool(PPLevelKey + "isLocked", true);
            return(true);
        }
    }
예제 #13
0
    /// <summary>
    /// Whether the star animation will be played
    /// </summary>
    /// <returns><c>true</c>, if animate stars was gotten, <c>false</c> otherwise.</returns>
    /// <param name="LevelNum">Level number.</param>
    public static bool getAnimateStars(int LevelNum)
    {
        string PPLevelKey = getPPLevelKey(LevelNum);

        if (PlayerPrefsBool.HasBoolKey(PPLevelKey + "animateStars"))
        {
            return(PlayerPrefsBool.GetBool(PPLevelKey + "animateStars"));
        }
        else
        {
            PlayerPrefsBool.SetBool(PPLevelKey + "animateStars", false);
            return(false);
        }
    }
예제 #14
0
 void OnTriggerEnter2D(Collider2D colObj)
 {
     if (colObj.tag == "Player")
     {
         if (!PlayerPrefsBool.GetBool("hype2"))
         {
             text.enabled = true;
             particles.Play();
         }
         else
         {
             text.enabled = true;
             text.text    = "OWNED";
         }
     }
 }
예제 #15
0
    /// <summary>
    /// Calculates the sum of all levels won
    /// </summary>
    /// <returns>The sum.</returns>
    public static int WinSum()
    {
        int    result     = 0;
        int    LevelNum   = 1;
        string PPLevelKey = getPPLevelKey(LevelNum);

        while (PlayerPrefsBool.HasBoolKey(PPLevelKey + "isWon"))
        {
            result += (PlayerPrefsBool.GetBool(PPLevelKey + "isWon"))? 1: 0;

            LevelNum++;
            PPLevelKey = getPPLevelKey(LevelNum);
        }

        return(result);
    }
예제 #16
0
    //set up everything on start
    void Start()
    {
        On = (PlayerPrefsBool.HasBoolKey(Key))?PlayerPrefsBool.GetBool(Key):true;

        image.sprite = (On)?OnSprite:OffSprite;

        float v = (On)?1f:0f;

        if (Key == "Music")
        {
            MusicManager.Instance.SetVolume(v);
        }
        else if (Key == "Sound")
        {
            SoundManager.Instance.SetVolume(v);
        }
    }
예제 #17
0
 void OnTriggerStay2D(Collider2D colObj)
 {
     if (colObj.tag == "Player")
     {
         if (Input.GetButton("Interact") && !PlayerPrefsBool.GetBool("hype1") && (PlayerPrefs.GetInt("lifetimeLoot") - price) >= 0)
         {
             text.enabled = false;
             PlayerPrefsBool.SetBool("hype1", true);
             particles.Stop();
             PlayerPrefs.SetInt("lifetimeLoot", (PlayerPrefs.GetInt("lifetimeLoot") - price));
             HYPEController.HYPEMode = gameObject.GetComponentInParent <Shop>().HYPEColor;
         }
         if (Input.GetButton("Interact") && !PlayerPrefsBool.GetBool("hype1"))
         {
             HYPEController.HYPEMode = gameObject.GetComponentInParent <Shop>().HYPEColor;
         }
     }
 }
예제 #18
0
 void OnTriggerStay2D(Collider2D colObj)
 {
     if (colObj.tag == "Player")
     {
         if (Input.GetButton("Interact") && !PlayerPrefsBool.GetBool("skin3") && (PlayerPrefs.GetInt("lifetimeLoot") - price) >= 0)
         {
             text.enabled = false;
             PlayerPrefsBool.SetBool("skin3", true);
             particles.Stop();
             PlayerPrefs.SetInt("lifetimeLoot", (PlayerPrefs.GetInt("lifetimeLoot") - price));
             arm.GetComponentInParent <SpriteRenderer>().sprite = gunArm;
             gameObject.GetComponentInParent <Shop>().player.GetComponent <Animator>().runtimeAnimatorController = gameObject.GetComponentInParent <Shop>().skin;
         }
         if (Input.GetButton("Interact") && !PlayerPrefsBool.GetBool("skin3") == true)
         {
             arm.GetComponentInParent <SpriteRenderer>().sprite = gunArm;
             gameObject.GetComponentInParent <Shop>().player.GetComponent <Animator>().runtimeAnimatorController = gameObject.GetComponentInParent <Shop>().skin;
         }
     }
 }
예제 #19
0
    /// <summary>
    /// Sets the lock to a level
    /// </summary>
    /// <param name="LevelNum">Level number.</param>
    /// <param name="Locked">If set to <c>true</c> locked.</param>
    public static void setLock(int LevelNum, bool isLocked)
    {
        string PPLevelKey = getPPLevelKey(LevelNum);

        if (PlayerPrefsBool.HasBoolKey(PPLevelKey + "isLocked"))
        {
            if (
                PlayerPrefsBool.GetBool(PPLevelKey + "isLocked") &&
                isLocked == false
                )
            {
                AnimateUnlock(LevelNum, true);
            }

            PlayerPrefsBool.SetBool(PPLevelKey + "isLocked", isLocked);
        }
        else
        {
            PlayerPrefsBool.SetBool(PPLevelKey + "isLocked", true);
        }
    }
예제 #20
0
    /// <summary>
    /// Gets the max unlocked level.
    /// </summary>
    /// <returns>The max unlocked level.</returns>
    public static int getMaxUnlockedLevel()
    {
        int result = 0;

        int    LevelNum   = 1;
        string PPLevelKey = getPPLevelKey(LevelNum);

        while (PlayerPrefsBool.HasBoolKey(PPLevelKey + "isLocked"))
        {
            if (
                !PlayerPrefsBool.GetBool(PPLevelKey + "isLocked") &&
                LevelNum >= result
                )
            {
                result = LevelNum;
            }

            LevelNum++;
            PPLevelKey = getPPLevelKey(LevelNum);
        }

        return(result);
    }
예제 #21
0
 public void BuyThisItem()
 {
     if (PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) >= cost && PlayerPrefsBool.GetBool(packOfObjects.name) == false)
     {
         PlayerPrefsBool.SetBool(packOfObjects.name, true);
         am.ClickBtnPlay();
         IsBought();
         PlayerPrefs.SetInt("CurrencyAmount", PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) - cost);
     }
     else
     {
         Debug.Log("YOU DONT HAVE SO MUCH MONEY");
     }
 }
예제 #22
0
 public void BuyThisItem()
 {
     if (PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) >= cost && (PlayerPrefsBool.GetBool("Pack") == false || PlayerPrefsBool.GetBool("Pack (1)") == false || PlayerPrefsBool.GetBool("Pack (2)") == false))
     {
         PlayerPrefsBool.SetBool("Pack", true);
         PlayerPrefsBool.SetBool("Pack (1)", true);
         PlayerPrefsBool.SetBool("Pack (2)", true);
         PlayerPrefsBool.SetBool("Pack123", true);
         am.ClickBtnPlay();
         IsBought();
         PlayerPrefs.SetInt("CurrencyAmount", PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) - cost);
     }
     else
     {
         Debug.Log("YOU DONT HAVE SO MUCH MONEY");
     }
 }
예제 #23
0
    void UnlockLevelSeven()
    {
        if (PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) >= cost && PlayerPrefsBool.GetBool("Level7") == false)
        {
            PlayerPrefsBool.SetBool("Level7", true);
            Userlevels.GetInstance().AddUserLevel("7");
            PlayerPrefs.SetInt("CurrencyAmount", PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) - cost);

            if (ls != null)
            {
                ls.GetComponent <LevelSelector>().UpdateLevels();
            }
            else
            {
                Application.LoadLevel("Level3Beta");
            }
        }
    }