10using System.Collections;
11using System.Collections.Generic;
19 get {
return Provider._onPrePhysics; }
20 set {
Provider._onPrePhysics = value; }
24 get {
return Provider._onPostPhysics; }
25 set {
Provider._onPostPhysics = value; }
39 GameObject parent =
new GameObject(
"Physics Callbacks Provider");
40 parent.transform.position =
new Vector3(-10000F, -10000F, -10000F);
42 GameObject trigger0 =
new GameObject(
"OnPostPhysics Trigger 0");
43 trigger0.transform.parent = parent.transform;
44 trigger0.transform.localPosition = Vector3.zero;
45 var body = trigger0.AddComponent<Rigidbody>();
46 body.isKinematic =
true;
47 var box = trigger0.AddComponent<BoxCollider>();
50 GameObject trigger1 = Instantiate<GameObject>(trigger0);
51 trigger1.name =
"OnPostPhysics Trigger 1";
52 trigger1.transform.parent = parent.transform;
53 trigger1.transform.localPosition = Vector3.zero;
56 return postPhysicsTrigger;
59 private Action _onPrePhysics = () => { };
60 private Action _onPostPhysics = () => { };
66 void OnTriggerStay() {
static Action OnPostPhysics
static Action OnPrePhysics
static PhysicsCallbacks _instance
static PhysicsCallbacks Provider