MOD!
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user