示例#1
0
 public static CCAnimationCache sharedAnimationCache()
 {
     if (s_pSharedAnimationCache == null)
     {
         s_pSharedAnimationCache = new CCAnimationCache();
         s_pSharedAnimationCache.init();
     }
     return(s_pSharedAnimationCache);
 }
		/** Retruns ths shared instance of the Animation cache */
        public static CCAnimationCache sharedAnimationCache()
        {
            if (null == s_pSharedAnimationCache)
            {
                s_pSharedAnimationCache = new CCAnimationCache();
                s_pSharedAnimationCache.init();
            }

            return s_pSharedAnimationCache;
        }
示例#3
0
        // Animation

        /// <summary>
        /// changes the display frame with animation name and index.
        /// The animation name will be get from the CCAnimationCache
        /// @since v0.99.5
        /// </summary>
        public void setDisplayFrameWithAnimationName(string animationName, int frameIndex)
        {
            Debug.Assert(animationName != null);

            CCAnimation a = CCAnimationCache.sharedAnimationCache().animationByName(animationName);

            Debug.Assert(a != null);

            CCSpriteFrame frame = a.getFrames()[frameIndex];

            Debug.Assert(frame != null);

            DisplayFrame = frame;
        }
示例#4
0
 public static void PurgeSharedAnimationCache()
 {
     s_pSharedAnimationCache = null;
 }
示例#5
0
 public static void purgeSharedAnimationCache()
 {
     s_pSharedAnimationCache = null;
 }
示例#6
0
        public void setDisplayFrameWithAnimationName(string animationName, int frameIndex)
        {
            CCSpriteFrame frame = CCAnimationCache.sharedAnimationCache().animationByName(animationName).getFrames()[frameIndex];

            this.DisplayFrame = frame;
        }
 /** Purges the cache. It releases all the CCAnimation objects and the shared instance.
 */
 public static void purgeSharedAnimationCache()
 {
     //CC_SAFE_RELEASE_NULL(s_pSharedAnimationCache);
     s_pSharedAnimationCache = null;
 }