예제 #1
0
    void LoadActualResource(ResourceConfigData data)
    {
        switch (data.RESOURCETYPE)
        {
        case ResourceType.SpriteSheet:
            LoadSpriteSheet(data.Resourcepath + "/" + data.Resourcesname);
            break;

        case ResourceType.Prefab:
            break;

        case ResourceType.Audio:
            break;

        case ResourceType.Material:
            break;

        case ResourceType.Texture:
            break;

        case ResourceType.ParticleSystem:
            LoadParticleSystem(data.Resourcepath + "/" + data.Resourcesname, data.Preloadamount);
            break;

        default:
            break;
        }
    }
        protected async Task AddResourceConfig(object data, ResourceHandlerConfiguration resourceHandlerConfigurations)
        {
            var json       = JsonConvert.SerializeObject(data);
            var configData = new ResourceConfigData
            {
                Hash         = json.GetMd5Hash(), DelayInMs = resourceHandlerConfigurations.DelayInMs, HttpStatusCode = resourceHandlerConfigurations.HttpStatusCode,
                InvalidToken = resourceHandlerConfigurations.InvalidToken, Body = json
            };

            await using var context = new RelayApiContext(Options);
            await context.ResourceConfigData.AddAsync(configData).ConfigureAwait(false);

            await context.SaveChangesAsync().ConfigureAwait(false);
        }