Example #1
0
        /// <inheritdoc />
        public async Task <bool> LoadInputAnimationAsync(string filepath)
        {
            if (filepath.Length > 0)
            {
                try
                {
                    using (FileStream fs = new FileStream(filepath, FileMode.Open))
                    {
                        animation = await InputAnimation.FromStreamAsync(fs);

                        Debug.Log($"Loaded input animation from {filepath}");
                        Evaluate();

                        return(true);
                    }
                }
                catch (IOException ex)
                {
                    Debug.LogError(ex.Message);
                    animation = null;
                }
            }

            return(false);
        }
Example #2
0
        /// <inheritdoc />
        public bool LoadInputAnimation(string filepath)
        {
            if (filepath.Length > 0)
            {
                try
                {
                    using (FileStream fs = new FileStream(filepath, FileMode.Open))
                    {
                        animation = new InputAnimation();
                        animation.FromStream(fs);

                        Evaluate();

                        return(true);
                    }
                }
                catch (IOException ex)
                {
                    Debug.LogError(ex.Message);
                    animation = null;
                }
            }
            return(false);
        }
Example #3
0
 /// <inheritdoc />
 public override void Disable()
 {
     IsEnabled       = false;
     recordingBuffer = null;
     ResetStartTime();
 }
Example #4
0
 /// <inheritdoc />
 public override void Enable()
 {
     IsEnabled       = true;
     recordingBuffer = new InputAnimation();
 }
 public AnimationCurveEnumerable(InputAnimation animation)
 {
     this.animation = animation;
 }
 /// <inheritdoc />
 public override void Disable()
 {
     base.Disable();
     recordingBuffer = null;
     ResetStartTime();
 }
 /// <inheritdoc />
 public override void Enable()
 {
     base.Enable();
     recordingBuffer = new InputAnimation();
 }