protected override Vector3 GetDirection(TeleportDirectionMode mode, float angle)
        {
            if (mode != TeleportDirectionMode.UseSteerAngle)
            {
                return(base.GetDirection(mode, angle));
            }
            AvatarControlData controlData = (base.actor.entity as BaseMonoAvatar).GetInputController().controlData;

            if (controlData.orderMove)
            {
                return(controlData.steerDirection);
            }
            return(-(base.entity as BaseMonoAvatar).FaceDirection);
        }
Esempio n. 2
0
 public AvatarControlData CopyFrom(AvatarControlData controlData)
 {
     this.hasSteer           = controlData.hasSteer;
     this.steerDirection     = controlData.steerDirection;
     this.lerpRatio          = controlData.lerpRatio;
     this.hasOrderMove       = controlData.hasOrderMove;
     this.orderMove          = controlData.orderMove;
     this.hasSetAttackTarget = controlData.hasSetAttackTarget;
     this.attackTarget       = controlData.attackTarget;
     this.useAttack          = controlData.useAttack;
     this.useHoldAttack      = controlData.useHoldAttack;
     this.hasAnyControl      = controlData.hasAnyControl;
     controlData.useSkills.CopyTo(this.useSkills, 0);
     return(null);
 }
Esempio n. 3
0
        public override void Core()
        {
            AvatarControlData activeControlData = this._avatar.GetActiveControlData();

            if (activeControlData.hasAnyControl)
            {
                Vector3 steerDirection = activeControlData.steerDirection;
                Vector3 vector2        = steerDirection - this._lastSteer;
                this._accumulatedSteerAmount += vector2.sqrMagnitude;
                this._lastSteer = steerDirection;
                if (this._accumulatedSteerAmount > base.instancedAbility.Evaluate(this.config.UntieSteerAmount))
                {
                    base.actor.abilityPlugin.TryRemoveModifier(base.instancedModifier);
                }
            }
        }
 public override void Core()
 {
     if (this._state == State.InLoop)
     {
         AvatarControlData activeControlData = this._avatar.GetActiveControlData();
         if (activeControlData.hasSteer)
         {
             if (this._isSteer)
             {
                 Vector3 steerDirection = activeControlData.steerDirection;
                 this._avatar.SteerFaceDirectionTo(Vector3.Lerp(this._avatar.FaceDirection, steerDirection, this._steerSpeed * Time.deltaTime));
             }
             else
             {
                 this._avatar.SetHasAdditiveVelocity(true);
                 this._avatar.SetAdditiveVelocity((Vector3)(activeControlData.steerDirection * this._moveSpeed));
             }
             this._moveDirection = activeControlData.steerDirection;
             this.hasSteerBefore = true;
             this.inStoping      = false;
         }
         else if (!this._isSteer)
         {
             if (this.hasSteerBefore)
             {
                 this.hasSteerBefore = false;
                 this.inStoping      = true;
                 this._smoothTimer   = 0f;
             }
             if (this.inStoping)
             {
                 this._smoothTimer += Time.deltaTime * base.entity.TimeScale;
                 this._avatar.SetHasAdditiveVelocity(true);
                 this._avatar.SetAdditiveVelocity((Vector3)(this._moveDirection * Mathf.Lerp(0f, this._moveSpeed, 1f - (this._smoothTimer / 1f))));
                 if (this._smoothTimer > 1f)
                 {
                     this.inStoping    = false;
                     this._smoothTimer = 0f;
                 }
             }
         }
     }
 }