FPS ENGINE DOCUMENTATION
  • Welcome to FPS Engine!
  • BEFORE WE START
    • Early Considerations
    • List of Tutorials
    • List of Add-Ons & Compatible Packages
  • GETTING STARTED
    • 01. Basic set-up
    • 02. Roadmap
  • CONTENT
    • 03. Content
      • 03.1 CAMERA
        • MoveCamera
        • CameraFOVManager
      • 03.2 MOVEMENT
        • PlayerMovement
      • 03.3 PLAYER
        • PlayerStats
        • PlayerMultipliers
        • PLAYER STATES
          • PlayerStates
          • PlayerBaseState
          • PlayerStateFactory
        • WEAPON STATES
          • WeaponStates
          • WeaponBaseState
          • WeaponStateFactory
        • Player Debugging
      • 03.4 WEAPONS
        • Weapon_SO
        • WeaponIdentification
        • WeaponController
        • Bullet
        • ATTACHMENTS
          • Attachment.cs
            • Barrel.cs
            • Flashlight.cs
            • Magazine.cs
            • Scope.cs
            • Stock.cs
            • Laser.cs
            • Grip.cs
          • AttachmentIdentifier_SO.cs
      • 03.5 PICK UP SYSTEM
        • InteractManager
        • Interactable
        • Item_SO
        • Identifiable
        • Pickeable
          • WeaponPickeable
          • BulletsPickeable
          • AttachmentPickeable
      • 03.6 ENEMIES
        • IDamageable
        • EnemyHealth
        • TrainingTarget
        • CIrcularTargetEnemy
        • Turret
        • TurretProjectile
      • 03.7 EFFECTS
        • CameraEffects
        • CamShake
        • CrouchTilt
        • JumpMotion
        • ProceduralShot
        • ProceduralShot_SO
        • WeaponEffects
        • WeaponSway
      • 03.8 UI
        • CowsinsButton
        • Crosshair
        • CrosshairShape
        • Hitmarker
        • UIController
        • UIEvents
        • RebindUI
      • 03.8 EXTRA
        • Checkpoint
        • Coin
        • Compass
        • CompassElement
        • Destructible
        • Crate
        • ExplosiveBarrel
        • PowerUp
        • DamageMultiplier
        • HealMultiplierPowerUp
        • Healthpack
        • DoorInteractable
        • Experience
        • GetGameInformation
        • HurtTrigger
        • JumpPad
        • Lootbox
        • PauseMenu
        • PointCapture
        • Trigger
        • DraggableButtonInSceneView
        • UTILITIES
          • DestroyMe
          • IgnoreCollision
          • LookAt
          • CowsinsUtilities
      • 03.09 MANAGERS
        • CoinManager
        • ExperienceManager
        • GameSettingsManager
        • InputManager
        • SoundManager
        • PoolManager
  • HOW TO USE
    • Getting Started: First Steps
    • Importing FPS Engine into URP / HDRP
    • Add a Player Controller
    • Adding New Weapons
    • Saving & Loading Presets
    • Changing Keybindings
    • Creating New Pickeables
    • Controllable & Not Controllable Player
    • Adding New Surfaces ( Grounds )
    • Working with Attachments
    • Modify Weapon and Camera Effects
    • Adding Custom Key Rebinds
    • Add breakable (Destructible) objects
    • Custom Shot Weapons
    • Adding Enemies
  • FAQ
    • FAQ
  • SUPPORT
    • Support
Powered by GitBook
On this page
Export as PDF
  1. CONTENT
  2. 03. Content
  3. 03.8 EXTRA
  4. UTILITIES

CowsinsUtilities

PreviousLookAtNext03.09 MANAGERS

Last updated 10 months ago

Contains different utilities and functions that are accessible to use from any script.

If you want to use Cowsins Utilities, ensure you are using the cowsins library by adding the next snippet on top of your script:

using cowsins;

CowsinsUtilities is a static class.

Utilities | CowsinsUtilities.cs

GetSpreadDirection (float amount, Camera camera)

Returns a Vector3 that applies spread to the bullets. This is used in

  • amount: Amount of Spread to apply.

  • camera: Camera to calculate spread from.

PlayAnim (string anim, Animator animator)

Plays the specified animation on the specified Animator using Triggers.

  • anim: Name of the Animation To Play

  • animator: Animator to play the anim on.

ForcePlayAnim (string anim, Animator animator)

Force to play the specified animation on the specified Animator ignoring transitions

  • anim: Name of the Animation To Play

  • animator: Animator to play the anim on.

StartAnim (string anim, Animator animator)

Plays the specified animation on the specified Animator using Booleans.

  • anim: Name of the Animation To Play

  • animator: Animator to play the anim on.

StartAnim (string anim, Animator animator)

Stops the specified animation on the specified Animator using Booleans.

  • anim: Name of the Animation To Play

  • animator: Animator to play the anim on.

SavePreset (Object source, string name)

Saves a Preset.

  • source: Preset to save. This can be any object.

  • name: Names the Preset.

ApplyPreset(Preset preset, Object target)

Loads a Preset onto an object

  • preset: Preset to load.

  • target: Object to apply the preset to. This can be any object.

EmptyString(string string_)

Returns true if the string is empty

  • string_: String to verify.

GetDamageableParent(Transform child)

Given an object, finds if there is a parent that is an IDamageable

  • child: Transform to verify.

WeaponController