Ejemplo n.º 1
0
        public static void ValidateManifest(ManifestInstructions instructions)
        {
            if (instructions == false)
            {
                return;
            }
            var path = GetManifestPath();
            var text = File.ReadAllText(path);

            if (instructions.TryReplacePackages(text, out string newText))
            {
                Debug.Log("Manifest Packages Modified by " + nameof(ManifestModifier));
                File.WriteAllText(path, newText);
                AssetDatabase.Refresh();
            }
        }
Ejemplo n.º 2
0
        private static void ManifestRefresh()
        {
            var instructions = ManifestInstructions.GatherAll();

            if (instructions == null)
            {
                return;
            }
            if (instructions.Count < 1)
            {
                return;
            }
            foreach (var instruction in instructions)
            {
                if (instruction.IsThisEditor())
                {
                    ValidateManifest(instruction);
                    break;
                }
            }
        }