Ejemplo n.º 1
0
        // Update is called once per frame
        void Update()
        {
            if (!_moduleActive)
            {
                return;
            }
            DirectionType direction = GetDirection();

            if ((DirectionType.Stop != direction) &&
                (DirectionType.North != direction) &&
                (DirectionType.South != direction) &&
                (DirectionType.None != direction))
            {
                TransitionOutOfClimb();
                return;
            }
            ClimbType climbType = GetClimbType();

            if (DirectionType.Stop == direction)
            {
                climbType = ClimbType.Idle;
            }
            Speed = ClimbSpeed.GetSpeed(climbType);
            SetMove(direction, climbType);
        }
Ejemplo n.º 2
0
 public LocationSection(Guid locID, ClimbType type, ClimbGradeType gradeType, string name)
 {
     DefaultClimbTypeID = (byte)type;
     DefaultGradeTypeID = (byte)gradeType;
     LocationID         = locID;
     Name = name;
 }
Ejemplo n.º 3
0
 private void UpdateAnimation(ClimbType climbType)
 {
     if (ClimbType.Climbing == climbType)
     {
         Climbing();
     }
     else if (ClimbType.Idle == climbType)
     {
         Idle();
     }
 }
Ejemplo n.º 4
0
 public static float GetSpeed(ClimbType climbType)
 {
     if (ClimbType.Climbing == climbType)
     {
         return(ClimbSpeed.CLIMB_SPEED);
     }
     if (ClimbType.Idle == climbType)
     {
         return(ClimbSpeed.IDLE_SPEED);
     }
     return(0.0f);
 }
Ejemplo n.º 5
0
        private void SetMove(DirectionType direction, ClimbType climbType)
        {
            if ((CurrentMove.Direction == direction) && (CurrentMove.Climb == climbType))
            {
                return;
            }

            Vector3 tempVector = PreviousVector;

            PreviousVector = CurrentVector;
            CurrentVector  = ConvertForClimbing(Direction.ConvertDirectionToVector(direction, tempVector));
            PreviousMove   = CurrentMove;
            CurrentMove    = new ClimbMove(direction, climbType);
            UpdateAnimation(climbType);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Change between braced and hang climb
        /// </summary>
        /// <param name="m_ClimbType"></param>
        /// <returns></returns>
        IEnumerator ChangeClimbType(ClimbType m_ClimbType)
        {
            if (!m_Engine.IsCoroutinePlaying && !m_SideAdjustment)
            {
                m_Engine.IsCoroutinePlaying = true;

                string state = (m_ClimbType == ClimbType.Braced) ? m_HangToBracedStateName : m_BracedToHangStateName;

                if (m_ClimbType == ClimbType.Braced)
                {
                    if (m_ClimbIK != null)
                    {
                        m_ClimbIK.OnHang = false;
                    }
                }

                SetState(state);

                while (m_CurrentStatePlaying != state)
                {
                    yield return(null);
                }

                while (!m_AnimatorManager.HasFinishedAnimation(state))
                {
                    yield return(null);
                }

                state = (m_ClimbType == ClimbType.Braced) ? m_BracedHangStateName : m_HangStateName;

                if (m_ClimbType == ClimbType.Hang)
                {
                    if (m_ClimbIK != null)
                    {
                        m_ClimbIK.OnHang = true;
                    }
                }

                yield return(new WaitForSeconds(Time.fixedDeltaTime));

                SetState(state, 0.05f);
                m_Engine.IsCoroutinePlaying = false;
            }
        }
Ejemplo n.º 7
0
        public ActionResult getAreaByType(ClimbType type, String area)
        {
            if (type == ClimbType.Boulder)
            {
                var Boulders = _context.Boulders.ToList();


                var List1 = Boulders.Where(c => c.Area == area).Select(
                    c => new
                {
                    id   = c.BoulderID,
                    name = c.Name
                });

                foreach (var item in List1)
                {
                    Debug.WriteLine(item);
                }

                return(Json(List1));
            }
            else
            {
                var Sports = _context.Sports.ToList();


                var List1 = Sports.Where(c => c.Area == area).Select(
                    c => new
                {
                    ID   = c.SportID,
                    name = c.Name
                });



                return(Json(List1));
            }
        }
Ejemplo n.º 8
0
 public ClimbMove(DirectionType directionType, ClimbType climbType)
 {
     Direction = directionType;
     Climb     = climbType;
 }