Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by DaiMangouDev · Apr 01, 2015 at 05:25 PM · c#editordll

How do I ; from inside another script, read an image resource inside a DLL

Hi , I have a DLL with an image resource in it . I also have classes in the Dll which inherit from UnityEngine and other libraries .

The issue is that I'm trying to access a .png image resource which I placed inside my dll file . I have an editor scripr from which i will access the dll and image resource that i placed in the dll .

after accessing the image i want to assign it to the Texture to be used in a GUI .

Similarly to how we handle Resource.Load.... except i'm loading the texture from my dll , not from inside a Resorces folder.

How can I get this done ?

I am looking at ResourceManager , trying to figure it out

Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ericool · Apr 01, 2015 at 06:24 PM 0
Share

is your dll actualy working in Unity ? can you call some methods ?

avatar image DaiMangouDev · Apr 01, 2015 at 06:26 PM 0
Share

oh, yeah everything works fine. I just need to be able to access the image resource in the dll

avatar image Ericool · Apr 01, 2015 at 08:34 PM 0
Share

I dont know if that may help but here is an extractor maybe running another process using Unity can make it , not sure

http://www.nirsoft.net/utils/resources_extract.html

avatar image DaiMangouDev · Apr 01, 2015 at 08:39 PM 0
Share

oh, no no I am not trying to extract the image resource from the DLL . I just need to read the dll and assign the image in the dll to a Texture2D .

avatar image Ericool · Apr 01, 2015 at 09:11 PM 0
Share

well first allocate the texture not in the dll , then try to pass all data to the texture , by that I mean the dimension , n bits , etc. But it mights have diff. because of the encapsulation of the classes.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by DaiMangouDev · Apr 02, 2015 at 08:40 PM

Hi DMDev . this is how you read an image resource from a dll

 //DaiM.Reality is the namespace 
 //flg would be any class in your dll using the namespace 
 
  Assembly asm = typeof(DaiM.Reality.fgl).Assembly;
          string resourcename = asm.GetName().Name + ".Properties.Resources";
          ResourceManager rm = new ResourceManager(resourcename, asm);
         
Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DaiMangouDev · Apr 02, 2015 at 08:41 PM 0
Share

oooooh , thanks a lot !!

avatar image DaiMangouDev · Apr 02, 2015 at 08:42 PM 0
Share

No problem me...

avatar image DaiMangouDev · Apr 02, 2015 at 08:44 PM 0
Share

Just one problem . Unity does not support System.Drawing so anything related to System.Drawing seems to not work . so good luck converting the bitmap resource to Texture 2D..... and the story continues another method of importing resources

seems like we just need to drag a compatable version of the System.Drawing library into our project folder for it to work

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why does Assembly-CSharp reference UnityEditor.dll 0 Answers

How to fix losing System.Data.dll in Project? 2 Answers

Initialising List array for use in a custom Editor 1 Answer

Multiple Cars not working 1 Answer

Creating Scenes Programmatically From A Deployed Build in Unity 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges