Ejemplo n.º 1
0
        public void RecalckHashes()
        {
            int i = 0;

            string[] derictories = Directory.GetDirectories(Application.dataPath + "/Resources/Configs");
            string[] configFiles = Directory.GetFiles(Application.dataPath + "/Resources/Configs", "*.asset", SearchOption.AllDirectories);
            ScriptableList <BaseScriptableDrowableItem> .configHash.hashes.Clear();

            foreach (string configFile in configFiles)
            {
                string     assetPath              = configFile.Replace(Application.dataPath + "/Resources/", "").Replace('\\', '/').Replace(".asset", "");
                ConfigHash _configHash            = AssetDatabase.LoadAssetAtPath(assetPath, typeof(ConfigHash)) as ConfigHash;
                BaseScriptableDrowableItem source = Resources.Load <BaseScriptableDrowableItem>(assetPath);

                if (source != null)
                {
                    string json = JsonConvert.SerializeObject(source, Formatting.Indented,
                                                              new JsonSerializerSettings()
                    {
                        ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,

                        NullValueHandling     = NullValueHandling.Ignore,
                        MissingMemberHandling = MissingMemberHandling.Ignore,
                        //Error = HandleDeserializationError,
                        //PreserveReferencesHandling = PreserveReferencesHandling.All
                    }
                                                              );
                    // Debug.Log(json);

                    ScriptableList <BaseScriptableDrowableItem> .SetNewHash(i, assetPath, json);

                    i++;
                }
            }

            AssetDatabase.SaveAssets();
        }
Ejemplo n.º 2
0
 public bool HasConfigChanged(ParsedRoute newConfig, BackendInfo backendOrNull)
 {
     return(BackendOrNull != backendOrNull ||
            !ConfigHash.Equals(newConfig.GetConfigHash()));
 }
Ejemplo n.º 3
0
 public bool HasConfigChanged(ProxyRoute newConfig, ClusterInfo cluster)
 {
     return(Cluster != cluster ||
            !ConfigHash.Equals(newConfig.GetConfigHash()));
 }