Hey guys, I’m trying to assign texture2d pictures dynamically, but I found dat I cannt get resources by using path when I test on iPhone. Is there any way dat I can get pictures dynamically on iPhone?
here is my code:
function LoadCardMenu()
{
var Card2D : Texture2D;
yield WaitForSeconds(0.2);
for (var i = 1; i < Towers.length; i++)
{
var CardMenu = GameObject.Find("CardMenu" + i);
if (Towers[i] != null Towers[i] != ""){
Card2D = Resources.LoadAssetAtPath("Assets/Resources/Textures/TowerCard/" + Towers[i] + ".png", Texture2D);
Tower_Texture[i] = Card2D;
}
}
many thanks. carol
resources are part of the unity project before building the project already (must be in the Resources folder within your assets folder)
you can’t add resources post build
you can only add AssetBundles (iphone Advanced only) post build
I think we do talk about the same But ok, I’ll explain.
We have a “Resources” folder inside our “Assets” folder that holds scenes and other stuff. Now, when I build a player (web, iPhone, standalone) the filesize stays the same as when I delete the Resources folder and build again… strange.
But ok, I build with Resources and I can only use them when I copy the Resources folder over to the player manualy which is no problem with the web or standalone player and works great, but it is a problem on the iPhone :?
The resources folder is of no use if it is not present at build. the player can’t use it as the data within it are processed and stored in special handlings.
if a project build (the build folder / app folder altogether, not the executable) results in the same sizes in both cases the build is likely not working correctly