示例#1
0
        private static void GenLayoutsFile()
        {
            Debug.Log("Generating new layouts file...");

            layoutsFile       = new DPLayoutsFile();
            layoutsFileLoaded = true;

            if (File.Exists(configFilePath))
            {
                File.Delete(configFilePath);
            }

            SaveLayoutsFile();
        }
示例#2
0
        public static void LoadLayoutsJson(bool regenConfig = false)
        {
            //If it doesn't exist, we need to gen a new one.
            if (regenConfig || !File.Exists(configFilePath))
            {
                //Gen new config will autoload the new config.
                GenLayoutsFile();
                return;
            }

            try {
                layoutsFile       = JsonUtility.FromJson <DPLayoutsFile>(File.ReadAllText(configFilePath));
                layoutsFileLoaded = true;
            }
            catch (Exception e) {
                Debug.LogError(e);
                //layoutsFileLoaded = false;
            }
        }