PC-20230316NUNE\Administrator b6461675a8 提交代码
2024-01-31 19:16:05 +08:00

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);
}
}
}