示例#1
0
        /// <summary>
        /// Rewrites actions from this AvatarControls with actions from given AvatarControls with lower priority value.
        /// </summary>
        /// <param name="actions"></param>
        public void Update(IAvatarControls actions)
        {
            if (actions == null)
            {
                return;
            }

            DesiredForwardSpeed = actions.DesiredForwardSpeed;
            DesiredRightSpeed   = actions.DesiredRightSpeed;
            DesiredLeftRotation = actions.DesiredLeftRotation;
            Interact            = actions.Interact;
            Use    = actions.Use;
            PickUp = actions.PickUp;
            Fof    = actions.Fof;
        }
示例#2
0
 ///  <summary>
 ///
 ///  </summary>
 ///  <param name="priority"></param>
 /// <param name="desiredForwardSpeed"></param>
 /// <param name="desiredRightSpeed"></param>
 /// <param name="desiredRotation"></param>
 ///  <param name="interact"></param>
 ///  <param name="use"></param>
 ///  <param name="pickUp"></param>
 ///  <param name="fof"></param>
 public AvatarControls(
     int priority,
     float desiredForwardSpeed = 0f,
     float desiredRightSpeed   = 0f,
     float desiredRotation     = 0f,
     bool interact             = false,
     bool use    = false,
     bool pickUp = false,
     PointF fof  = default(PointF)
     )
     : this()
 {
     m_desiredForwardSpeed = new AvatarAction <float>(desiredForwardSpeed, priority);
     m_desiredRightSpeed   = new AvatarAction <float>(desiredRightSpeed, priority);
     m_desiredLeftRotation = new AvatarAction <float>(desiredRotation, priority);
     m_interact            = new AvatarAction <bool>(interact, priority);
     m_use    = new AvatarAction <bool>(use, priority);
     m_pickUp = new AvatarAction <bool>(pickUp, priority);
     m_fof    = new AvatarAction <PointF>(fof, priority);
 }