UI
  • COLLECTOR
    • Overview
    • Folder Structure
    • Getting Started
    • Example Usage
  • NUMBER
    • Overview
    • Folder Structure
    • Getting Started
    • Example Usage
  • TIME_RESOURCE
    • Overview
    • Folder Structure
    • Getting Started
    • Example Usage
  • SMART_BUTTON
    • Overview
    • Folder Structure
    • Getting Started
  • Contact
Powered by GitBook
On this page
  1. TIME_RESOURCE

Overview

PreviousTIME_RESOURCENextFolder Structure

Last updated 6 months ago

GameShell UI - Time Resource is a powerful and flexible Unity asset designed to simplify the implementation of time-based mechanics in your games. Whether you're creating an energy system, cooldown timers, or resource production mechanics, this asset provides the tools you need to quickly and efficiently integrate these features into your project.

Key Features

1. Time-Based Resource Management

  • Implement energy systems, cooldown timers, and resource production mechanics

  • Customizable maximum values, regeneration rates, and time intervals

  • Automatic calculation of resource changes during online and offline periods

  1. Scriptable Object Architecture

  • Easily create and manage multiple time-based resources

  • Consistent with other GameShell assets for seamless integration

  1. Flexible and Extensible

  • Inherit from base classes to create custom time-based mechanics

  • Event-driven architecture for easy integration with UI and game logic

  1. Performance Optimized

  • Caching mechanism for efficient time calculations

  • Designed for frequent updates without significant performance impact

  1. Unity Editor Integration

  • Custom inspector for easy debugging and testing

  • Set up and configure time resources directly in the Unity Editor

  1. Server-Ready Design

  • Architecture supports synchronization with server time

  • Easy to integrate with backend services for cheat prevention

Core Components

1. GSUITimeBase

  • Base class for all time-based resources

  • Handles time interval calculations and formatting

  1. GSUITimeResource

  • Extends GSUITimeBase to manage numeric resources that change over time

  • Implements consumption and regeneration mechanics

  1. Example Implementation Classes

  • EnergyBar: Demonstrates an energy system

  • CoolTimeButtonContainer: Shows how to implement cooldown timers

  • ProduceFood: Illustrates a resource production system