Ejemplo n.º 1
0
        public LocalizationUnitReference(LocalizationGroup group, string unitPath, bool createIfNeeded = false)
        {
            Group    = group;
            UnitPath = unitPath;
            UnitName = Path.GetFileNameWithoutExtension(unitPath);

            if (createIfNeeded && !File.Exists(UnitPath))
            {
                Create();
            }
        }
Ejemplo n.º 2
0
        private LocalizationGroup CreateGroup(string name)
        {
            if (!AllowEditPackFile)
            {
                Debug.LogError("ORLL: LocalizationPack: This pack is not allowed to write to disk.");
                return(null);
            }
            Debug.Log("Create group " + name);
            var g = new LocalizationGroup(this, PackPath, name, true);

            Groups.Add(g);
            GroupNames.Add(name);
            Save();


            return(g);
        }
Ejemplo n.º 3
0
        internal void Migrate(LocalizationGroup newGroup)
        {
            var newReference = newGroup.RequestReference(UnitName);

            int i = 0;
            LocalizationUnitHandle prevHandle = null;

            while (i < Handles.Count)
            {
                prevHandle = Handles[i];

                newReference.RegisterHandle(Handles[i]);

                if (i < Handles.Count && prevHandle == Handles[i])
                {
                    i++;
                }
            }
        }