예제 #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));
        }
예제 #6
0
 public static float GetFloat(string key)
 {
     return(RemoteSettings.GetFloat(key, 0f));
 }
예제 #7
0
 public static long GetLong(string key)
 {
     return(RemoteSettings.GetLong(key, 0L));
 }
예제 #8
0
 public static int GetInt(string key)
 {
     return(RemoteSettings.GetInt(key, 0));
 }
예제 #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);
        }
예제 #10
0
 public static T GetObject <T>(string key = "")
 {
     return((T)((object)RemoteSettings.GetObject(typeof(T), key)));
 }
예제 #11
0
 public static bool GetBool(string key)
 {
     return(RemoteSettings.GetBool(key, false));
 }
예제 #12
0
 public static string GetString(string key)
 {
     return(RemoteSettings.GetString(key, ""));
 }
예제 #13
0
        public static bool GetBool(string key)
        {
            bool defaultValue = false;

            return(RemoteSettings.GetBool(key, defaultValue));
        }
예제 #14
0
        public static string GetString(string key)
        {
            string defaultValue = "";

            return(RemoteSettings.GetString(key, defaultValue));
        }
예제 #15
0
        public static float GetFloat(string key)
        {
            float defaultValue = 0f;

            return(RemoteSettings.GetFloat(key, defaultValue));
        }
예제 #16
0
        public static int GetInt(string key)
        {
            int defaultValue = 0;

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