void OnEnable() { RuntimeUtils.EnforceLibraryOrder(); rigidBody = gameObject.GetComponent <Rigidbody>(); rigidBody2D = gameObject.GetComponent <Rigidbody2D>(); ListenerNumber = RuntimeManager.AddListener(this); }
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); }
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); } }
void OnEnable() { RuntimeUtils.EnforceLibraryOrder(); rigidBody = gameObject.GetComponent <Rigidbody>(); rigidBody2D = gameObject.GetComponent <Rigidbody2D>(); if (RuntimeManager.AddListener(ListenerNumber) == false) { ListenerNumber = -1; this.enabled = false; } else { SetListenerLocation(); } }