Heroic Engine
  • Welcome
  • Getting Started
    • Quickstart
    • Example Games
      • Tic Tac Toe
      • Turn based duel
  • Basics
    • Injection Manager
    • Engine Systems
      • Core Systems
        • Events Manager
        • Input Manager
        • Localization Manager
          • LangText component
        • Music Player
        • Sounds Manager
        • Time Manager
        • Scenes Loader
        • Day Time Controller
        • Weather Controller
      • Gameplay Systems
        • Currencies Manager
        • Player Progression Manager
        • Quest Manager
        • Random Events Manager
        • Hittables Manager
        • Dungeon Generator
      • UI Systems
        • UI Controller
        • Countdown Controller
    • Editor Tools
      • Clear Saves
      • Mobile Build Optimizer
      • Create System
      • Icon from Prefab Generator
    • Engine Utilities
      • PoolSystem
      • DataSaver
      • ComponentExtensions
      • MaterialExtensions
      • SpriteUtils
      • SlowUpdate
      • StringUtils
      • TypeUtility
      • MathHelper
      • VectorUtils
      • TransformUtils
      • MeshUtils
    • Useful Components
      • Floating Item
      • Fly Up Text
      • Label Scaler
      • Ragdoll
      • Rotate To Camera
      • Orbital Camera
      • Rotator
      • Texture Mover
      • Hittable
      • Projectile
      • Projectile2D
      • LifetimeObject
      • Spawner
      • Colorized Particles
      • Draggable2D
      • SaveableTransform
    • Useful Attributes
Powered by GitBook
On this page
  1. Basics
  2. Engine Systems
  3. Gameplay Systems

Hittables Manager

Presented by IHittablesManager interface, this system stores collection of all active Hittable objects in game, sorted by teams. It helps to find nearest hittables in certain point within certain radius.

To use this system, inject IHittablesManager interface into your class, as shown below:

[Inject] private IHittablesManager hittablesManager;

This system is not presented on LoadingScene, so you should add it onto the needed scenes where battles will occur.

Available methods

void RegisterHittable(Hittable hittable)

This method registers hittable object in manager. Other characters and projectiles will be able to find it.

This method is automatically called from Hittable class during its appearance, so you don't need to call it from your classes inherited from Hittable, in most of cases.

void UnregisterHittable(Hittable hittable)

This method unregisters hittable object from manager. Other characters and projectiles will not be able to find it.

This method is automatically called from Hittable class during its death, so you don't need to call it from your classes inherited from Hittable, in most of cases.


List<Hittable> GetHittablesInRadius(Vector3 from, float radius)

This method returns all Hittable objects in certain radius from given point.

Example:

var foundHittables = hittablesManager.GetHittablesInRadius(transform.position, 10f);

List<Hittable> GetOtherTeamsHittablesInRadius(Vector3 from, float radius, TeamType excludedTeam)

This method returns all Hittable objects in certain radius from given point, from all teams except excludedTeam.

Example:

var foundEnemies = hittablesManager.GetOtherTeamsHittablesInRadius(
    transform.position,
    10f,
    TeamType.Player);

List<Hittable> GetTeamHittablesInRadius(Vector3 from, float radius, TeamType teamType)

This method returns all Hittable objects in certain radius from given point, from certain team.

This method can be useful for seraching allies near the certain character.


void KillTeam(TeamType teamType)

This method instantly kills all Hittable objects of certain team.

PreviousRandom Events ManagerNextDungeon Generator

Last updated 4 months ago