Пример #1
0
Файл: u3d.cs Проект: Klanly/ncnn
 public yBlock(YAMLfile yfile, int klasid, ulong Lid)
 {
     yType    = yObjType.Block;
     ClassID  = (ClassIDType)klasid;
     BaseFile = yfile;
     LocalID  = Lid;
 }
Пример #2
0
Файл: u3d.cs Проект: Klanly/ncnn
        public static YAMLfile LookUpFile(string[] info, yObject sender)
        {
            info[1] = info[1].Trim();
            string ky = info[3] = info[3].Trim();

            info[5] = info[5].Trim();



            YAMLfile yy;

            if (Guid2File.TryGetValue(ky, out yy))
            {
                int cy = int.Parse(info[1]);

                if (yy.catalog < 0)
                {
                    yy.catalog = cy;
                }
                else if (yy.catalog != cy)
                {
                    UnityEngine.Debug.Log($"CurCatalog={cy}, OrigCatalog={yy.catalog}, dummy={yy.isDummy}");
                }

                cy = int.Parse(info[5]);

                if (yy.usage < 0)
                {
                    yy.usage = cy;
                }
                else if (yy.usage != cy)
                {
                    UnityEngine.Debug.Log($"CurUse={cy}, OrigUse={yy.usage}, dummy={yy.isDummy}");
                }
            }
            else
            {
                yy = new YAMLfile(info);
            }

            yy.refs.Add(sender);
            return(yy);
        }
Пример #3
0
Файл: u3d.cs Проект: Klanly/ncnn
        public static YAMLfile Create(string path)
        {
            if (!File.Exists(path))
            {
                path = UnityYAMLAsset.GameBase + '\\' + path;
            }

            string azet = path.Substring(0, path.Length - 5).ToLower();

            if (!File.Exists(azet))
            {
                return(null);
            }


            var    tmpmeta = new yElement(StringGroup.Parse(File.ReadAllLines(path), 0, -1).substr, null, null, 0);
            bool   isDm    = false;
            string rtig    = null;

            string[] txt = null;

            foreach (var tig in nonYAML)
            {
                if (azet.EndsWith(tig))
                {
                    isDm = true;
                    rtig = tig;
                    goto aftalo;
                }
            }



            txt = File.ReadAllLines(azet);

            if (!txt[0].StartsWith("%YAML"))
            {
                return(null);
            }



aftalo:

            azet = ((yValue)tmpmeta.Fields["guid"]).ToString();

            YAMLfile yaoi;

            if (!UnityYAMLAsset.Guid2File.TryGetValue(azet, out yaoi))
            {
                if (isDm)
                {
                    yaoi = new YAMLfile(path, tmpmeta, rtig);
                }
                else
                {
                    yaoi = new YAMLfile(path, tmpmeta, txt);
                }

                UnityYAMLAsset.Guid2File[azet] = yaoi;
            }

            if (yaoi.isDummy)
            {
                if (isDm)
                {
                    yaoi.LoadnonYAML(path, tmpmeta, rtig);
                }
                else
                {
                    yaoi.Load(path, tmpmeta, txt);
                }
            }


            return(yaoi);
        }