🎨
UVC
  • Introduction
  • Installation
    • Installing in New Project
    • Installing in Existing Project - SCK
    • Installing in Existing Project - MCK
  • Space Combat Kit Tour
  • Mech Combat Kit Tour
  • Player Setup
  • Vehicle Framework
    • Game Agents
    • Vehicles
    • Modules
      • Module Mounts
      • Modules
      • Module Types
      • Module Attachments
      • Display Module On UI
      • Module Managers
  • Input
    • General Input
    • Vehicle Input
    • Rewired Integration
  • Player/AI
  • Spaceships
    • Speed UI
    • Space Fighters
    • Capital Ships
  • Mechs
    • Speed UI
  • Vehicle Control Animations
  • Character Enter/Exit
  • Camera
    • Camera Setup
    • Vehicle Setup
    • Secondary Cameras
    • Death Camera
  • Weapons
    • Framework
      • Triggerables System
      • Weapon System
    • Vehicle Setup
      • Vehicle Weapons
      • Cursor Aiming
    • Projectile Weapons
    • Beam Weapons
    • Missile Weapons
    • Resource Handling (Ammo/Heat)
    • Turrets
    • HUD Weapon Info
    • Health Modifier Volumes
  • Radar
    • Radar Setup
    • Target Setup
    • Target Selectors
    • Trackable Types
    • Improving Radar Performance
    • Target Notification
    • Radar Audio
  • Health
    • Health Framework
      • Health
      • Damageable
      • Damage Receiver
      • Health Modifier
      • Health Types
      • Health Modifier Types
      • Surface Types
    • Vehicle Setup
    • Damageable Object Setup
    • Detonators
    • Health Recharge
    • Health UI
    • Energy Shield
    • Damageable Module Linkers
  • HUD
    • HUD Basics
    • HUD Manager Setup
    • Custom HUD Components
    • HUD Module Display
    • Camera View Management
    • HUD Cursor / Reticle
    • Weapon UI
    • Resource Container UI
    • 2D Radar
    • 3D Radar
    • Target Boxes
    • Target Holograms
    • Minimaps
    • HUD Distance Lookup
  • Loadout
  • AI - Space Combat Kit
    • AI Setup
    • AI Spaceship Behaviours
  • AI - Mech Combat Kit
  • Game States
  • Teams
  • Floating Origin
  • Object Pooling
  • Menus
    • Creating Menus
    • Button Controllers
  • Rumbles
  • Rigidbody Characters [WIP]
  • Utilities [WIP]
    • Object Triggers
    • Shadow Caster Doubles
    • Gimbals
    • Game State Post Process Enabler
  • Objectives
  • Resources System
    • Resource Containers
    • Resource Handlers
    • Resource Container Triggers
    • Module/Vehicle Resource Usage
    • UI
  • Cutscenes
  • URP Upgrading
Powered by GitBook
On this page
  • Creating A Resource Container
  • Adding/Removing Resources
  • Continuous Replenishing/Depletion
  • Emptying/Reloading
  • Resource Types

Was this helpful?

  1. Resources System

Resource Containers

A resource container represents a place where a particular kind of resource can be stored, added or removed. Examples are ammo, energy, heat, etc.

Creating A Resource Container

To create a resource container:

  1. Add a Resource Container component to a game object

  2. Open the inspector and customize the settings, using the tooltips to understand what they mean

The Resource Container component has many functions you can call to get information about or modify its state. Here are a couple of key things to know.

Adding/Removing Resources

To add or remove resources from a resource container, call the resource container's Add Remove function. Passing a negative value as the parameter is a removal, and a positive value is an addition.

// Remove 1 resource from container
myResourceContainer.AddRemove(-1);

// Add 1 resource to container
myResourceContainer.AddRemove(1);

Continuous Replenishing/Depletion

If you have an energy resource container for weapons, you may want it to slowly replenish over time. Or if you have a heat resource container, you may want it to slowly deplete over time as heat is dissipated.

To set this up, customize the Change Rate value in the inspector of the Resource Container component. A positive value represents replenishing and a negative value represents depletion, and the value is the amount per second.

Emptying/Reloading

To create fun, balanced game mechanics, you can set the resource container to completely refill a specified time after becoming emptied (e.g. bullets are depleted, wait, bullets are reloaded). To do this, check the Fill To Capacity After Emptied Pause checkbox in the inspector of the Resource Container component.

You can also set the resource container to completely empty a specified time after becoming completely full (e.g. heat production and dissipation). To do this, check the Empty After Filled Pause checkbox in the inspector of the Resource Container component.

Resource Types

A resource type (Resource Type component) represents a particular kind of resource, such as ammo, heat, or energy.

To create a new resource type:

  1. Right click in the Project tab and select Create > Universal Vehicle Combat > Resource Type and rename it to whatever you wish.

  2. Open the inspector of any Resource Container component and set the resource type there.

PreviousResources SystemNextResource Handlers

Last updated 2 years ago

Was this helpful?