Table of Contents

Class LunyEngine

Namespace
Luny
Assembly
Luny.dll

LunyEngine singleton discovers and manages engine services and observers.

public sealed class LunyEngine : ILunyEngine
Inheritance
object
LunyEngine
Implements

Properties

Application

Application-level services, similar to UnityEngine.Application and UnityEditor.EditorApplication.

public ILunyApplicationService Application { get; }

Property Value

ILunyApplicationService

Asset

Asset loading/unloading and caching. Enables asset lookup by path/name. Returns placeholder assets instead of throwing exceptions.

public ILunyAssetService Asset { get; }

Property Value

ILunyAssetService

Debug

Debug services, eg logging.

public ILunyDebugService Debug { get; }

Property Value

ILunyDebugService

Editor

Editor services. Safe to call in runtime code (no-op, returning defaults).

public ILunyEditorService Editor { get; }

Property Value

ILunyEditorService

Input

Input services, forwards Action Map events and provides access to most recent input state.

public ILunyInputService Input { get; }

Property Value

ILunyInputService

Instance

Gets the singleton instance, creating it on first access.

public static ILunyEngine Instance { get; }

Property Value

ILunyEngine

Object

Object services, mainly creating new prefab/primitive instances.

public ILunyObjectService Object { get; }

Property Value

ILunyObjectService

Profiler

Gets the engine profiler for performance monitoring. Profiling methods are no-ops in release builds unless LUNY_PROFILE is defined.

public ILunyEngineProfiler Profiler { get; }

Property Value

ILunyEngineProfiler

Scene

Scene services, including in-scene object queries by name/path/type and scene load/unload.

public ILunySceneService Scene { get; }

Property Value

ILunySceneService

Time

Time services, eg delta time, elapsed seconds, frame count.

public ILunyTimeService Time { get; }

Property Value

ILunyTimeService

Methods

DisableObserver<T>()

public void DisableObserver<T>() where T : ILunyEngineObserver

Type Parameters

T

EnableObserver<T>()

public void EnableObserver<T>() where T : ILunyEngineObserver

Type Parameters

T

~LunyEngine()

protected ~LunyEngine()

GetObserver<T>()

public T GetObserver<T>() where T : ILunyEngineObserver

Returns

T

Type Parameters

T

GetService<TService>()

Gets a service by type. Throws if the service is not registered. Note: essential services are exposed as properties.

public TService GetService<TService>() where TService : LunyEngineServiceBase

Returns

TService

Type Parameters

TService

HasService<TService>()

Queries if a service type is registered.

public bool HasService<TService>() where TService : LunyEngineServiceBase

Returns

bool

Type Parameters

TService

IsObserverEnabled<T>()

public bool IsObserverEnabled<T>() where T : ILunyEngineObserver

Returns

bool

Type Parameters

T

TryGetObject(string, string, int)

Will try to find an object by name in the scene. Queries already-cached objects first. Wraps found objects in a LunyObject instance.

public ILunyObject TryGetObject(string name, string callerFilePath = "", int callerLineNumber = 0)

Parameters

name string
callerFilePath string
callerLineNumber int

Returns

ILunyObject

TryGetService<TService>(out TService)

Gets a service by type, may return false/null.

public bool TryGetService<TService>(out TService service) where TService : LunyEngineServiceBase

Parameters

service TService

Returns

bool

Type Parameters

TService