Unit System
  • WELCOME
    • πŸ‘‹Hello
    • πŸ—ΊοΈRoadmap
    • ⛑️Support & Community
    • πŸŽ“Version - Changelog
  • Getting Started
    • πŸ”ŒImport Package
    • βš™οΈConfiguration
    • πŸ” Database
    • πŸͺŸManager Window
    • Creating a new Scene
      • Player Camera
      • Set up Player
      • Set up Player UI
      • Set up the Game World
    • Create Units
      • Resource (Crystal)
      • Research (Crystal age)
      • Resource node (Crystal Node)
      • Resource collector (Crystal)
      • Combat unit (Mage)
      • Production unit (Mage Tower)
      • Faction (Purple Cubes)
  • How it works
    • Overview
    • Modules
      • Resource
      • Production
      • Population
      • Garrison
      • Collection
  • Integration
    • Unit Selection
    • Unit Formation
    • Object Placement
Powered by GitBook
On this page
  • Editor
  • Runtime
  1. Getting Started

Database

PreviousConfigurationNextManager Window

Last updated 16 days ago

Editor

SystemDatabase is a scriptable object used for managing system assets, their unique IDs. Initially designed to be used in Editor, but it may also be accessed at runtime.

You can register all assets in the project here or clear the database. But creating a new assets should be done through Manager Window.

Runtime

Items in the database are scriptable objects as well, so they can be as any other asset in unity.

Alternatively you can retrieve them using their IDs from this database.

[SerielizeField] private SystemDatabase database;
[SerielizeField] private int resourceID;

private void Awake()
{
    // Or at runtime
    // var database = SystemDatabase.GetInstance();
    
    // Find the asset using its ID.
    var resource = database.FindAssetById(resourceID);
}
πŸ” 
Database ScriptableObject UI