protected override async Task <IResource> GetResourceAsync(ResourcePath path)
        {
            ICacheable cacheable = null;

            if (m_Resources.TryGetValue(path.Path, out cacheable))
            {
                return((IResource)(cacheable));
            }
            else
            {
                LogService.Logger.Log(LogService.LogType.LT_DEBUG, "ResService Cache Missed");
                IResource        newRes  = null;
                IResourceCreator creator = GetCreator(path.GetExt());

                if (creator == null)
                {
                    newRes = new UnityResource <UnityEngine.Object>();
                }
                else
                {
                    newRes = creator.Create();
                }
                if (newRes != null)
                {
                    await newRes.LoadAsync(path);

                    newRes = (IResource)(m_Resources.GetOrAdd(path.Path, newRes));
                }
                return(newRes);
            }
        }
Exemplo n.º 2
0
 public CreateScheme(IResourceCreator <LocalScheme, LocalSchemeCreateParameters> schemeCreator, IResourceCreator <LocalScheme, LocalSchemeCreateRandomParameters> randomSchemeCreator, IFileSystem fileSystem, IWormsLocator wormsLocator)
 {
     _schemeCreator       = schemeCreator;
     _randomSchemeCreator = randomSchemeCreator;
     _fileSystem          = fileSystem;
     _wormsLocator        = wormsLocator;
 }
Exemplo n.º 3
0
        protected Creatable(string name, InnerResourceT innerObject)
            : base(name, innerObject)
        {
            Name = name;
            IResourceCreator <IResourceT> creator = this as IResourceCreator <IResourceT>;

            CreatorTaskGroup = new CreatorTaskGroup <IResourceT>(this.Key, creator);
        }
Exemplo n.º 4
0
 public AppCreator(IComponentRepository componentRepository, IAppTypeProvider appTypeProvider, IScriptCreator scriptCreator, IStyleCreator styleCreator, IResourceCreator resourceCreator, ITranslationRepositoryCreator translationRepositoryCreator)
 {
     ComponentRepository          = componentRepository;
     AppTypeProvider              = appTypeProvider;
     ScriptCreator                = scriptCreator;
     StyleCreator                 = styleCreator;
     ResourceCreator              = resourceCreator;
     TranslationRepositoryCreator = translationRepositoryCreator;
 }
Exemplo n.º 5
0
 public ComponentCreator(ILogger <ComponentCreator> logger, IComponentTypeProvider componentTypeProvider, IComponentDependencyCreator componentDependencyCreator, IComponentControllerCreator componentControllerCreator, IScriptCreator scriptCreator, IStyleCreator styleCreator, IResourceCreator resourceCreator)
 {
     Logger = logger;
     ComponentTypeProvider      = componentTypeProvider;
     ComponentDependencyCreator = componentDependencyCreator;
     ComponentControllerCreator = componentControllerCreator;
     ScriptCreator   = scriptCreator;
     StyleCreator    = styleCreator;
     ResourceCreator = resourceCreator;
 }
Exemplo n.º 6
0
 ///GENMHASH:4A422DC2657B1BB27BB580555739E1BC:FC7B116552CE8C8D172AF7124F9B7092
 internal void AddToCreatableDependencies(IResourceCreator <IHasId> creatableResource)
 {
     AddCreatableDependency(creatableResource);
 }
Exemplo n.º 7
0
 public CreatorTaskItem(IResourceCreator <IResourceT> resourceCreator)
 {
     this.resourceCreator = resourceCreator;
 }
Exemplo n.º 8
0
 protected void AddCreatableDependency(IResourceCreator <IResourceT> creatableResource)
 {
     creatableResource.CreatorTaskGroup.Merge(CreatorTaskGroup);
 }
Exemplo n.º 9
0
 public CreateGif(IResourceCreator <LocalGif, LocalGifCreateParameters> gifCreator, IResourceRetriever <LocalReplay> replayRetriever)
 {
     _gifCreator      = gifCreator;
     _replayRetriever = replayRetriever;
 }
Exemplo n.º 10
0
 /*
  * public virtual string ResolveRealPath(ResourcePath path)
  * {
  *  return path.Path;
  * }
  */
 public virtual void RegisterResourceCreator(string ext, IResourceCreator resCreator)// where T : IResource
 {
     m_ResoruceCreators.Add(ext, resCreator);
 }
Exemplo n.º 11
0
 public CreatorTaskGroup(string rootCreatableId, IResourceCreator <IResourceT> resourceCreator)
     : base(rootCreatableId, new CreatorTaskItem <IResourceT>(resourceCreator))
 {
 }