/// <summary> /// Applies velocity to the <see cref="BodyRepresentation"/>. /// </summary> public virtual void ApplyVelocity() { if (!isActiveAndEnabled || interactors.Elements.Any() || velocityProxy.proxySource == null) { return; } velocityEmitter.EmitVelocity(); facade.bodyRepresentationFacade.ListenToRigidbodyMovement(); facade.bodyRepresentationFacade.internalSetup.rigidbody.velocity += velocityMultiplier.Result; velocityProxy.ClearProxySource(); }
public void ClearProxySource() { GameObject sourceObject; VelocityTrackerMock.Generate(true, Vector3.one, Vector3.one, out sourceObject); subject.SetProxySource(sourceObject); Assert.AreEqual(sourceObject.TryGetComponent <Component>(), subject.proxySource); subject.ClearProxySource(); Assert.IsNull(subject.proxySource); Object.DestroyImmediate(sourceObject); }