void OnEnable()
 {
     RuntimeUtils.EnforceLibraryOrder();
     rigidBody      = gameObject.GetComponent <Rigidbody>();
     rigidBody2D    = gameObject.GetComponent <Rigidbody2D>();
     ListenerNumber = RuntimeManager.AddListener(this);
 }
示例#2
0
 void OnEnable()
 {
     RuntimeUtils.EnforceLibraryOrder();
     #if UNITY_PHYSICS_EXIST || !UNITY_2019_1_OR_NEWER
     rigidBody = gameObject.GetComponent <Rigidbody>();
     #endif
     #if UNITY_PHYSICS2D_EXIST || !UNITY_2019_1_OR_NEWER
     rigidBody2D = gameObject.GetComponent <Rigidbody2D>();
     #endif
     ListenerNumber = RuntimeManager.AddListener(this);
 }
示例#3
0
 void OnEnable()
 {
     RuntimeUtils.EnforceLibraryOrder();
     rigidBody   = gameObject.GetComponent <Rigidbody>();
     rigidBody2D = gameObject.GetComponent <Rigidbody2D>();
     try
     {
         ListenerNumber = RuntimeManager.AddListener(this);
     }
     catch (System.Exception e)
     {
         Debug.Log(e.Message);
     }
 }
示例#4
0
 void OnEnable()
 {
     RuntimeUtils.EnforceLibraryOrder();
     rigidBody   = gameObject.GetComponent <Rigidbody>();
     rigidBody2D = gameObject.GetComponent <Rigidbody2D>();
     if (RuntimeManager.AddListener(ListenerNumber) == false)
     {
         ListenerNumber = -1;
         this.enabled   = false;
     }
     else
     {
         SetListenerLocation();
     }
 }