diff options
| author | chai <215380520@qq.com> | 2024-05-20 22:36:58 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2024-05-20 22:36:58 +0800 |
| commit | a22c505984697881f5f911a165ee022087b69e09 (patch) | |
| tree | d3c030aef1ae9b8a01c889dd2902bb1e3324e72b /Thronefall_1_0/Decompile/SharpCornerMidigator.cs | |
| parent | 4a4cc82d069b26bc4d4532e73860f86b211ca239 (diff) | |
Diffstat (limited to 'Thronefall_1_0/Decompile/SharpCornerMidigator.cs')
| -rw-r--r-- | Thronefall_1_0/Decompile/SharpCornerMidigator.cs | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/Thronefall_1_0/Decompile/SharpCornerMidigator.cs b/Thronefall_1_0/Decompile/SharpCornerMidigator.cs deleted file mode 100644 index 66500db..0000000 --- a/Thronefall_1_0/Decompile/SharpCornerMidigator.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Collections.Generic; -using Pathfinding; -using UnityEngine; - -public class SharpCornerMidigator : MonoModifier -{ - public float extendCorners = 2f; - - private List<Vector3> path; - - private Vector3 pathPointLast; - - private Vector2 toLastPoint; - - private Vector2 toNextPoint; - - private float angle; - - private Vector2 normal2d; - - private float strngth; - - private Vector3 normal; - - public override int Order => 100; - - public override void Apply(Path _p) - { - if (_p.path != null && _p.path.Count != 0 && _p.vectorPath != null && _p.vectorPath.Count != 0) - { - path = _p.vectorPath; - pathPointLast = path[0]; - for (int i = 1; i < path.Count - 1; i++) - { - toLastPoint = new Vector2(pathPointLast.x, pathPointLast.z) - new Vector2(path[i].x, path[i].z); - toNextPoint = new Vector2(path[i + 1].x, path[i + 1].z) - new Vector2(path[i].x, path[i].z); - angle = Vector2.Angle(toLastPoint, toNextPoint); - normal2d = -(toLastPoint.normalized + toNextPoint.normalized).normalized; - strngth = (180f - angle) / 180f; - normal = new Vector3(normal2d.x, 0f, normal2d.y); - pathPointLast = path[i]; - path[i] += normal * strngth * extendCorners; - } - } - } -} |
