コード例 #1
0
        public override void StyleChanged(string styleName)
        {
            base.StyleChanged(styleName);
            switch (styleName)
            {
                case "animationPackage":
                    Package = _loader.Load((string)GetStyle(styleName));
                    //Debug.Log("Package changed to: " + Package);
                    break;

                case "animationId":
                    AnimationId = (string)GetStyle(styleName);
                    //Debug.Log("AnimationId changed to: " + AnimationId);
                    break;
            }
        }
コード例 #2
0
ファイル: CursorManager.cs プロジェクト: groov0v/edriven-gui
        /// <summary>
        /// Loads the animation package (specified by the XML file and additional graphics)
        /// </summary>
        /// <param name="packageConfigFilePath"></param>
        public void LoadPackage(string packageConfigFilePath)
        {
            // if path not changed, return
            if (_currentPackagePath == packageConfigFilePath)
                return;

            // remember current path
            _currentPackagePath = packageConfigFilePath;

            // remember current animation ID
            if (null != _stack.Current)
                _currentAnimId = _stack.Current;

            // dispose old package
            //if (null != _package)
            //    _package.Dispose();

            // load new package and cache it
            _package = _loader.Load(packageConfigFilePath);

            _cursorAnimator.Package = _package;

            // if animation playing, and there is the animation with the same ID in a new package
            // continue the same animation in another package
            if (null != _currentAnimId && null != _package.Animations[_currentAnimId])
            {
                // TODO: Totaly decouple animation descriptors and actual animations (textures), because of changing the package!!!
                _cursorAnimator.Play(_stack.Current);
            }
        }
コード例 #3
0
        public override void StylesInitialized()
        {
            base.StylesInitialized();

            Package = _loader.Load((string)GetStyle("animationPackage"));
            AnimationId = (string)GetStyle("animationId");
        }