- Home /
Saving image in a variable purely through code?
Is there I can save an image in a variable that I have in my assets, purely through code, without attaching it to any game object or prefab? Like path to file or something idk
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by Reynarz · Jun 18, 2018 at 10:30 PM
Yes you can. if you have that image inside the resources folder you just have to call it:
 var spriteImage = Resources.Load<Sprite>("myImagePath");
Your answer
 
 
             Follow this Question
Related Questions
UI Canvas Image parented to main camera only moves in x and z 0 Answers
why a gui image is rendered white on ios ? 0 Answers
LeanTween.moveLocal sometimes snaps to position rather than moving over time 0 Answers
Get Image from another scene 2 Answers
UI fade with CanvasGroup vs of Image.color.alpha or Text.color.alpha performance 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                