From cf58771365b5953c6eac548b172aae880d1f0acd Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Sun, 19 May 2024 17:03:57 +0800 Subject: * rename --- Thronefall_1_57/Decompile/Ara/TrailSection.cs | 57 --------------------------- 1 file changed, 57 deletions(-) delete mode 100644 Thronefall_1_57/Decompile/Ara/TrailSection.cs (limited to 'Thronefall_1_57/Decompile/Ara/TrailSection.cs') diff --git a/Thronefall_1_57/Decompile/Ara/TrailSection.cs b/Thronefall_1_57/Decompile/Ara/TrailSection.cs deleted file mode 100644 index f530aef..0000000 --- a/Thronefall_1_57/Decompile/Ara/TrailSection.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace Ara; - -[CreateAssetMenu(menuName = "Ara Trails/Trail Section")] -public class TrailSection : ScriptableObject -{ - [HideInInspector] - public List vertices; - - public int snapX; - - public int snapY; - - public int Segments => vertices.Count - 1; - - public void OnEnable() - { - if (vertices == null) - { - vertices = new List(); - CirclePreset(8); - } - } - - public void CirclePreset(int segments) - { - vertices.Clear(); - for (int i = 0; i <= segments; i++) - { - float f = MathF.PI * 2f / (float)segments * (float)i; - vertices.Add(Mathf.Cos(f) * Vector2.right + Mathf.Sin(f) * Vector2.up); - } - } - - public static int SnapTo(float val, int snapInterval, int threshold) - { - int num = (int)val; - if (snapInterval <= 0) - { - return num; - } - int num2 = Mathf.FloorToInt(val / (float)snapInterval) * snapInterval; - int num3 = num2 + snapInterval; - if (num - num2 < threshold) - { - return num2; - } - if (num3 - num < threshold) - { - return num3; - } - return num; - } -} -- cgit v1.1-26-g67d0