Exemplo n.º 1
0
        /*
         * public CCScene createSceneWithNodeGraphFromFile(string pCCBFileName, object owner, ref CCBAnimationManager animationManager)
         * {
         *
         * }
         */

        public CCScene CreateSceneWithNodeGraphFromFile(string fileName, object owner, CCSize parentSize,
                                                        ref CCBAnimationManager animationManager)
        {
            CCNode  node   = ReadNodeGraphFromFile(fileName, owner, parentSize, ref animationManager);
            CCScene pScene = new CCScene();

            pScene.AddChild(node);

            return(pScene);
        }
Exemplo n.º 2
0
        private bool Init()
        {
            // Setup action manager
            CCBAnimationManager pActionManager = new CCBAnimationManager();

            AnimationManager = pActionManager;

            // Setup resolution scale and container size
            _actionManager.RootContainerSize = CCDirector.SharedDirector.WinSize;

            return(true);
        }
Exemplo n.º 3
0
        public bool InitWithData(byte[] bytes, object owner)
        {
            // Setup action manager
            var pActionManager = new CCBAnimationManager();

            AnimationManager = pActionManager;

            // Setup byte array
            mBytes       = bytes;
            mCurrentByte = 0;
            mCurrentBit  = 0;

            mOwner = owner;

            // Setup resolution scale and container size
            mActionManager.RootContainerSize = CCDirector.SharedDirector.WinSize;

            return(true);
        }
Exemplo n.º 4
0
        public CCNode ReadNodeGraphFromData(byte[] bytes, object owner, CCSize parentSize)
        {
            _bytes       = bytes;
            _currentByte = 0;
            _currentBit  = 0;
            _owner       = owner;

            _actionManager.RootContainerSize = parentSize;
            _actionManager._owner            = _owner;
            _ownerOutletNodes   = new List <CCNode>();
            _ownerCallbackNodes = new List <CCNode>();

            Dictionary <CCNode, CCBAnimationManager> animationManagers = new Dictionary <CCNode, CCBAnimationManager>();
            CCNode pNodeGraph = ReadFileWithCleanUp(true, animationManagers);

            if (pNodeGraph != null && _actionManager.AutoPlaySequenceId != -1 && !_jsControlled)
            {
                // Auto play animations
                _actionManager.RunAnimationsForSequenceIdTweenDuration(_actionManager.AutoPlaySequenceId, 0);
            }
            // Assign actionManagers to userObject
            if (_jsControlled)
            {
                _nodesWithAnimationManagers = new List <CCNode>();
                _animationManagersForNodes  = new List <CCBAnimationManager>();
            }

            foreach (var pElement in animationManagers)
            {
                CCNode pNode = pElement.Key;
                CCBAnimationManager manager = animationManagers[pNode];
                pNode.UserObject = manager;

                if (_jsControlled)
                {
                    _nodesWithAnimationManagers.Add(pNode);
                    _animationManagersForNodes.Add(manager);
                }
            }

            return(pNodeGraph);
        }
Exemplo n.º 5
0
        public CCScene CreateSceneWithNodeGraphFromFile(string fileName, object owner, CCSize parentSize)
        {
            CCBAnimationManager dummy = null;

            return(CreateSceneWithNodeGraphFromFile(fileName, owner, parentSize, ref dummy));
        }
Exemplo n.º 6
0
        public CCNode ReadNodeGraphFromData(byte[] bytes, object owner, CCSize parentSize)
        {
            CCBAnimationManager dummy = null;

            return(ReadNodeGraphFromData(bytes, owner, parentSize, ref dummy));
        }
Exemplo n.º 7
0
        public CCNode ReadNodeGraphFromData(byte[] bytes, object owner, CCSize parentSize, ref CCBAnimationManager animationManager)
        {
            InitWithData(bytes, owner);
            mActionManager.RootContainerSize = parentSize;

            CCNode pNodeGraph = ReadFileWithCleanUp(true);

            if (pNodeGraph != null && mActionManager.AutoPlaySequenceId != -1)
            {
                // Auto play animations
                mActionManager.RunAnimations(mActionManager.AutoPlaySequenceId, 0);
            }

            // Return action manager by reference
            animationManager = mActionManager;

            return(pNodeGraph);
        }
Exemplo n.º 8
0
        public CCNode ReadNodeGraphFromFile(string fileName, object owner, CCSize parentSize, ref CCBAnimationManager animationManager)
        {
            string pPath = CCFileUtils.FullPathFromRelativePath(fileName);

            byte[] pBytes = CCFileUtils.GetFileBytes(pPath);
            CCNode ret    = ReadNodeGraphFromData(pBytes, owner, parentSize, ref animationManager);

            return(ret);
        }
Exemplo n.º 9
0
 public CCNode ReadNodeGraphFromFile(string fileName, object owner, ref CCBAnimationManager animationManager)
 {
     return(ReadNodeGraphFromFile(fileName, owner, CCDirector.SharedDirector.WinSize, ref animationManager));
 }
Exemplo n.º 10
0
        public CCNode ReadNodeGraphFromFile(string fileName, object owner, CCSize parentSize)
        {
            CCBAnimationManager dummy = null;

            return(ReadNodeGraphFromFile(fileName, owner, parentSize, ref dummy));
        }
Exemplo n.º 11
0
        public bool InitWithData(byte[] bytes, object owner)
        {
            // Setup action manager
            var pActionManager = new CCBAnimationManager();
            AnimationManager = pActionManager;

            // Setup byte array
            mBytes = bytes;
            mCurrentByte = 0;
            mCurrentBit = 0;

            mOwner = owner;

            // Setup resolution scale and container size
            mActionManager.RootContainerSize = CCDirector.SharedDirector.WinSize;

            return true;
        }
Exemplo n.º 12
0
        /*
        public CCScene createSceneWithNodeGraphFromFile(string pCCBFileName, object owner, ref CCBAnimationManager animationManager)
        {
            
        }
        */

        public CCScene CreateSceneWithNodeGraphFromFile(string fileName, object owner, CCSize parentSize,
                                                        ref CCBAnimationManager animationManager)
        {
            CCNode node = ReadNodeGraphFromFile(fileName, owner, parentSize, ref animationManager);
            CCScene pScene = new CCScene();
            pScene.AddChild(node);

            return pScene;
        }
Exemplo n.º 13
0
        public CCNode ReadNodeGraphFromData(byte[] bytes, object owner, CCSize parentSize, ref CCBAnimationManager animationManager)
        {
            InitWithData(bytes, owner);
            mActionManager.RootContainerSize = parentSize;

            CCNode pNodeGraph = ReadFileWithCleanUp(true);

            if (pNodeGraph != null && mActionManager.AutoPlaySequenceId != -1)
            {
                // Auto play animations
                mActionManager.RunAnimations(mActionManager.AutoPlaySequenceId, 0);
            }

            // Return action manager by reference
            animationManager = mActionManager;

            return pNodeGraph;
        }
Exemplo n.º 14
0
 public CCNode ReadNodeGraphFromFile(string fileName, object owner, CCSize parentSize, ref CCBAnimationManager animationManager)
 {
     string pPath = CCFileUtils.FullPathFromRelativePath(fileName);
     byte[] pBytes = CCFileUtils.GetFileBytes(pPath);
     CCNode ret = ReadNodeGraphFromData(pBytes, owner, parentSize, ref animationManager);
     return ret;
 }
Exemplo n.º 15
0
 public CCNode ReadNodeGraphFromFile(string fileName, object owner, ref CCBAnimationManager animationManager)
 {
     return ReadNodeGraphFromFile(fileName, owner, CCDirector.SharedDirector.WinSize, ref animationManager);
 }
Exemplo n.º 16
0
        private bool Init()
        {
            // Setup action manager
            CCBAnimationManager pActionManager = new CCBAnimationManager();
            AnimationManager = pActionManager;
            
            // Setup resolution scale and container size
            _actionManager.RootContainerSize = CCDirector.SharedDirector.WinSize;

            return true;
        }
Exemplo n.º 17
0
 public void setAnimationManager(CCBAnimationManager pAnimationManager)
 {
     mAnimationManager = pAnimationManager;
 }