Ejemplo n.º 1
0
 void RemoteSettingsUpdated()
 {
     for (int i = 0; i < m_DriveableProperty.fields.Count; i++)
     {
         var f = m_DriveableProperty.fields[i];
         if (!string.IsNullOrEmpty(f.rsKeyName) && RS.HasKey(f.rsKeyName) && f.target != null && !string.IsNullOrEmpty(f.fieldPath))
         {
             //Type doesn't work with a switch, so let's do it this way
             if (f.type == "bool")
             {
                 f.SetValue(RS.GetBool(f.rsKeyName));
             }
             else if (f.type == "float")
             {
                 f.SetValue(RS.GetFloat(f.rsKeyName));
             }
             else if (f.type == "int")
             {
                 f.SetValue(RS.GetInt(f.rsKeyName));
             }
             else if (f.type == "string")
             {
                 f.SetValue(RS.GetString(f.rsKeyName));
             }
         }
     }
 }
 private void AfterChecked(bool wasUpdatedFromServer, bool settingsChanged, int serverResponse)
 {
     Latest_Build = RS.GetInt("Latest_Build");
     if (Latest_Build > current_build)
     {
         updateCanvas.SetActive(true);
         StartCoroutine(AnimateVisualTrick());
         gameObject.SetActive(false);
     }
 }
 public static object GetObject(Type type, string key = "")
 {
     if (type == null)
     {
         throw new ArgumentNullException(nameof(type));
     }
     if (type.IsAbstract || type.IsSubclassOf(typeof(Object)))
     {
         throw new ArgumentException("Cannot deserialize to new instances of type '" + type.Name + ".'");
     }
     return(RemoteSettings.GetAsScriptingObject(type, (object)null, key));
 }
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.RemoteSettings o;
         o = new UnityEngine.RemoteSettings();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
        public static object GetObject(string key, object defaultValue)
        {
            if (defaultValue == null)
            {
                throw new ArgumentNullException(nameof(defaultValue));
            }
            Type type = defaultValue.GetType();

            if (type.IsAbstract || type.IsSubclassOf(typeof(Object)))
            {
                throw new ArgumentException("Cannot deserialize to new instances of type '" + type.Name + ".'");
            }
            return(RemoteSettings.GetAsScriptingObject(type, defaultValue, key));
        }
Ejemplo n.º 6
0
 public static float GetFloat(string key)
 {
     return(RemoteSettings.GetFloat(key, 0f));
 }
Ejemplo n.º 7
0
 public static long GetLong(string key)
 {
     return(RemoteSettings.GetLong(key, 0L));
 }
Ejemplo n.º 8
0
 public static int GetInt(string key)
 {
     return(RemoteSettings.GetInt(key, 0));
 }
Ejemplo n.º 9
0
        public static IDictionary <string, object> GetDictionary(string key = "")
        {
            RemoteSettings.UseSafeLock();
            IDictionary <string, object> dictionary = RemoteConfigSettingsHelper.GetDictionary(RemoteSettings.GetSafeTopMap(), key);

            RemoteSettings.ReleaseSafeLock();
            return(dictionary);
        }
Ejemplo n.º 10
0
 public static T GetObject <T>(string key = "")
 {
     return((T)((object)RemoteSettings.GetObject(typeof(T), key)));
 }
Ejemplo n.º 11
0
 public static bool GetBool(string key)
 {
     return(RemoteSettings.GetBool(key, false));
 }
Ejemplo n.º 12
0
 public static string GetString(string key)
 {
     return(RemoteSettings.GetString(key, ""));
 }
Ejemplo n.º 13
0
        public static bool GetBool(string key)
        {
            bool defaultValue = false;

            return(RemoteSettings.GetBool(key, defaultValue));
        }
Ejemplo n.º 14
0
        public static string GetString(string key)
        {
            string defaultValue = "";

            return(RemoteSettings.GetString(key, defaultValue));
        }
Ejemplo n.º 15
0
        public static float GetFloat(string key)
        {
            float defaultValue = 0f;

            return(RemoteSettings.GetFloat(key, defaultValue));
        }
Ejemplo n.º 16
0
        public static int GetInt(string key)
        {
            int defaultValue = 0;

            return(RemoteSettings.GetInt(key, defaultValue));
        }