24 lines
580 B
C#
Raw Normal View History

2024-01-31 19:16:05 +08:00
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);
}
}
}