View Issue Details

IDProjectCategoryView StatusLast Update
0002372NoesisGUIUnity3Dpublic2022-11-15 13:01
Reporterismael_aheartful Assigned Tojsantos  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.1.4 
Target Version3.1.6Fixed in Version3.1.6 
Summary0002372: Custom Animations Unsupported on Unity / C#
DescriptionI ran into an issue in our project with animations. I was trying to create a panel that can fade In/Out in the middle of the other animation, interrupting the Fade In for the Fade Out, or the other way around, starting the animation with the current opacity value (only using "To", not "From"). I created a custom animation extending from DoubleAnimation in our Blend project, to solve the issue with the duration of those animations having always the same duration with less value difference, and changed it to have constant speed or delta, so the animation feels the same with any starting opacity value.

The problem is that it is not supported on C#/Unity, as I was being told in the forums by jsantos, after I tried the code and Found that there's no way to extend any base or defined animation class in the Noesis package. So for the moment I have to approach the issue adjusting the design a bit.

Here's a simple snippet of the class that works as intented on Blend.


using System;
using System.Windows;
using System.Windows.Media.Animation;

public class DoubleFixedSpeedAnimation : DoubleAnimation {

        public static readonly DependencyProperty ValuePerSecondProperty = DependencyProperty.Register("ValuePerSecond", typeof(double), typeof(DoubleFixedSpeedAnimation));

        public double ValuePerSecond {
            get { return (double)GetValue(ValuePerSecondProperty); }
            set { SetValue(ValuePerSecondProperty, value); }
        }
        protected override Freezable CreateInstanceCore() {
            return new DoubleFixedSpeedAnimation();
        }
        protected override double GetCurrentValueCore(double defaultOriginValue, double defaultDestinationValue, AnimationClock animationClock) {
            double destinationValue = To ?? defaultDestinationValue;
            double originValue = From ?? defaultOriginValue;
            double value = originValue + ValuePerSecond * animationClock.CurrentTime.Value.TotalSeconds;
            return ValuePerSecond > 0 ? Math.Min(destinationValue, value) : Math.Max(destinationValue, value);
        }
    }
Steps To Reproduce- Implement a class extending from AnimationBase or any implemented animation like DoubleAnimation.
- Works on Blend project.
- Unsupported on Unity.
TagsAnimations, C#, Unity
PlatformAny

Relationships

related to 0002260 resolvedjsantos Inheriting from AnimationTimeline is not supported yet in C# 

Activities

Issue History

Date Modified Username Field Change
2022-07-05 12:38 ismael_aheartful New Issue
2022-07-05 12:38 ismael_aheartful Tag Attached: Animations
2022-07-05 12:38 ismael_aheartful Tag Attached: C#
2022-07-05 12:38 ismael_aheartful Tag Attached: Unity
2022-07-05 16:43 jsantos Assigned To => jsantos
2022-07-05 16:43 jsantos Status new => assigned
2022-07-05 16:43 jsantos Target Version => 3.1.6
2022-11-07 17:13 sfernandez Target Version 3.1.6 => 3.1.7
2022-11-07 17:16 sfernandez Target Version 3.1.7 => 3.1.6
2022-11-07 17:20 sfernandez Relationship added related to 0002260
2022-11-15 13:01 sfernandez Status assigned => resolved
2022-11-15 13:01 sfernandez Resolution open => fixed
2022-11-15 13:01 sfernandez Fixed in Version => 3.1.6
2022-11-15 13:01 sfernandez Note Added: 0008155