예제 #1
0
파일: Moving.cs 프로젝트: witia87/Overhaul
        public override UnitState FixedUpdate()
        {
            var globalLookDirection = Parameters.LookLogicDirection;
            var moveScaledLogicDirection = Parameters.MoveScaledLogicDirection;
            var parametersAngle =
                AngleCalculator.CalculateLogicAngle(moveScaledLogicDirection, globalLookDirection);
            var logicLookDirection = GetLogicVector(globalLookDirection);

            if (Mathf.Abs(parametersAngle) <= 120)
            {
                ManageReachingLegsTurnDirection(logicLookDirection,
                     moveScaledLogicDirection.normalized);
            }
            else
            {
                ManageReachingLegsTurnDirection(logicLookDirection,
                    -moveScaledLogicDirection.normalized);
            }

            Torso.TurnTowards(logicLookDirection);
            Torso.AimAt(Parameters.AimAtDirection);
            Legs.Move(moveScaledLogicDirection);
            Legs.StraightenUp();
            Torso.Move(moveScaledLogicDirection);
            Torso.StraightenUp();
            return this;
        }
예제 #2
0
파일: Gliding.cs 프로젝트: witia87/Overhaul
        public override UnitState FixedUpdate()
        {
            Torso.TurnTowards(Parameters.LookLogicDirection);
            //Torso.StraightenUp(Mathf.Abs(Vector3.Dot(Torso.transform.up, Vector3.up) * 0.4f));
            //Legs.(Mathf.Abs(Vector3.Dot(Legs.transform.up, Vector3.up) * 0.2f));

            return(this);
        }
예제 #3
0
        public override UnitState FixedUpdate()
        {
            var logicLookDirection = GetLogicVector(Parameters.LookLogicDirection);

            Torso.TurnTowards(logicLookDirection);
            Torso.AimAt(Parameters.AimAtDirection);

            ManageReachingLegsTurnDirection(logicLookDirection, logicLookDirection);

            Legs.StraightenUp();
            Torso.StraightenUp();
            return(this);
        }