예제 #1
0
        public void AddImageAsync(string fileimage, Action <CCTexture2D> action)
        {
            Debug.Assert(!String.IsNullOrEmpty(fileimage), "TextureCache: fileimage MUST not be NULL");

            lock (asyncLoadedImages)
            {
                asyncLoadedImages.Add(new AsyncStruct()
                {
                    FileName = fileimage, Action = action
                });
            }

            if (Task == null)
            {
                Task = CCTask.RunAsync(Scheduler, ProcessingAction);
            }
        }
예제 #2
0
        public void AddParticleSystemAsync(string fileConfig, Action <CCParticleSystemConfig> action, string directoryName = null)
        {
            Debug.Assert(!String.IsNullOrEmpty(fileConfig), "ParticleSystemConfigCache: fileConfig MUST not be NULL");

            lock (asyncLoadedConfigs)
            {
                asyncLoadedConfigs.Add(new AsyncStruct()
                {
                    FileName = fileConfig, Action = action, OnLoad = OnConfigLoad
                });
            }

            if (Task == null)
            {
                Task = CCTask.RunAsync(Scheduler, ProcessingAction);
            }
        }
예제 #3
0
        public void AddImageAsync(byte[] data, string assetName, CCSurfaceFormat format, Action <CCTexture2D> action)
        {
            Debug.Assert(data != null && data.Length != 0, "TextureCache: data MUST not be NULL and MUST contain data");

            lock (dataAsyncLoadedImages)
            {
                dataAsyncLoadedImages.Add(new DataAsyncStruct()
                {
                    Data = data, AssetName = assetName, Format = format, Action = action
                });
            }

            if (Task == null)
            {
                Task = CCTask.RunAsync(Scheduler, ProcessingDataAction);
            }
        }