Пример #1
0
        public void Bind(AtomAnimationEditContext ctx)
        {
            animationEditContext = ctx;

            _controlPanel.Bind(ctx);
            _curveType.Bind(ctx);
            _curves.Bind(ctx);
        }
Пример #2
0
 public void Bind(AtomAnimationEditContext animationEditContext)
 {
     if (_animationEditContext != null)
     {
         throw new InvalidOperationException("Cannot bind to animation twice");
     }
     _animationEditContext = animationEditContext;
     _animationEditContext.onTargetsSelectionChanged.AddListener(OnTargetsSelectionChanged);
     OnTargetsSelectionChanged();
 }
        public static JSONClass SerializeEditContext(AtomAnimationEditContext animationEditContext)
        {
            var animationEditContextJSON = new JSONClass
            {
                { "AutoKeyframeAllControllers", animationEditContext.autoKeyframeAllControllers ? "1" : "0" },
                { "Snap", animationEditContext.snap.ToString(CultureInfo.InvariantCulture) },
                { "Locked", animationEditContext.locked ? "1" : "0" },
                { "ShowPaths", animationEditContext.showPaths ? "1" : "0" },
            };

            return(animationEditContextJSON);
        }
        public void DeserializeAnimationEditContext(AtomAnimationEditContext animationEditContext, JSONClass animationEditContextJSON)
        {
            if (animationEditContext == null)
            {
                throw new ArgumentNullException(nameof(animationEditContext));
            }

            animationEditContext.autoKeyframeAllControllers = DeserializeBool(animationEditContextJSON["AutoKeyframeAllControllers"], false);
            animationEditContext.snap      = DeserializeFloat(animationEditContextJSON["Snap"], 0.1f);
            animationEditContext.locked    = DeserializeBool(animationEditContextJSON["Locked"], false);
            animationEditContext.showPaths = DeserializeBool(animationEditContextJSON["ShowPaths"], false);
        }
Пример #5
0
        public void Bind(AtomAnimationEditContext animationEditContext)
        {
            UnbindAnimation();

            _animationEditContext = animationEditContext;
            _animationEditContext.onTimeChanged.AddListener(OnTimeChanged);
            _animationEditContext.onCurrentAnimationChanged.AddListener(OnCurrentAnimationChanged);
            _animationEditContext.animation.onAnimationSettingsChanged.AddListener(OnAnimationSettingsChanged);

            BindClip(_animationEditContext.current);
            SetScrubberPosition(_animationEditContext.clipTime, true);
        }
Пример #6
0
        private void UnbindAnimation()
        {
            if (_animationEditContext == null)
            {
                return;
            }

            _animationEditContext.onTimeChanged.RemoveListener(OnTimeChanged);
            _animationEditContext.onCurrentAnimationChanged.RemoveListener(OnCurrentAnimationChanged);
            _animationEditContext = null;

            UnbindClip();
        }
Пример #7
0
 public void Bind(AtomAnimationEditContext animationEditContext)
 {
     _animationEditContext = animationEditContext;
     if (_scrubber != null)
     {
         _scrubber.animationEditContext = animationEditContext;
     }
     if (_dopeSheet != null)
     {
         _dopeSheet.Bind(animationEditContext);
     }
     _animationEditContext.animation.onClipsListChanged.AddListener(OnClipsListChanged);
     _animationEditContext.animation.onClipIsPlayingChanged.AddListener(OnClipIsPlayingChanged);
     _animationEditContext.onCurrentAnimationChanged.AddListener(OnCurrentAnimationChanged);
     _animationEditContext.onTimeChanged.AddListener(OnTimeChanged);
     SyncAnimationsListNow();
     _animationEditContext.current?.onAnimationSettingsChanged.AddListener(OnAnimationSettingsChanged);
     OnAnimationSettingsChanged(nameof(AtomAnimationClip.animationName));
 }
Пример #8
0
 public void Bind(AtomAnimationEditContext animationEditContext)
 {
     _animationEditContext             = animationEditContext;
     curveTypeJSON.setCallbackFunction = ChangeCurve;
     OnEnable();
 }