protected override void Initialize(Human actor) { base.Initialize(actor); // Register bones if (((PlayHomeSettings)VR.Settings).EnableTouching) { int dbg1 = 0, dbg2 = 0, dbg3 = 0; foreach (var bone in SoftBones_V2) { dbg1++; DynamicColliderRegistry.RegisterDynamicBone(bone); } foreach (var bone in SoftBones_V1) { dbg2++; DynamicColliderRegistry.RegisterDynamicBone(bone); } foreach (var bone in SoftBones) { dbg3++; DynamicColliderRegistry.RegisterDynamicBone(bone); } VRLog.Debug("Got " + DynamicColliderRegistry.Bones.Count(x => true) + " Dynamic Bones registered, found " + dbg1 + " V2 Bones, " + dbg2 + " V1 Bones, " + dbg3 + " V0 Bones"); } }
protected override void CreateControllers() { base.CreateControllers(); foreach (var controller in new Controller[] { Left, Right }) { var boneCollider = CreateCollider(controller.transform, 0.06f); boneCollider.m_Center.y = -0.03f; boneCollider.m_Center.z = 0.01f; DynamicColliderRegistry.RegisterCollider(boneCollider, (b) => !IsNotBust(b)); boneCollider = CreateCollider(controller.transform, 0.08f); boneCollider.m_Center.y = -0.03f; boneCollider.m_Center.z = 0.01f; DynamicColliderRegistry.RegisterCollider(boneCollider, IsNotBust); } }
public override void OnDestroy() { base.OnDestroy(); DynamicColliderRegistry.Clear(); }