예제 #1
0
    public static string GetPlayerPrefString(Save_Keys type, string extra = "")
    {
        if (!PlayerPrefs.HasKey(type.ToString() + extra))
        {
            return("");
            //throw new UnityException("Key '" + type + "' does not exist!");
        }

        return(PlayerPrefs.GetString(type.ToString() + extra));
    }
예제 #2
0
    public static string GetPlayerPrefString(Save_Keys type, string extra = "")
    {
        if (!PlayerPrefs.HasKey(type.ToString() + extra))
        {
            return null;
            //throw new UnityException("Key '" + type + "' does not exist!");
        }

        return PlayerPrefs.GetString(type.ToString() + extra);
    }
예제 #3
0
    public static float? GetPlayerPrefFloat(Save_Keys type)
    {
        if (!PlayerPrefs.HasKey(type.ToString()))
        {
            return null;
            //throw new UnityException("Key '" + type + "' does not exist!");
        }

        return PlayerPrefs.GetFloat(type.ToString());
    }
예제 #4
0
    public static float GetPlayerPrefFloat(Save_Keys type)
    {
        if (!PlayerPrefs.HasKey(type.ToString()))
        {
            return(0.0f);

            throw new UnityException("Key '" + type + "' does not exist!");
        }

        return(PlayerPrefs.GetFloat(type.ToString()));
    }
예제 #5
0
    public static int GetPlayerPrefInt(Save_Keys type)
    {
        if (!PlayerPrefs.HasKey(type.ToString()))
        {
            switch (type)
            {
                case Save_Keys.Key_Coins:
                    {
                        return 10;
                    }
                    break;
                default:
                    {
                        return 0;
                    }
            }
            //throw new UnityException("Key '" + type + "' does not exist!");
        }

        return PlayerPrefs.GetInt(type.ToString());
    }
예제 #6
0
    public static int GetPlayerPrefInt(Save_Keys type)
    {
        if (!PlayerPrefs.HasKey(type.ToString()))
        {
            switch (type)
            {
            case Save_Keys.Key_Coins:
            {
                return(10);
            }
            break;

            default:
            {
                return(0);
            }
            }
            //throw new UnityException("Key '" + type + "' does not exist!");
        }

        return(PlayerPrefs.GetInt(type.ToString()));
    }