com.echo.visualstate2
v0.9.3
Published
Visual State 2 by the vietlabs.vs2 team. Manages component states with editor integration for property transitions. Redistributed as a com.echo UPM package so Echo feature modules resolve from npmjs.org.
Maintainers
Readme
Visual State 2 - Unity State Management Plugin
UPM package: com.echo.visualstate2 0.9.3 — authored by the vietlabs.vs2 team ([email protected]). Published to public npmjs.org under the com.echo scope so Echo feature modules can install from the registry. Assemblies VisualState2 / vietlabs.vs2 are unchanged.
Visual State 2 is a powerful Unity plugin that helps manage and transition between different states of GameObjects and their components. It provides an intuitive way to record, store, and apply property states, making it ideal for UI transitions, animation states, or any scenario where you need to manage multiple object states.
Key Features
- 🎛️ Manage multiple states of GameObjects and their components
- ⏺️ Record and store property states with ease
- ⚡ FastChain technology for optimized performance
- 🖱️ Editor integration for state management
- 🔄 Smooth transitions between states
- 🧩 Works with any Unity component
- 🔧 Smart property mapping for Unity's internal serialization
- 🎯 Silent handling of unsupported properties
Getting Started
Usage
- In Unity Editor, select a GameObject
- Add
VisualState2component - Create new states using the "+" button
- Hit Record, and start making changes for each state
- Transition between states using the state buttons in Editor or via code:
visualState.SetState("StateName");Detailed Architecture
Core Components
VisualState2.cs
- Main controller for state management
- Handles state recording, storage, and transitions
- Implements FastChain optimization
- Provides public API for state manipulation
VModData.cs
- Serializable class for storing state information
- Contains property values and metadata
- Optimized for efficient serialization
Chain & FastChain System
- Property access optimization layer
- Caches property getters/setters
- Reduces reflection overhead
- Implements custom property handlers for common Unity types
PropertyPathMapper.cs
- Centralized mapping for Unity's internal serialization paths
- Handles special cases like Renderer materials and Light shadows
- Excludes unsupported Unity event system properties
- Extensible architecture for adding new mappings
