# taitanw/new2dobject architecture

> Architecture diagram of the GitHub repository taitanw/new2dobject, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/taitanw/new2dobject
- Repository: https://github.com/taitanw/new2dobject

## Overview

New2DObject is a Unity 2D movement and contact framework. Its documented runtime centers on player input and behavior, then a phased physics frame: environment/contact sampling, motion and AABB prediction, entity-contact solving, and displacement submission while Unity Dynamic contact response remains active. The graph emphasizes these documented stages and the presentation layer. Source excerpts were unavailable, so relationships are limited to those described in the README; UI, music, and other tree-visible systems are not included without documented runtime connections.

Main entry points: [`Assets/Script/Framworker/Function/Physics/Base/BasicEntity.cs`](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Base/BasicEntity.cs) (Basic Entity), [`Assets/Script/Framworker/Function/Player/Mgr/InputControlMgr.cs`](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/Mgr/InputControlMgr.cs) (Input Control), [`Assets/Script/Framworker/Function/Player/Player.cs`](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/Player.cs) (Player Logic), [`Assets/Script/Framworker/Function/Player/FSM/PlayerStateMachine.cs`](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/FSM/PlayerStateMachine.cs) (Player State Machine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_player["Player Control"]
  node_input["Input Control<br/>[InputControlMgr.cs]"]
  node_player_logic["Player Logic<br/>[Player.cs]"]
  node_behavior["Behavior States<br/>[BehavioralState.cs]"]
  node_state_machine["Player State Machine"]
end

subgraph group_environment["Environment Sampling"]
  node_environment_sources["Environment Capabilities"]
  node_environment_context["Environment Context"]
  node_environment_frame["Environment Frame"]
end

subgraph group_physics["Motion and Contact"]
  node_basic_entity["Basic Entity<br/>[BasicEntity.cs]"]
  node_effect_state["Effect State"]
  node_character_physics["Character Physics"]
  node_physical_box["Physical Box<br/>[PhysicalBox.cs]"]
  node_physics_solver["Physics Solver"]
  node_physics_data["Motion Structures<br/>[Struct.cs]"]
end

subgraph group_presentation["Presentation"]
  node_presentation["Presentation Layer"]
end

node_user(("Player"))
node_unity_physics["Unity Dynamic Physics"]

node_user -->|"provides input"| node_input
node_input -->|"controls"| node_player_logic
node_player_logic -->|"uses behavior"| node_state_machine
node_state_machine -->|"selects state"| node_behavior
node_environment_sources -->|"supplies capabilities"| node_environment_context
node_environment_context -->|"resolves environment"| node_environment_frame
node_environment_frame -->|"informs motion"| node_basic_entity
node_basic_entity -->|"builds motion frame"| node_physics_data
node_basic_entity -->|"provides predicted bounds"| node_physics_solver
node_physics_solver -->|"returns contact bias"| node_basic_entity
node_basic_entity -->|"uses effect values"| node_effect_state
node_basic_entity -->|"submits character motion"| node_character_physics
node_basic_entity -->|"submits box motion"| node_physical_box
node_basic_entity -->|"retains dynamic response"| node_unity_physics

click node_input "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/Mgr/InputControlMgr.cs"
click node_player_logic "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/Player.cs"
click node_behavior "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/FSM/BehavioralState.cs"
click node_state_machine "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/FSM/PlayerStateMachine.cs"
click node_environment_sources "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Interface/IEnvironmentCapabilities.cs"
click node_environment_context "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Base/EntityEnvironmentContext.cs"
click node_environment_frame "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Data/EntityEnvironmentFrame.cs"
click node_basic_entity "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Base/BasicEntity.cs"
click node_effect_state "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Data/EntityEffectState.cs"
click node_character_physics "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Component/CharacterPhysics.cs"
click node_physical_box "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Component/SceneObjects/PhysicalBox.cs"
click node_physics_solver "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Mgr/PhysicsSolverMgr.cs"
click node_physics_data "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Data/Struct.cs"
click node_presentation "https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Performance/Component/PresentationLayer.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_input,node_player_logic,node_behavior,node_state_machine toneBlue
class node_environment_sources,node_environment_context,node_environment_frame toneAmber
class node_basic_entity,node_effect_state,node_character_physics,node_physical_box,node_physics_solver,node_physics_data toneMint
class node_presentation toneRose
class node_user,node_unity_physics toneIndigo
```

## Components

### Player Control

- [Input Control](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/Mgr/InputControlMgr.cs): `Assets/Script/Framworker/Function/Player/Mgr/InputControlMgr.cs`
- [Player Logic](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/Player.cs): `Assets/Script/Framworker/Function/Player/Player.cs`
- [Behavior States](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/FSM/BehavioralState.cs): `Assets/Script/Framworker/Function/Player/FSM/BehavioralState.cs`
- [Player State Machine](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Player/FSM/PlayerStateMachine.cs): `Assets/Script/Framworker/Function/Player/FSM/PlayerStateMachine.cs`

### Environment Sampling

- [Environment Capabilities](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Interface/IEnvironmentCapabilities.cs): `Assets/Script/Framworker/Function/Physics/Interface/IEnvironmentCapabilities.cs`
- [Environment Context](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Base/EntityEnvironmentContext.cs): `Assets/Script/Framworker/Function/Physics/Base/EntityEnvironmentContext.cs`
- [Environment Frame](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Data/EntityEnvironmentFrame.cs): `Assets/Script/Framworker/Function/Physics/Data/EntityEnvironmentFrame.cs`

### Motion and Contact

- [Basic Entity](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Base/BasicEntity.cs): `Assets/Script/Framworker/Function/Physics/Base/BasicEntity.cs`
- [Effect State](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Data/EntityEffectState.cs): `Assets/Script/Framworker/Function/Physics/Data/EntityEffectState.cs`
- [Character Physics](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Component/CharacterPhysics.cs): `Assets/Script/Framworker/Function/Physics/Component/CharacterPhysics.cs`
- [Physical Box](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Component/SceneObjects/PhysicalBox.cs): `Assets/Script/Framworker/Function/Physics/Component/SceneObjects/PhysicalBox.cs`
- [Physics Solver](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Mgr/PhysicsSolverMgr.cs): `Assets/Script/Framworker/Function/Physics/Mgr/PhysicsSolverMgr.cs`
- [Motion Structures](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Physics/Data/Struct.cs): `Assets/Script/Framworker/Function/Physics/Data/Struct.cs`

### Presentation

- [Presentation Layer](https://github.com/taitanw/new2dobject/blob/main/Assets/Script/Framworker/Function/Performance/Component/PresentationLayer.cs): `Assets/Script/Framworker/Function/Performance/Component/PresentationLayer.cs`

### Other components

- **Player**
- **Unity Dynamic Physics**

## Connections

- Player → Input Control: provides input (evidence: `README.md`)
- Input Control → Player Logic: controls (evidence: `README.md`)
- Player Logic → Player State Machine: uses behavior (evidence: `README.md`)
- Player State Machine → Behavior States: selects state (evidence: `README.md`)
- Environment Capabilities → Environment Context: supplies capabilities (evidence: `README.md`)
- Environment Context → Environment Frame: resolves environment (evidence: `README.md`)
- Environment Frame → Basic Entity: informs motion (evidence: `README.md`)
- Basic Entity → Motion Structures: builds motion frame (evidence: `README.md`)
- Basic Entity → Physics Solver: provides predicted bounds (evidence: `README.md`)
- Physics Solver → Basic Entity: returns contact bias (evidence: `README.md`)
- Basic Entity → Effect State: uses effect values (evidence: `README.md`)
- Basic Entity → Character Physics: submits character motion (evidence: `README.md`)
- Basic Entity → Physical Box: submits box motion (evidence: `README.md`)
- Basic Entity → Unity Dynamic Physics: retains dynamic response (evidence: `README.md`)
