Skip to content

Commit

Permalink
#15】一部避難所の当たり判定が発火しないバグ修正。ナビメッシュの焼き直し
Browse files Browse the repository at this point in the history
  • Loading branch information
tsyu12345 committed Dec 13, 2024
1 parent 76cc36a commit ac929d8
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 3 deletions.
4 changes: 2 additions & 2 deletions PLATEAUTutorial/Assets/Scenes/Tutorial-1.unity
Git LFS file not shown
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified PLATEAUTutorial/Assets/Scenes/Tutorial-1/NavMesh-SubTran 1.asset
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified PLATEAUTutorial/Assets/Scenes/Tutorial-1/NavMesh-SubTran.asset
Binary file not shown.
21 changes: 20 additions & 1 deletion PLATEAUTutorial/Assets/Scripts/T-1/ShelterEnvManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void Start() {

void OnDrawGizmos() {
Gizmos.color = gizmoColor; // Gizmoの色を設定
Gizmos.DrawWireSphere(spawnCenter, SpawnRadius); // 中心から半径のワイヤーフレームの球体を描画
DrawWireCircle(spawnCenter, SpawnRadius);
}

void FixedUpdate() {
Expand Down Expand Up @@ -168,4 +168,23 @@ private float GetCurrentEvacueeRate() {
}



private void DrawWireCircle(Vector3 center, float radius, int segments = 36) {
float angle = 0f;
float angleStep = 360f / segments;

Vector3 prevPoint = center + new Vector3(radius, 0, 0); // 初期点

for (int i = 1; i <= segments; i++) {
angle += angleStep;
float rad = Mathf.Deg2Rad * angle;

Vector3 newPoint = center + new Vector3(Mathf.Cos(rad) * radius, 5, Mathf.Sin(rad) * radius);
Gizmos.DrawLine(prevPoint, newPoint);

prevPoint = newPoint; // 次の線を描画するために現在の点を更新
}
}


}

0 comments on commit ac929d8

Please sign in to comment.