Esempio n. 1
0
        /// <summary>
        /// Applies velocity to the <see cref="PseudoBody"/>.
        /// </summary>
        public virtual void ApplyVelocity()
        {
            if (!isActiveAndEnabled || Interactors.NonSubscribableElements.Count > 0 || VelocityProxy.ProxySource == null)
            {
                return;
            }

            VelocityEmitter.EmitVelocity();
            Facade.Target.ApplyVelocity(VelocityMultiplier.Result);
            VelocityProxy.ProxySource = null;
        }
        /// <summary>
        /// Applies velocity to the <see cref="PseudoBody"/>.
        /// </summary>
        public virtual void ApplyVelocity()
        {
            if (!isActiveAndEnabled || Interactors.NonSubscribableElements.Count > 0 || VelocityProxy.ProxySource == null)
            {
                return;
            }

            VelocityEmitter.EmitVelocity();
            Facade.PseudoBodyFacade.ListenToRigidbodyMovement();
            Facade.PseudoBodyFacade.PhysicsBody.velocity -= VelocityMultiplier.Result;
            VelocityProxy.ProxySource = null;
        }
 public void SetUp()
 {
     containingObject = new GameObject();
     subject          = containingObject.AddComponent <VelocityEmitter>();
 }
Esempio n. 4
0
 /// <summary>
 /// Emits whether the speed from <see cref="VelocityTracker"/> exceeded the <see cref="SpeedThreshold"/>.
 /// </summary>
 public virtual void Process()
 {
     VelocityEmitter.EmitSpeed();
 }