예제 #1
0
    private void Open(string path)
    {
        if (!FileUtilities.CheckFile(path))
        {
            FileUtilities.WriteText(path, string.Empty);
            AssetDatabase.Refresh();
        }

        string json = FileUtilities.ReadText(path);

        data = JsonConvert.DeserializeObject <Dictionary <string, string> > (json);
        if (data != null)
        {
            data_Keys = new List <string> (data.Keys);
            string[] values = new string[data.Values.Count];
            data.Values.CopyTo(values, 0);
            data_Values = new List <Color> (ParseUtilities.ToColor(values));
        }
        else
        {
            data_Keys   = new List <string> ();
            data_Values = new List <Color> ();
            data        = new Dictionary <string, string> ();
        }
    }
예제 #2
0
    private void Open(string path)
    {
        if (!FileUtilities.CheckFile(path))
        {
            FileUtilities.WriteText(path, "{\"AssetFolder\": \"Original Resources\",\"AssetBundleExtName\": \".assetbundle\",\"BundleFolder\": \"Bundles\",\"ManifestName\": \"AssetBundleManifest\",\"UseStreamingAssets\": \"true\",\"IsSimulationMode\": \"true\",\"DefaultLanguage\":\"CN\"}");
            AssetDatabase.Refresh();
        }

        string json = FileUtilities.ReadText(path);

        data      = JsonConvert.DeserializeObject <Dictionary <string, string> > (json);
        data_Keys = new List <string> (data.Keys);

        UseStreamingAssets = System.Convert.ToBoolean(data["UseStreamingAssets"]);
        IsSimulationMode   = System.Convert.ToBoolean(data["IsSimulationMode"]);
    }