diff --git a/Assets/OkapiKit/Data/MasterConfig.asset b/Assets/OkapiKit/Data/MasterConfig.asset index eda12042..ac904a23 100644 --- a/Assets/OkapiKit/Data/MasterConfig.asset +++ b/Assets/OkapiKit/Data/MasterConfig.asset @@ -13,3 +13,5 @@ MonoBehaviour: m_Name: MasterConfig m_EditorClassIdentifier: maxPingTime: 4 + displayConditions: 1 + displayHypertags: 1 diff --git a/Assets/OkapiKit/Scripts/Base/OkapiConfig.cs b/Assets/OkapiKit/Scripts/Base/OkapiConfig.cs index ad540829..d42e10a7 100644 --- a/Assets/OkapiKit/Scripts/Base/OkapiConfig.cs +++ b/Assets/OkapiKit/Scripts/Base/OkapiConfig.cs @@ -87,15 +87,19 @@ public static bool IsPinged(OkapiElement element) public static bool showTags => (instance) ? (instance.displayHypertags) : (false); public static bool showConditions => (instance) ? (instance.displayConditions) : (false); + static OkapiConfig _instance = null; + static OkapiConfig instance { get { + if (_instance) return _instance; + var allConfigs = FindAllInstances(); if (allConfigs.Count == 1) { - return allConfigs[0]; + _instance = allConfigs[0]; } - return null; + return _instance; } } diff --git a/Assets/OkapiKit/Scripts/Systems/Path.cs b/Assets/OkapiKit/Scripts/Systems/Path.cs index bb82c886..52d31668 100644 --- a/Assets/OkapiKit/Scripts/Systems/Path.cs +++ b/Assets/OkapiKit/Scripts/Systems/Path.cs @@ -127,6 +127,8 @@ private static Vector3 EvaluateCatmullRomDerivative(Vector3 p0, Vector3 p1, Vect public Vector2 EvaluateWorld(float t) { + if (worldSpace) return EvaluateLocal(t); + return transform.TransformPoint(EvaluateLocal(t)); } @@ -211,6 +213,8 @@ public Vector2 EvaluateLocal(float t) public Vector2 EvaluateWorldDir(float t) { + if (worldSpace) return EvaluateLocalDir(t); + return transform.TransformVector(EvaluateLocalDir(t)); } diff --git a/Assets/OkapiKit/Scripts/Systems/Spawner.cs b/Assets/OkapiKit/Scripts/Systems/Spawner.cs index fecd3d39..86f06d46 100644 --- a/Assets/OkapiKit/Scripts/Systems/Spawner.cs +++ b/Assets/OkapiKit/Scripts/Systems/Spawner.cs @@ -497,30 +497,23 @@ public int GetSpawnPointCount() } void GetWorldDirUp(Path path, float t, ref Vector2 dir, ref Vector2 up) - { - GetLocalDirUp(path, t, ref dir, ref up); - dir = path.transform.TransformVector(dir); - up = path.transform.TransformVector(up); - } - - void GetLocalDirUp(Path path, float t, ref Vector2 dir, ref Vector2 up) { switch (spawnRotation) { case SpawnRotation.AlignWithDirection: - dir = path.EvaluateLocalDir(t); + dir = path.EvaluateWorldDir(t); up = new Vector2(dir.y, -dir.x); break; case SpawnRotation.AlignWithInverseDirection: - dir = -path.EvaluateLocalDir(t); + dir = -path.EvaluateWorldDir(t); up = new Vector2(dir.y, -dir.x); break; case SpawnRotation.AlignWithPerpendicular: - up = path.EvaluateLocalDir(t); + up = path.EvaluateWorldDir(t); dir = new Vector2(up.y, -up.x); break; case SpawnRotation.AlignWithInversePerpendicular: - up = path.EvaluateLocalDir(t); + up = path.EvaluateWorldDir(t); dir = new Vector2(-up.y, up.x); break; default: diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 7fd26ac6..55a4c124 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,5 +1,10 @@ # Release Notes +## V1.10.1 + +- Fixed issue with world space path coordinates vs local space path coordinates +- Improved performance of Okapi UI elements significatly + ## V1.10.0 - Added circle, arc and polygon path