Exemple #1
0
        protected override void OnStart()
        {
            using (FileStream fileStream = new FileStream("Data/Texture/PainRpg.png",
                                                          FileMode.Open,
                                                          FileAccess.Read))
            {
                byte[] buf = new byte[fileStream.Length];
                fileStream.Read(buf, 0, buf.Length);
                loadData = new List <byte>(buf);
            }

            AddTexture(new asd.Vector2DF(0, 0), "Data/Texture/Cloud1.png");
            AddTexture(new asd.Vector2DF(150, 0), "Data/Texture/Sample1.png");
            AddTexture(new asd.Vector2DF(300, 0), "Data/Texture/PainRpg.png");
            AddTexture(new asd.Vector2DF(450, 0), "Data/Texture/PainRpgCopy.png");
            AddTexture(new asd.Vector2DF(450, 0), "Data/Texture/HomeMenuItem.png");
            staticFile = asd.Engine.File.CreateStaticFileAsync("Data/Texture/PainRpg.png");
        }
        protected override void OnUpdated()
        {
            if (Time == 0)
            {
                file1 = asd.Engine.File.CreateStaticFileAsync("Data/Texture/Cloud1.png");
            }

            if (file1 != null && file1.LoadState == asd.LoadState.Loaded)
            {
                file1      = null;
                loadedTime = Time;
                GC.Collect();
                Console.WriteLine("file1 loaded.");
            }

            if (Time == loadedTime + 5)
            {
                var file2 = asd.Engine.File.CreateStaticFileAsync("Data/Texture/Cloud1.png");
                Console.WriteLine("file2 loaded.");
            }
        }