Rename: Rough constraints to Lerp constraints

This commit is contained in:
KINDNICK
2026-08-21 22:43:29 +09:00
parent 150ef2d30c
commit a24acd2901
26 changed files with 225 additions and 59 deletions
@@ -1,10 +1,12 @@
using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.RoughConstraints
namespace Streamingle.Utils.LerpConstraints
{
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughAimConstraint")]
[ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Rough Aim Constraint")]
public class RoughAimConstraint : RoughConstraintBase
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Aim Constraint")]
public class LerpAimConstraint : LerpConstraintBase
{
[Header("Aim")]
public Vector3 aimAxis = Vector3.forward;
@@ -1,12 +1,13 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace Streamingle.Utils.RoughConstraints
namespace Streamingle.Utils.LerpConstraints
{
public enum RoughConstraintUpdateMode
public enum LerpConstraintUpdateMode
{
Update,
LateUpdate,
@@ -14,8 +15,9 @@ namespace Streamingle.Utils.RoughConstraints
Manual
}
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughConstraintBase")]
[ExecuteAlways]
public abstract class RoughConstraintBase : MonoBehaviour
public abstract class LerpConstraintBase : MonoBehaviour
{
[Header("Constraint")]
public bool constraintActive = true;
@@ -24,13 +26,13 @@ namespace Streamingle.Utils.RoughConstraints
[Range(0f, 1f)]
public float weight = 1f;
public List<RoughConstraintSource> sources = new List<RoughConstraintSource>();
public List<LerpConstraintSource> sources = new List<LerpConstraintSource>();
[Header("Rough Follow")]
[Header("Lerp Follow")]
[Min(0f)]
public float damping = 12f;
public RoughConstraintUpdateMode updateMode = RoughConstraintUpdateMode.LateUpdate;
public LerpConstraintUpdateMode updateMode = LerpConstraintUpdateMode.LateUpdate;
public bool useUnscaledTime;
public bool snapOnEnable = true;
@@ -47,7 +49,7 @@ namespace Streamingle.Utils.RoughConstraints
return 1f / 60f;
}
if (updateMode == RoughConstraintUpdateMode.FixedUpdate)
if (updateMode == LerpConstraintUpdateMode.FixedUpdate)
{
return useUnscaledTime ? Time.fixedUnscaledDeltaTime : Time.fixedDeltaTime;
}
@@ -94,7 +96,7 @@ namespace Streamingle.Utils.RoughConstraints
{
if (!Application.isPlaying)
{
if (updateMode != RoughConstraintUpdateMode.Manual)
if (updateMode != LerpConstraintUpdateMode.Manual)
{
Evaluate();
}
@@ -102,7 +104,7 @@ namespace Streamingle.Utils.RoughConstraints
return;
}
if (updateMode == RoughConstraintUpdateMode.Update)
if (updateMode == LerpConstraintUpdateMode.Update)
{
Evaluate();
}
@@ -115,7 +117,7 @@ namespace Streamingle.Utils.RoughConstraints
return;
}
if (updateMode == RoughConstraintUpdateMode.LateUpdate)
if (updateMode == LerpConstraintUpdateMode.LateUpdate)
{
Evaluate();
}
@@ -128,7 +130,7 @@ namespace Streamingle.Utils.RoughConstraints
return;
}
if (updateMode == RoughConstraintUpdateMode.FixedUpdate)
if (updateMode == LerpConstraintUpdateMode.FixedUpdate)
{
Evaluate();
}
@@ -165,7 +167,7 @@ namespace Streamingle.Utils.RoughConstraints
return;
}
if (Application.isPlaying || updateMode == RoughConstraintUpdateMode.Manual)
if (Application.isPlaying || updateMode == LerpConstraintUpdateMode.Manual)
{
return;
}
@@ -1,10 +1,10 @@
using System;
using UnityEngine;
namespace Streamingle.Utils.RoughConstraints
namespace Streamingle.Utils.LerpConstraints
{
[Serializable]
public struct RoughConstraintSource
public struct LerpConstraintSource
{
public Transform sourceTransform;
@@ -1,10 +1,12 @@
using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.RoughConstraints
namespace Streamingle.Utils.LerpConstraints
{
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughLookAtConstraint")]
[ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Rough Look At Constraint")]
public class RoughLookAtConstraint : RoughConstraintBase
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Look At Constraint")]
public class LerpLookAtConstraint : LerpConstraintBase
{
[Header("Look At")]
public Vector3 forwardAxis = Vector3.forward;
@@ -1,10 +1,12 @@
using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.RoughConstraints
namespace Streamingle.Utils.LerpConstraints
{
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughParentConstraint")]
[ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Rough Parent Constraint")]
public class RoughParentConstraint : RoughConstraintBase
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Parent Constraint")]
public class LerpParentConstraint : LerpConstraintBase
{
[Header("Position")]
public Vector3Bool constrainedPositionAxis = Vector3Bool.All;
@@ -1,10 +1,12 @@
using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.RoughConstraints
namespace Streamingle.Utils.LerpConstraints
{
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughPositionConstraint")]
[ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Rough Position Constraint")]
public class RoughPositionConstraint : RoughConstraintBase
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Position Constraint")]
public class LerpPositionConstraint : LerpConstraintBase
{
[Header("Position")]
public Vector3Bool constrainedAxis = Vector3Bool.All;
@@ -1,10 +1,12 @@
using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.RoughConstraints
namespace Streamingle.Utils.LerpConstraints
{
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughRotationConstraint")]
[ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Rough Rotation Constraint")]
public class RoughRotationConstraint : RoughConstraintBase
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Rotation Constraint")]
public class LerpRotationConstraint : LerpConstraintBase
{
[Header("Rotation")]
public Vector3Bool constrainedAxis = Vector3Bool.All;
@@ -1,10 +1,12 @@
using UnityEngine;
using UnityEngine.Scripting.APIUpdating;
namespace Streamingle.Utils.RoughConstraints
namespace Streamingle.Utils.LerpConstraints
{
[MovedFrom(true, "Streamingle.Utils.RoughConstraints", "Assembly-CSharp", "RoughScaleConstraint")]
[ExecuteAlways]
[AddComponentMenu("Streamingle Utilities/Constraints/Rough Scale Constraint")]
public class RoughScaleConstraint : RoughConstraintBase
[AddComponentMenu("Streamingle Utilities/Constraints/Lerp Scale Constraint")]
public class LerpScaleConstraint : LerpConstraintBase
{
[Header("Scale")]
public Vector3Bool constrainedAxis = Vector3Bool.All;
+1 -1
View File
@@ -1,6 +1,6 @@
using System;
namespace Streamingle.Utils.RoughConstraints
namespace Streamingle.Utils.LerpConstraints
{
[Serializable]
public struct Vector3Bool