浏览代码

Merge branch 'demo-work' of https://github.com/Verasl/BoatAttack into demo-work

/demo-work
Andre McGrail 5 年前
当前提交
8ab096ca
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1
      Assets/Scripts/Boat/AIcontroller.cs
  2. 3
      Assets/Scripts/Boat/BoatController.cs

1
Assets/Scripts/Boat/AIcontroller.cs


if (idleTime > 4f)
{
Debug.Log($"AI boat {gameObject.name} was stuck, respawing.");
idleTime = 0f;
controller.ResetPosition();
}

3
Assets/Scripts/Boat/BoatController.cs


var resetMatrix = WaypointGroup.instance.GetClosestPointOnWaypoint(transform.position);
var resetPoint = resetMatrix.GetColumn(3);
resetPoint.y = spawnPosition.GetColumn(3).y;
transform.SetPositionAndRotation(resetPoint, resetMatrix.rotation);
engine.RB.position = resetPoint;
engine.RB.rotation = resetMatrix.rotation;
}
}

正在加载...
取消
保存