I have some sprites in my Assets/Images/ folder which I want to use in dynamically created Orthello 2D Sprites.
Here’s the code:
OTSprite os = OT.CreateObject(OTObjectType.Sprite).GetComponent<OTSprite>();
os.position = mPos;
os.additive = true;
os.image=Resources.LoadAssetAtPath("Assets/Images/circle.png", typeof(Texture)) as Texture
Now this works fine when I play in Unity. But when I build & run, the proper sprite is not loaded & I just see the default square sprite.
What’s wrong with this?
Is there any other way to use imported sprites at runtime?