Exemplo n.º 1
0
Arquivo: u3d.cs Projeto: Klanly/ncnn
        public void LoadnonYAML(string metapath, yElement metain, string Dummy)
        {
            yType = yObjType.File;
            int len = UnityYAMLAsset.GameBase.Length + 1;

            Path = metapath.Substring(len, metapath.Length - len - 5);
            meta = metain;
            Blocks[0xFFFFFFFFFFFFFFFF] = new yBlock(Dummy);
        }
Exemplo n.º 2
0
Arquivo: u3d.cs Projeto: Klanly/ncnn
        public yArray(StringGroup[] mixed, Dictionary <ulong, yBlock> LookUp, yObject sender, int qpos)
        {
            qnum   = qpos;
            Parent = sender;
            yType  = yObjType.Array;
            int yd = mixed.Length;

            array = new yObject[yd];

            for (int i = 0; i < yd; i++)
            {
                array[i] = new yElement(mixed[i].substr, LookUp, this, mixed[i].substr[0].topstr_n);
            }
        }
Exemplo n.º 3
0
Arquivo: u3d.cs Projeto: Klanly/ncnn
        public void Load(string metapath, yElement metain, string[] txt)
        {
            int len = UnityYAMLAsset.GameBase.Length + 1;

            Path = metapath.Substring(len, metapath.Length - len - 5);
            meta = metain;



            List <int>   addrlist = new List <int>();
            List <ulong> idlist   = new List <ulong>();

            len = txt.Length;
            for (int i = 2; i < len; i++)
            {
                if (txt[i].StartsWith("--- !u!"))
                {
                    addrlist.Add(i);
                    string[] paar = txt[i].Substring(7).Split(kongge, StringSplitOptions.RemoveEmptyEntries);
                    ulong    idd  = ulong.Parse(paar[1]);
                    idlist.Add(idd);
                    Blocks[idd] = new yBlock(this, int.Parse(paar[0]), idd);
                }
            }

            addrlist.Add(len);
            len = addrlist.Count - 1;



            for (int i = 0; i < len; i++)
            {
                int start = addrlist[i];
                int end   = addrlist[i + 1];



                Blocks[idlist[i]].Load(StringGroup.Parse(txt, start + 1, end), Blocks);
            }
            isDummy = false;
        }
Exemplo n.º 4
0
Arquivo: u3d.cs Projeto: Klanly/ncnn
 public void Load(StringGroup sgp, Dictionary <ulong, yBlock> LookUp)
 {
     qnum     = sgp.topstr_n;
     ClassStr = sgp.topstr;
     content  = new yElement(sgp.substr, LookUp, this, sgp.topstr_n + 1);
 }
Exemplo n.º 5
0
Arquivo: u3d.cs Projeto: 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);
        }
Exemplo n.º 6
0
Arquivo: u3d.cs Projeto: Klanly/ncnn
 public YAMLfile(string metapath, yElement metain, string[] txt)
 {
     yType = yObjType.File;
     Load(metapath, metain, txt);
 }
Exemplo n.º 7
0
Arquivo: u3d.cs Projeto: Klanly/ncnn
 public YAMLfile(string metapath, yElement metain, string Dummy)
 {
     LoadnonYAML(metapath, metain, Dummy);
 }