void OnEnable() { RuntimeUtils.EnforceLibraryOrder(); rigidBody = gameObject.GetComponent <Rigidbody>(); RuntimeManager.HasListener[ListenerNumber] = true; RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody); }
void SetListenerLocation() { if (rigidBody) { RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody, attenuationObject); } else { RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody2D, attenuationObject); } }
private void SetListenerLocation() { if ((bool)rigidBody) { RuntimeManager.SetListenerLocation(ListenerNumber, base.gameObject, rigidBody); } else { RuntimeManager.SetListenerLocation(ListenerNumber, base.gameObject, rigidBody2D); } }
void SetListenerLocation() { #if UNITY_PHYSICS_EXIST || !UNITY_2019_1_OR_NEWER if (rigidBody) { RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody, attenuationObject); } else #endif #if UNITY_PHYSICS2D_EXIST || !UNITY_2019_1_OR_NEWER if (rigidBody2D) { RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody2D, attenuationObject); } else #endif { RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, attenuationObject); } }
void Update() { RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody); }
void Start() { rigidBody = gameObject.GetComponent <Rigidbody>(); RuntimeManager.SetListenerLocation(gameObject, rigidBody); }