int myItemID = int.Parse(gameObject.name);
var myWeapon = ORK.Weapons.Get(myItemID);
Texture tex = myWeapon.GetIcon();
iconImageObj.GetComponent<Image>().sprite = Sprite.Create(tex as Texture2D, new Rect(0, 0, tex.width, tex.height), new Vector2(.5f, .5f));
It looks like you're new here. If you want to get involved, click one of these buttons!
Just use a RawImage component instead of Image to use the texture.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The normal game UI of a mobile game consists almost entirely of Sprite, since spritepack greatly reduces DrawCall.
Also, Slice can be used as an ImageType, which is necessary for a good looking UI.
■iOS
https://itunes.apple.com/us/app/id679133055
■Android
https://play.google.com/store/apps/details?id=com.WabiPlant.SAMURAI100SlashLite
New ORK Battle Game
■iOS
https://itunes.apple.com/jp/app/id1403510381
■Android
https://play.google.com/store/apps/details?id=com.Company.AgentFight
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!