コード例 #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));
             }
         }
     }
 }
コード例 #2
0
 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));
 }
コード例 #4
0
 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));
        }