/// <summary>
 /// Initializes a new instance of the <see cref="Move2DByAnimation" /> class.
 /// </summary>
 /// <param name="targetObject">The target object.</param>
 /// <param name="targetVector">The target position of the object.</param>
 /// <param name="duration">The duration.</param>
 public Move2DToAnimation(IAnimatableObjectPosition2D targetObject, Vector2 targetVector, TimeSpan duration)
     : base(targetObject)
 {
     _targetObject  = targetObject;
     _targetVector  = targetVector;
     _paramDuration = duration;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Move2DByAnimation" /> class.
 /// </summary>
 /// <param name="targetObject">The target object.</param>
 /// <param name="targetVector">The target position of the object.</param>
 ///´<param name="speed">The total movement speed.</param>
 public Move2DToAnimation(IAnimatableObjectPosition2D targetObject, Vector2 targetVector, MovementSpeed speed)
     : base(targetObject)
 {
     _targetObject   = targetObject;
     _targetVector   = targetVector;
     _paramMoveSpeed = speed;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="Move2DByAnimation"/> class.
        /// </summary>
        /// <param name="targetObject">The target object.</param>
        /// <param name="moveVector">The move vector.</param>
        /// <param name="moveSpeed">The speed which is used for movement calculation.</param>
        public Move2DByAnimation(IAnimatableObjectPosition2D targetObject, Vector2 moveVector, MovementSpeed moveSpeed)
            : base(targetObject)
        {
            m_targetObject = targetObject;
            m_moveVector   = moveVector;
            m_moveHelper   = new MovementAnimationHelper(moveSpeed, new Vector3(moveVector, 0f));

            // Switch animation to fixed-time type
            base.ChangeToFixedTime(m_moveHelper.MovementTime);
        }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Move2DByAnimation" /> class.
        /// </summary>
        /// <param name="targetObject">The target object.</param>
        /// <param name="moveVector">The move vector.</param>
        /// <param name="duration">The duration.</param>
        public Move2DByAnimation(IAnimatableObjectPosition2D targetObject, Vector2 moveVector, TimeSpan duration)
            : base(targetObject)
        {
            _targetObject = targetObject;
            _moveVector   = moveVector;
            _moveHelper   = new MovementAnimationHelper(
                new MovementSpeed(new Vector3(moveVector, 0f), duration),
                new Vector3(moveVector, 0f));

            // Switch animation to fixed-time type
            this.ChangeToFixedTime(_moveHelper.MovementTime);
        }