Esempio n. 1
0
 private void OnValueChanged_ClearPref()
 {
     if (clearPref.isOn)
     {
         SGStorage.ClearGenericPrefs();
         PlayerPrefs.DeleteAll();
         clearPref.isOn = false;
     }
 }
    public void TranslationURL_OnClick()
    {
        if (string.IsNullOrEmpty(SGAppLauncher.defaultMessage))
        {
            return;
        }

        string url = SGStorage.GetGenericPref(keyURL, defaultURL);

        SGAppLauncher.LaunchURL(url);
    }
    private void SetPreviousValue()
    {
        //set previous value
#if UNITY_EDITOR
        appID = SGStorage.GetGenericPref(keyApp, defaultAndroidBundleID);
#elif UNITY_ANDROID
        appID = SGStorage.GetGenericPref(keyApp, defaultAndroidBundleID);
#endif
        apps.Insert(0, appID);
        dropdown.AddOptions(apps);
        dropdown.captionText.text = appID;
    }
    public void OnClick()
    {
        // restore sounds
        SGSound.SoundLevel = 1;
        SGSound.MusicLevel = 1;

        // restore storages
        SGStorage.ClearGenericPrefs();

        // delete files
        SGSaveLoad.DeleteLocal();

        // load boot scene
        StartCoroutine(SGEnvironment.Quit());
    }
    // Start is called before the first frame update
    void Start()
    {
        inputField = GetComponent <InputField>();

        //set previous value
        string url = "";

#if UNITY_EDITOR
        url = SGStorage.GetGenericPref(keyURL, defaultURL);
#elif UNITY_ANDROID
        url = SGStorage.GetGenericPref(keyURL, defaultURL);
#endif
        inputField.text = url;

        // set callbacks
        inputField.onEndEdit.AddListener(delegate { OnValueChanged(); });
    }
Esempio n. 6
0
    private void TextInfo()
    {
        textInfo.text = "INFORMATIONS";
        // time
        textInfo.text += "\nDate Time: " + System.DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss");

        // user
        textInfo.text += "\nUser name: " + SGFirebase.userName;
        textInfo.text += "\nUser email: " + SGFirebase.userEmail;
        textInfo.text += "\nUser id: " + SGFirebase.userId;

        // screen
        textInfo.text += "\nScreen dpi: " + Screen.dpi;
        textInfo.text += "\nScreen orientation: " + Screen.orientation;
        textInfo.text += "\nScreen dimension pixels: " + Screen.width + "x" + Screen.height;

        // some player prefs
        foreach (string key in SGStorage.GetGenericPrefs())
        {
            textInfo.text += "\nGenericPrefs : " + key + "=" + SGStorage.GetGenericPref(key);
        }

        // environment
        textInfo.text += "\nProduct: " + SGEnvironment.GetProdutcName() + " " + SGEnvironment.GetVersion();
        textInfo.text += "\nProduct company name: " + Application.companyName;
        textInfo.text += "\nProduct absolute url: " + Application.absoluteURL;
        textInfo.text += "\nProduct build GUID: " + Application.buildGUID;
        textInfo.text += "\nProduct identifier: " + Application.identifier;
        textInfo.text += "\nProduct installer name: " + Application.installerName;
        textInfo.text += "\nProduct internet reachability: " + Application.internetReachability;
        textInfo.text += "\nProduct data path: " + Application.dataPath;
        textInfo.text += "\nProduct persistent data path: " + Application.persistentDataPath;
        textInfo.text += "\nProduct streaming assets path: " + Application.streamingAssetsPath;
        textInfo.text += "\nProduct temporary cache path: " + Application.temporaryCachePath;
        textInfo.text += "\nUnity: " + SGEnvironment.GetUnityVersion();
        textInfo.text += "\nDevice platform: " + Application.platform;
        textInfo.text += "\nDevice unique identifier: " + SystemInfo.deviceUniqueIdentifier;
        textInfo.text += "\nDevice name: " + SystemInfo.deviceName;
        textInfo.text += "\nDevice model: " + SystemInfo.deviceModel;
        textInfo.text += "\nDevice SO: " + SystemInfo.operatingSystem;
        textInfo.text += "\nDevice system language: " + Application.systemLanguage;
        textInfo.text += "\nDevice type: " + SystemInfo.deviceType;
        textInfo.text += "\nDevice memory size: " + SystemInfo.systemMemorySize.ToString();
        textInfo.text += "\nDevice processors: " + SystemInfo.processorCount.ToString();
        textInfo.text += "\nFirebase Ready: " + SGFirebase.SetupReady.ToString();
    }
    public void TranslationApp_OnClick()
    {
        if (string.IsNullOrEmpty(SGAppLauncher.defaultMessage))
        {
            return;
        }

        string url   = SGStorage.GetGenericPref(keyURL, defaultURL);
        string appID = "";

#if UNITY_EDITOR
        appID = SGStorage.GetGenericPref(keyApp, defaultAndroidBundleID);
#elif UNITY_ANDROID
        appID = SGStorage.GetGenericPref(keyApp, defaultAndroidBundleID);
#endif
        SGAppLauncher.LaunchApp(appID, url);
    }
Esempio n. 8
0
    /// <summary>
    /// get the latest values for loaded remote settings
    /// </summary>
    public static string RemoteSettings(string propertyName, string defaultValue)
    {
        string newValue = "";

        if (SGDebug.DebugMode)
        {
            newValue = SGStorage.GetGenericPref(rsPreference + rsDebugPrefix + propertyName, defaultValue);
        }
        else
        {
            newValue = SGStorage.GetGenericPref(rsPreference + propertyName, defaultValue);
        }

        if (newValue == null)
        {
            newValue = defaultValue;
        }

        return(newValue);
    }
Esempio n. 9
0
    private static bool RemoteSettingsSaveLate()
    {
        bool hasValues = false;

        if (!setupReady)
        {
            return(false);
        }

        //save the latest remote settings
        var keys = FirebaseRemoteConfig.Keys;

        foreach (string key in keys)
        {
            string value = FirebaseRemoteConfig.GetValue(key).StringValue;
            SGStorage.SetGenericPref(rsPreference + key, value);
            Debug.Log("Remote Settings: Save data to PlayerPrefab: " + rsPreference + key + "=" + value);
        }

        hasValues = rsActivateFetched;

        return(hasValues);
    }
 private void OnValueChanged()
 {
     SGStorage.SetGenericPref(keyURL, inputField.text);
 }
 private void OnValueChanged()
 {
     SGStorage.SetGenericPref(keyApp, dropdown.captionText.text);
     dropdown.enabled = false;
 }