I have an error on Xamarin And CocosSharp (CocosSharp PCL), when I am loading Sprite Sheets the app Closes without error, the code loads around 46 spriteSheets of one animation, in the second animation load at index 5 the apps closes, I have detected the line where the app closes. here is my code:
spriteSheet = new CCSpriteSheet(File);
class AnimatedSprite : Sprite
{
CCAnimation animation;
CCRepeatForever Repeat;
List<Resource> ImageList;
CCSpriteSheet spriteSheet;
public AnimatedSprite(AnimatedSpriteTemplate template)
: base(template.Folder + template.Screen_Resolution + "/" + template.Image_Prefix + template.Screen_Resolution + template.Image_NumberSubfix + "_00000" + template.Image_Subfix, template.Name, template.Section)
{
//animation = new CCAnimation();
List<CCSpriteFrame> animationFrames = new List<CCSpriteFrame>();
try
{
ImageList = new List<Resource>();
for (int i = 0; i < template.ImagesCount; i += 1)
{
string File = template.Folder + template.Screen_Resolution + "/" + template.Image_Prefix + template.Image_NumberSubfix;
File += i;
File += template.Image_Subfix;
spriteSheet = new CCSpriteSheet(File); //<--------- Here is the line
spriteSheet.Frames.ForEach(animationFrames.Add);
//**********************************************
LoadingScreen.LoadCount += 1;
//**********************************************
}
animation = new CCAnimation(animationFrames, 0.04f);
Repeat = new CCRepeatForever(new CCAnimate(animation));
cCSprite = new CCSprite(animationFrames.First()) { Name = template.Name };
//cCSprite.AddAction(Repeat);
}
catch(Exception ex)
{
System.Console.Write("MSPGSOFT:" + ex.Message);
}
}
}
I have to develop a game based 100% on animated sprites, so i really need any help, thank you all from now