Beispiel #1
0
 //追尾移動
 protected void MoveAiming()
 {
     //目標角度の何%回転したかによって速度を変化させる
     rotPer = FuncBox.RotateToGameObject(gameObject, target, 180f, rotAnglePer);
     if (rotPer < acceleDeccleBorder)
     {
         //加速
         velocity += (velocity * accelerationScale) * Time.deltaTime;
     }
     else
     {
         //減速
         velocity -= (velocity * decelerationScale) * Time.deltaTime;
     }
     //最高速判定(減速にマイナスが設定してある場合もあるのでここでする)
     if (velocity >= maxVelocity)
     {
         velocity = maxVelocity;
     }
 }