mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
24 lines
580 B
C#
24 lines
580 B
C#
|
using BepuPhysics.Collidables;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace Plugins.JNGame.BepuPhysics.Components
|
|||
|
{
|
|||
|
public class BPhysicsSphere : BPhysicsBase
|
|||
|
{
|
|||
|
|
|||
|
void Awake()
|
|||
|
{
|
|||
|
|
|||
|
if (this.Physics == null) return;
|
|||
|
Debug.Log("BPhysicsSphere");
|
|||
|
|
|||
|
this.Physics.Shapes.Add(this);
|
|||
|
var sphereShape = new Sphere(transform.localScale.x / 2);
|
|||
|
sphereShape.ComputeInertia(0.5f, out var sphereInertia);
|
|||
|
this.AddDynamic(sphereShape,sphereInertia);
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
}
|