This commit is contained in:
SoulliesOfficial
2025-10-23 00:49:44 -04:00
parent 9b1b5ca93f
commit 61a397dd4c
9846 changed files with 2618439 additions and 793547 deletions

View File

@@ -31,7 +31,9 @@ namespace MoreMountains.Tools
protected Vector3 _gizmoCenter;
protected Rigidbody _rigidbody;
#if MM_PHYSICS2D
protected Rigidbody2D _rigidbody2D;
#endif
/// <summary>
/// On Awake we grab our components and set our center of mass if needed
@@ -63,7 +65,9 @@ namespace MoreMountains.Tools
protected virtual void Initialization()
{
_rigidbody = this.gameObject.MMGetComponentNoAlloc<Rigidbody>();
#if MM_PHYSICS2D
_rigidbody2D = this.gameObject.MMGetComponentNoAlloc<Rigidbody2D>();
#endif
}
/// <summary>
@@ -76,10 +80,12 @@ namespace MoreMountains.Tools
_rigidbody.centerOfMass = CenterOfMassOffset;
}
#if MM_PHYSICS2D
if (_rigidbody2D != null)
{
_rigidbody2D.centerOfMass = CenterOfMassOffset;
}
#endif
if (AutoDestroyComponentAfterSet)
{

View File

@@ -13,6 +13,6 @@ AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.7
assetPath: Assets/Feel/MMTools/Accessories/MMPhysics/MMRigidbodyCenterOfMass.cs
uploadId: 779587
packageVersion: 5.8
assetPath: Assets/OtherPlugins/Feel/MMTools/Accessories/MMPhysics/MMRigidbodyCenterOfMass.cs
uploadId: 799856

View File

@@ -10,6 +10,7 @@ namespace MoreMountains.Tools
[AddComponentMenu("More Mountains/Tools/Rigidbody Interface/MM Rigidbody Interface")]
public class MMRigidbodyInterface : MonoBehaviour
{
#if MM_PHYSICS2D
/// <summary>
/// Returns the rigidbody's position
/// </summary>
@@ -312,5 +313,6 @@ namespace MoreMountains.Tools
}
}
}
#endif
}
}

View File

@@ -15,6 +15,6 @@ AssetOrigin:
serializedVersion: 1
productId: 183370
packageName: Feel
packageVersion: 5.7
assetPath: Assets/Feel/MMTools/Accessories/MMPhysics/MMRigidbodyInterface.cs
uploadId: 779587
packageVersion: 5.8
assetPath: Assets/OtherPlugins/Feel/MMTools/Accessories/MMPhysics/MMRigidbodyInterface.cs
uploadId: 799856