示例#1
0
        public void Remove(JSONStorable storable, JSONStorableFloat jsf)
        {
            var target = TargetFloatParams.FirstOrDefault(c => c.storable == storable && c.floatParam == jsf);

            if (target == null)
            {
                return;
            }
            TargetFloatParams.Remove(target);
            target.Dispose();
            onTargetsListChanged.Invoke();
        }
示例#2
0
        public void Remove(FreeControllerV3 controller)
        {
            var target = TargetControllers.FirstOrDefault(c => c.controller == controller);

            if (target == null)
            {
                return;
            }
            TargetControllers.Remove(target);
            target.Dispose();
            onTargetsListChanged.Invoke();
        }
        public void Paste(float time, AtomClipboardEntry clipboard, bool dirty = true)
        {
            if (loop && time >= animationLength - float.Epsilon)
            {
                time = 0f;
            }

            time = time.Snap();

            foreach (var entry in clipboard.controllers)
            {
                var target = targetControllers.FirstOrDefault(c => c.controller == entry.controller);
                if (target == null)
                {
                    SuperController.LogError($"Cannot paste controller {entry.controller.name} in animation [{animationLayer}] {animationName} because the target was not added.");
                    continue;
                }
                target.SetCurveSnapshot(time, entry.snapshot, dirty);
            }
            foreach (var entry in clipboard.floatParams)
            {
                var target = targetFloatParams.FirstOrDefault(c => c.storableId == entry.storableId && c.floatParamName == entry.floatParamName);
                if (target == null)
                {
                    SuperController.LogError($"Cannot paste storable {entry.storableId}/{entry.floatParamName} in animation [{animationLayer}] {animationName} because the target was not added.");
                    continue;
                }
                target.SetCurveSnapshot(time, entry.snapshot, dirty);
            }
            foreach (var entry in clipboard.triggers)
            {
                if (!dirty)
                {
                    throw new InvalidOperationException("Cannot paste triggers without dirty");
                }
                var target = targetTriggers.FirstOrDefault(t => t.name == entry.name) ?? targetTriggers.FirstOrDefault();
                if (target == null)
                {
                    SuperController.LogError($"Cannot paste triggers {entry.name} in animation [{animationLayer}] {animationName} because the target was not added.");
                    continue;
                }
                target.SetCurveSnapshot(time, entry.snapshot);
            }
        }
 public void Remove(JSONStorable storable, JSONStorableFloat jsf)
 {
     Remove(targetFloatParams.FirstOrDefault(c => c.storable == storable && c.floatParam == jsf));
 }
 public void Remove(FreeControllerV3 controller)
 {
     Remove(targetControllers.FirstOrDefault(c => c.controller == controller));
 }