Hello, I am trying to predefined list of avtars for my game by using below Snippet.
public void createAvtarList(){
for(int i=1; i<9;i++){ filePath = Application.dataPath + "/Marine/Resources/MainMenu/btnAvtar" + i + ".png";
Debug.Log(filePath);
filePath = filePath.Replace("/Data/","/");
Debug.Log("New File Path " + filePath);
if(FB.IsLoggedIn) avatarService.CreateAvatar(("btnAvtar" + i),Login.fbUserName,filePath,avatarName,null);
}
}
and I am getting below error whenever i call the createAvtarList(), from the Xcode Debugger
New File Path /var/mobile/Applications/72643827-CF83-421E-8BF7-9EB28B3D8DAE/MY.app/Marine/Resources/MainMenu/btnAvtar1.png
(Filename: /Applications/buildAgent/work/d3d49558e4d408f4/artifacts/iPhonePlayer-armv7Generated/UnityEngineDebug.cpp Line: 53)
IsolatedStorageException: Could not find a part of the path "/var/mobile/Applications/72643827-CF83-421E-8BF7-9EB28B3D8DAE/MY.app/Marine/Resources/MainMenu/btnAvtar1.png".
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
at System.IO.File.OpenRead (System.String path) [0x00000] in <filename unknown>:0
at System.IO.File.ReadAllBytes (System.String path) [0x00000] in <filename unknown>:0
at com.shephertz.app42.paas.sdk.csharp.connection.RESTConnectorWWW.ExecuteMultipart (System.String name, System.String filePath, System.Collections.Generic.Dictionary`2 queryParams, System.Collections.Generic.Dictionary`2 postParams, System.Collections.Generic.Dictionary`2 headerParams, System.String url, System.String accept, App42CallBack callBack) [0x00000] in <filename unknown>:0
at com.shephertz.app42.paas.sdk.csharp.avatar.AvatarService.CreateAvatar (System.String avatarName, System.String userName, System.String filePath, System.String description, App42CallBack callBack) [0x00000] in <filename unknown>:0
at newAvatarScript.createAvtarList () [0x00000] in <filename unknown>:0
at newAvatarScript.OnGUI () [0x00000] in <filename unknown>:0
Help me Please
Thanks