# legerdo/scriptableobjectarchitecture architecture

> Architecture diagram of the GitHub repository legerdo/scriptableobjectarchitecture, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/legerdo/scriptableobjectarchitecture
- Repository: https://github.com/legerdo/scriptableobjectarchitecture

## Overview

##### Project type and purpose
- This is a Unity-based framework package (“SOA Project”) that implements a ScriptableObject Architecture (SOA).
- It’s not a full game, but a reusable library/tool for decoupling game logic via ScriptableObjects: it provides core “Runtime” modules (Abilities, Events, Variables, RuntimeSets) and matching “Editor” extensions for authoring and wiring them.
- The “Samples~” folder contains demo scenes and sample code showing how to use the framework.

##### File structure
- Top-level assemblies:
- Editor/… .asmdef → Unity Editor tooling (custom inspectors, drawers, event editors)
- Rumtime/… .asmdef → Core runtime modules
- Under Rumtime:
- Ability/AbilityBase and subtypes (FloatAbility, IntAbility)
- Event/Generic and non-generic GameEvents, MonoBehaviour listeners & managers
- Variables/GenericVariable<T> and concrete types (FloatVariable, IntVariable, BoolVariable, etc.), plus GenericReference
- Sets/RuntimeSet<T> and example runtime sets
- Samples~/ → example scenes (.unity), ScriptableObject assets (.asset), sample MonoBehaviour code that exercises each module.
- Configuration files: package.json for Unity package metadata, LICENSE, README.md with pointers to reference talks and repos.

##### Readme insights
- Minimal README—points to a Unity Unite 2017 talk and the original roboryantron repo.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External UnityEngine API
    UnityEngine["UnityEngine API"]:::external

    %% Runtime Assembly and Subsystems
    subgraph "Runtime Assembly (ScriptableObjectArchitecture)" 
        direction TB
        subgraph "Ability Subsystem"
            direction TB
            AbilityBase["AbilityBase"]:::runtime
            FloatAbility["FloatAbility"]:::runtime
            IntAbility["IntAbility"]:::runtime
        end
        subgraph "Event Subsystem"
            direction TB
            GenericGameEvent["GameEvent<T>"]:::runtime
            NonGenericGameEvent["NonGenericGameEvent"]:::runtime
            GameObjectEvent["GameObjectEvent"]:::runtime
            SimpleEvent["SimpleEvent"]:::runtime
            GameEventListener["GameEventListener"]:::runtime
            GameEventManager["GameEventManager"]:::runtime
            NonGenericGameEventListener["NonGenericGameEventListener"]:::runtime
            GameObjectEventListener["GameObjectEventListener"]:::runtime
            GameObjectEventManager["GameObjectEventManager"]:::runtime
        end
        subgraph "Variable Subsystem"
            direction TB
            GenericVariable["GenericVariable<T>"]:::runtime
            GenericReference["GenericReference"]:::runtime
            BoolVariable["BoolVariable"]:::runtime
            FloatVariable["FloatVariable"]:::runtime
            IntVariable["IntVariable"]:::runtime
            StringVariable["StringVariable"]:::runtime
            Vector2Variable["Vector2Variable"]:::runtime
            Vector3Variable["Vector3Variable"]:::runtime
            GameObjectVariable["GameObjectVariable"]:::runtime
            IClonableVariable["IClonableVariable"]:::runtime
        end
        subgraph "RuntimeSet Subsystem"
            direction TB
            RuntimeSet["RuntimeSet<T>"]:::runtime
            ThingRuntimeSet["ThingRuntimeSet"]:::runtime
            Thing["Thing"]:::runtime
        end
    end

    %% Editor Assembly
    subgraph "Editor Assembly (ScriptableObjectArchitecture.Editor)" 
        direction TB
        EventEditor["EventEditor"]:::editor
        GenericReferenceDrawer["GenericReferenceDrawer"]:::editor
    end

    %% Samples / Demo Scenes & Assets
    subgraph "Samples / Demos" 
        direction TB
        AbilitySamples["Ability Samples"]:::samples
        EventSamples["Event Samples"]:::samples
        HPSamples["HP & Variable Samples"]:::samples
        ThingSamples["Thing & RuntimeSet Samples"]:::samples
    end

    %% Relationships
    RuntimeAssembly -->|inherits from| UnityEngine
    EditorAssembly -->|depends on| RuntimeAssembly
    AbilitySamples -->|uses| RuntimeAssembly
    EventSamples -->|uses| RuntimeAssembly
    HPSamples -->|uses| RuntimeAssembly
    ThingSamples -->|uses| RuntimeAssembly
    AbilitySamples -->|uses| EditorAssembly
    EventSamples -->|uses| EditorAssembly
    HPSamples -->|uses| EditorAssembly
    ThingSamples -->|uses| EditorAssembly

    %% Click Events for Runtime Assembly
    click RuntimeAssembly "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/ScriptableObjectArchitecture.asmdef"

    %% Ability Subsystem Clicks
    click AbilityBase "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Ability/AbilityBase.cs"
    click FloatAbility "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Ability/Type/FloatAbility.cs"
    click IntAbility "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Ability/Type/IntAbility.cs"

    %% Event Subsystem Clicks
    click GenericGameEvent "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Event/GameEvent.cs"
    click NonGenericGameEvent "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Event/NonGenericGameEvent.cs"
    click GameObjectEvent "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Event/Type/GameObjectEvent.cs"
    click SimpleEvent "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Event/Type/SimpleEvent.cs"
    click GameEventListener "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Event/MonoBehaviour/Base/GameEventListener.cs"
    click GameEventManager "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Event/MonoBehaviour/Base/GameEventManager.cs"
    click NonGenericGameEventListener "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Event/MonoBehaviour/Base/NonGenericGameEventListener.cs"
    click GameObjectEventListener "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Event/MonoBehaviour/Type/GameObjectEventListener.cs"
    click GameObjectEventManager "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Event/MonoBehaviour/Type/GameObjectEventManager.cs"

    %% Variable Subsystem Clicks
    click GenericVariable "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Variables/GenericVariable.cs"
    click GenericReference "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Variables/GenericReference.cs"
    click BoolVariable "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Variables/Type/BoolVariable.cs"
    click FloatVariable "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Variables/Type/FloatVariable.cs"
    click IntVariable "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Variables/Type/IntVariable.cs"
    click StringVariable "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Variables/Type/StringVariable.cs"
    click Vector2Variable "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Variables/Type/Vector2Variable.cs"
    click Vector3Variable "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Variables/Type/Vector3Variable.cs"
    click GameObjectVariable "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Variables/Type/GameObjectVariable.cs"
    click IClonableVariable "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Variables/Type/IClonableVariable.cs"

    %% RuntimeSet Subsystem Clicks
    click RuntimeSet "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Sets/RuntimeSet.cs"
    click ThingRuntimeSet "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Sets/Example/ThingRuntimeSet.cs"
    click Thing "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Rumtime/Sets/Example/Thing.cs"

    %% Editor Assembly Clicks
    click EventEditor "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Editor/EventEditor.cs"
    click GenericReferenceDrawer "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Editor/GenericReferenceDrawer.cs"
    click EditorAssembly "https://github.com/legerdo/scriptableobjectarchitecture/blob/main/Editor/ScriptableObjectArchitecture.Editor.asmdef"

    %% Samples Clicks (directories)
    click AbilitySamples "https://github.com/legerdo/scriptableobjectarchitecture/tree/main/Samples~/Ability"
    click EventSamples "https://github.com/legerdo/scriptableobjectarchitecture/tree/main/Samples~/Event"
    click HPSamples "https://github.com/legerdo/scriptableobjectarchitecture/tree/main/Samples~/HP"
    click ThingSamples "https://github.com/legerdo/scriptableobjectarchitecture/tree/main/Samples~/Thing"

    %% Styles
    classDef runtime fill:#e0f7e9,stroke:#2d8f66,stroke-width:2px
    classDef runtimeAssembly fill:#d1f2c1,stroke:#2d8f66,stroke-width:2px
    classDef editor fill:#d0e6ff,stroke:#3366cc,stroke-width:2px
    classDef samples fill:#fff4cc,stroke:#cca300,stroke-width:2px
    classDef external fill:#eeeeee,stroke:#999999,stroke-width:2px
    class RuntimeAssembly runtimeAssembly
    class AbilityBase,FloatAbility,IntAbility,GenericGameEvent,NonGenericGameEvent,GameObjectEvent,SimpleEvent,GameEventListener,GameEventManager,NonGenericGameEventListener,GameObjectEventListener,GameObjectEventManager,GenericVariable,GenericReference,BoolVariable,FloatVariable,IntVariable,StringVariable,Vector2Variable,Vector3Variable,GameObjectVariable,IClonableVariable,RuntimeSet,ThingRuntimeSet,Thing runtime
    class EventEditor,GenericReferenceDrawer editor
    class AbilitySamples,EventSamples,HPSamples,ThingSamples samples
```
