question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AResourceManager load usage

See original GitHub issue

I’m trying to find the proper way to use AResourceManager, and I don’t see too many examples so I thought I’d see if you can help.

The example in the readme shows you can load a Texture2D and the manager can assign it to the DrawInfo component (which I believe it’s just assuming any entity with a ManagedResource<string, Texture2D> will have). But this example already breaks down when you show how to load multiple resources of the same type. The circle.png will presumably overwrite square.png in the entity’s DrawInfo.

So how would this work in a real-world scenario? Let’s say you need a texture for a character, and a texture for his footprints. The manager wouldn’t know where to put each. You could create a separate manager for each kind of Texture2D (e.g. a CharacterTextureManager and FootprintTextureManager). These would be mostly identical though, except for the field, or maybe component, that you’re setting. I thought you could try specifying the destination along with the texture name in TInfo, but then you’d need reflection or something to set it.

Is there a good way to specify which component or field to load resources into so that you can reuse resource managers? Hopefully the question makes sense.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:23 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
Dorakucommented, May 9, 2020

If you need any more assistance don’t hesitate to reopen this issue or create a new one, I will close it in the meantime 😉

1reaction
Dorakucommented, Apr 24, 2020

no, if a resource is used by an other entity in an other world the Unload method of AResourceManager will not be called 😃 That was the whole point, so you don’t have to reload everything between screen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Using ResourceManager
I'm trying to use the ResourceManager in a C# class, but don't know what to substitute for the basename when creating a new...
Read more >
ResourceManager Class (System.Resources)
For desktop apps, the ResourceManager class retrieves resources from binary resource (.resources) files. Typically, a language compiler or the Assembly Linker ( ...
Read more >
Retrieve resources in .NET apps
The ResourceManager class provides access to resources at run time. You use the ResourceManager.GetString method to retrieve string ...
Read more >
Apache Hadoop 3.3.6 – ResourceManager High Availability
This guide provides an overview of High Availability of YARN's ResourceManager, and details how to configure and use this feature. The ResourceManager (RM) ......
Read more >
Using Oracle Database Resource Manager
Resource Manager manages CPU usage by controlling the database load to a very precise level. By default, this level is set to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found