How to get resources

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

–Eric

But how can I load resources to my iPhone project (without downloading via WWW).

I heard you can drag resources to XCode that are installed with the app. Is there a documentation about this somewhere??

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

Yes, but I noticed that these resources aren’t compiled into the different players (web, iPhone, standalone). The size stays the same.

So for the other players it’s ok to copy over the resources folder afterwards (works great) but it’s a problem for the iPhone version.

I’m sorry I don’t understand your posting.

The whole content of the Resources folder is always copied to the player and its part of it.

Perhaps you should explain your explicit problem, what you try to do etc, cause I think we don’t talk about the same thing.

I think we do talk about the same :wink: 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