public void addAnimationsWithDictionary(NSDictionary dictionary)
{
NSDictionary animations = dictionary.objectForKey<NSDictionary>("animations");
if ( animations == null ) {
CCDebug.Log("cocos2d: CCAnimationCache: No animations were found in provided dictionary.");
return;
}
int version = 1;
NSDictionary properties = dictionary.objectForKey<NSDictionary>("properties");
if( properties != null )
version = properties.objectForKey<int>("format");
NSArray spritesheets = properties.objectForKey<NSArray>("spritesheets");
var enumerator = spritesheets.GetEnumerator();
while (enumerator.MoveNext()) {
string name = (string)enumerator.Current;
CCSpriteFrameCache.sharedSpriteFrameCache.addSpriteFramesWithFile(name);
}
switch (version) {
case 1:
parseVersion1(animations);
break;
case 2:
parseVersion2(animations);
break;
default:
NSUtils.Assert(false, "Invalid animation format");
break;
}
}