Example #1
0
 public static void Init()
 {
     if (!File.Exists(ConfigFile))
     {
         currentConfig = new ConfigData()
         {
             enabled = true,
             strictVariantStripping = false,
             disableUnityStrip      = false,
             logEnabled             = true,
             order = int.MinValue,
         };
         return;
     }
     currentConfig = ReadConfigData();
     EditorApplication.delayCall += () =>
     {
         var targets = RecompileAsmUtility.ReadFromFile(RecompileAsmUtility.TempCompileTargetFile);
         if (targets.Count <= 0)
         {
             return;
         }
         var target = targets[0];
         targets.RemoveAt(0);
         RecompileAsmUtility.WriteFile(RecompileAsmUtility.TempCompileTargetFile, targets);
         Debug.Log("Recompiling::" + target.asmName);
         AssetDatabase.ImportAsset(target.asmDefPath, ImportAssetOptions.ForceUpdate);
     };
 }
Example #2
0
        private static void ReloadCode()
        {
            var targets = RecompileAsmUtility.GetRecompileTarget(true);

            if (targets.Count <= 0)
            {
                return;
            }

            var target = targets[0];

            targets.RemoveAt(0);
            if (targets.Count > 0)
            {
                RecompileAsmUtility.WriteFile(RecompileAsmUtility.TempCompileTargetFile, targets);
            }
            Debug.Log("Recompiling::" + target.asmName);
            AssetDatabase.ImportAsset(target.asmDefPath, ImportAssetOptions.ForceUpdate);
        }