Пример #1
0
        public override void Finish(Unit unit)
        {
            unit.UpdateControlState(UnitControlState.Charging, false);

            unit.AI.NavMeshAgentEnabled = false;
            unit.StopMoving();
        }
Пример #2
0
        public override void Finish(Unit unit)
        {
            unit.SetMovementFlag(MovementFlags.Charging, false);
            unit.UpdateControlState(UnitControlState.Charging, false);
            unit.Motion.UsesKinematicMovement = false;

            unit.StopMoving();
        }
Пример #3
0
        public override void Begin(Unit unit)
        {
            unit.AI.NavMeshAgentEnabled = true;
            unit.AI.UpdatePosition      = false;
            unit.AI.UpdateRotation      = true;
            unit.AI.Speed        = chargeSpeed;
            unit.AI.AngularSpeed = MovementUtils.ChargeRotationSpeed;

            unit.UpdateControlState(UnitControlState.Charging, true);
        }
Пример #4
0
        public override void Begin(Unit unit)
        {
            unit.UpdateControlState(UnitControlState.Charging, true);
            unit.Motion.UsesKinematicMovement = true;

            bezierCurvePoints[0] = unit.Position;
            bezierCurvePoints[1] = unit.Position + Vector3.up * 5f;
            bezierCurvePoints[2] = targetPoint + Vector3.up * 5f;
            bezierCurvePoints[3] = targetPoint;

            currentCurveTime = 0.0f;
            curveSpeed       = pounceSpeed / Vector3.Distance(unit.Position, targetPoint);

            unit.Rotation = Quaternion.LookRotation(Vector3.ProjectOnPlane(targetPoint - unit.Position, Vector3.up));

            unit.SetMovementFlag(MovementFlags.StrafeLeft, false);
            unit.SetMovementFlag(MovementFlags.StrafeRight, false);
            unit.SetMovementFlag(MovementFlags.Flying, true);
            unit.SetMovementFlag(MovementFlags.Charging, true);
        }