29 lines
4.6 KiB
Plaintext
29 lines
4.6 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en"><head>
|
|
<meta charset="UTF-8">
|
|
<title>Rokojori Base — Unity-Roject-Test</title>
|
|
<style>
|
|
@import url('/fonts/barlow.css');
|
|
</style>
|
|
</head>
|
|
<body data-theme="default-roject">
|
|
<page--header></page--header>
|
|
|
|
<page--root data-theme="default-roject">
|
|
<full--width--block data--page--block="">
|
|
<full--width--area data--page--area="" contenteditable="true" spellcheck="false" autocorrect="off" autocapitalize="off" style="outline: none;"><h1>Rokojori Base</h1><div>The generic library layer under <marked-text>Assets/Scripts/Rokojori</marked-text> - no project code may be referenced from here, only Unity core. Everything else (GameState, Dialog, Simulation) is built on top of this.</div></full--width--area>
|
|
</full--width--block>
|
|
<two--columns--block data--page--block="">
|
|
<two--columns--area data--page--area="" contenteditable="true" spellcheck="false" autocorrect="off" autocapitalize="off" style="outline: none;"><h2>Unique<T></h2><div><code>Unique<T>.Get()</code> is the singleton locator used everywhere (<code>GameStateManager.instance</code>, <code>DialogManager.instance</code>, <code>SimulationManager.instance</code>, <code>SimulationRenderer.instance</code>). It searches the root game objects of all open scenes for a component of type T on first access and caches the result statically - there is no manual registration step. This means exactly one instance is expected to exist in the open scenes; a second instance is never detected or warned about.</div><div><br></div><h2>EventSlot<T></h2><div>A plain pub/sub slot - <code>AddAction</code>, <code>RemoveAction</code>, <code>Once</code>, <code>DispatchEvent( value )</code>. Listeners added or removed <marked-text>during</marked-text> a dispatch are queued and only applied after the current dispatch finishes (<code>_canModify</code> guards this) - safe to unsubscribe yourself from inside your own callback.</div><div><br></div><div>Used directly as the type of <code>GameStateNumberVariable.onChanged</code> / <code>GameStateBoolVariable.onChanged</code>.</div></two--columns--area>
|
|
<two--columns--area data--page--area="" contenteditable="true" spellcheck="false" autocorrect="off" autocapitalize="off" style="outline: none;"><h2>EventProperty<T> / ReadonlyEventProperty<T></h2><div>An observable value built on EventSlot. Setting <code>.value</code> only dispatches if the new value differs from the old one (via <code>EqualityComparer<T>.Default</code>) - assigning the same value twice fires nothing. <code>SetSilent()</code> changes the backing value without dispatching. Not currently used by GameState/Dialog/Simulation - those roll their own change tracking (GameStateManager's dictionaries + each variable's own EventSlot) instead.</div><div><br></div><h2>Locale / LocaleText / LocaleCode</h2><div><code>Locale</code> is the abstract base (a ScriptableObject with <code>GetLocale( LocaleCode )</code>); <code>LocaleText</code> is the only concrete implementation and currently just returns its <code>en</code> field <marked-text>regardless of the requested LocaleCode</marked-text> - there is no real per-language switching yet. <code>LocaleManager.currentLocale</code> exists but nothing reads it. DialogLine/PlayerChoice reference Locale assets for their text, so localization can be wired in later without touching Dialog code.</div></two--columns--area>
|
|
</two--columns--block>
|
|
<two--columns--block data--page--block="">
|
|
<two--columns--area data--page--area="" contenteditable="true" spellcheck="false" autocorrect="off" autocapitalize="off" style="outline: none;"><h2>RJLog</h2><div>Static wrapper over <code>Debug.Log/LogWarning/LogError</code>. Takes a leading object plus a <code>params object[]</code> and space-joins everything into one string - <code>RJLog.Log( "value:", 5, someObject )</code>.</div><div><br></div><h2>ListExtensions</h2><div><code>list.Has( item )</code> (index-based, works without <code>IEquatable</code>) and <code>list.RemoveList( removals )</code> (removes every item in one list from another).</div></two--columns--area>
|
|
<two--columns--area data--page--area="" contenteditable="true" spellcheck="false" autocorrect="off" autocapitalize="off" style="outline: none;"><h2>SceneExtensions</h2><div><code>scene.Get<T>()</code> and <code>SceneExtensions.GetInOpenScenes<T>()</code> search root game objects (and their children) for a component - this is what <code>Unique<T></code> calls internally.</div><div><br></div><h2>Null</h2><div>An empty marker class with a private constructor - not referenced by anything yet.</div></two--columns--area>
|
|
</two--columns--block>
|
|
</page--root>
|
|
|
|
<page--footer></page--footer>
|
|
|
|
</body></html>
|