Ejemplo n.º 1
0
        public void ApplyKickback(FixedUpdateEvent evt, KickbackNode weapon, [JoinByTank] TankNode tank)
        {
            KickbackComponent   kickback = weapon.kickback;
            MuzzleLogicAccessor accessor = new MuzzleLogicAccessor(weapon.muzzlePoint, weapon.weaponInstance);
            float deltaTime = evt.DeltaTime;

            VulcanPhysicsUtils.ApplyVulcanForce(((-accessor.GetFireDirectionWorld() * kickback.KickbackForce) * WeaponConstants.WEAPON_FORCE_MULTIPLIER) * deltaTime, tank.rigidbody.Rigidbody, accessor.GetWorldMiddlePosition(), tank.tankFalling, tank.track);
        }
Ejemplo n.º 2
0
        public void ApplyVulcanImpact(VulcanImpactEvent evt, TankNode tank)
        {
            Rigidbody body = tank.rigidbody.Rigidbody;

            VulcanPhysicsUtils.ApplyVulcanForce(evt.Force, body, MathUtil.LocalPositionToWorldPosition(evt.LocalHitPoint, body.gameObject), tank.tankFalling, tank.track);
        }