Exemple #1
0
        protected virtual NodeObject CreateObjectFromFile(ResourceItem resourceFile)
        {
            NodeObject result;

            if (resourceFile is ImageFile || resourceFile is PlistImageFile)
            {
                result = new SpriteObject(resourceFile as ResourceFile);
            }
            else
            {
                if (resourceFile is Project)
                {
                    Project project = resourceFile as Project;
                    if (project.IsGameProject())
                    {
                        result = new ProjectNodeObject(project);
                        return(result);
                    }
                }
                else if (resourceFile is AudioFile)
                {
                    result = new SimpleAudioObject(resourceFile as ResourceFile);
                    return(result);
                }
                result = null;
            }
            return(result);
        }
        public override void UpdateProperty(NodeObject node)
        {
            SpriteObject spriteObject = node as SpriteObject;

            if (spriteObject != null)
            {
                this.TextureFile = spriteObject.FileData;
            }
        }
        protected override void SetValue(object cObject, object cInnerObject)
        {
            base.SetValue(cObject, cInnerObject);
            SpriteObject spriteObject = cObject as SpriteObject;

            if (spriteObject != null)
            {
                spriteObject.FileData = this.FileData;
                spriteObject.FlipX    = this.FlipX;
                spriteObject.FlipY    = this.FlipY;
            }
        }
        protected void OnEnter()
        {
            SpriteObject spriteObject = ((Timeline)this.Timeline).Node as SpriteObject;

            if (spriteObject != null)
            {
                TimelineActionManager.Instance.CanAutoKey = false;
                spriteObject.IsRaiseStateChanged          = false;
                spriteObject.FileData                     = this.TextureFile;
                spriteObject.IsRaiseStateChanged          = true;
                TimelineActionManager.Instance.CanAutoKey = true;
            }
        }
        protected void OnEnter()
        {
            SpriteObject node = ((CocoStudio.Model.ViewModel.Timeline) this.Timeline).Node as SpriteObject;

            if (node == null)
            {
                return;
            }
            TimelineActionManager.Instance.CanAutoKey = false;
            node.IsRaiseStateChanged = false;
            node.FileData            = this.TextureFile;
            node.IsRaiseStateChanged = true;
            TimelineActionManager.Instance.CanAutoKey = true;
        }