-
Notifications
You must be signed in to change notification settings - Fork 37
Classes
The ClassAsset lets you design C# classes directly inside Unity using Visual Scripting.
You can define fields, properties, methods, constructors, inheritance, and interfaces all visually, without writing code.
- Inherit from existing classes or interfaces
- Define fields and properties
- Add methods and constructors
- Apply attributes to classes and members
- Generate complete C# classes ready for compilation
In the Project window:
Create → Visual Scripting → Community → Code → Class
| Setting | Description |
|---|---|
| Title | The name of the class. |
| Category | The namespace where the class will be placed. |
| Class Modifier |
None, Abstract, Partial, Sealed, Static, or Static Partial. |
| Attributes | Class-level attributes (e.g., [Serializable]). |
| Option | Description |
|---|---|
| Serialized | Adds [Serializable]. |
| Inspectable | Adds [Inspectable]. |
| Include In Settings | Adds [IncludeInSettings(true)]. |
| Flag for Defined Event Filtering | Marks this class for Defined Event nodes. |
| ScriptableObject | Makes the class inherit from ScriptableObject. |
| Inherits Type | Allows the class to inherit from another type. Unless ScriptableObject is enabled. |
| Interfaces | Adds a list of interfaces to implement. |
You can add constructors, fields, properties, and methods.
| Option | Description |
|---|---|
| Scope | Access modifier (e.g., public). |
| Initializer Type | Choose between None, Base or This. |
| Parameters | Defines constructor parameters. |
| Body Graph | Adds logic via FlowGraph. |
Example:

| Option | Description |
|---|---|
| Scope | Access modifier (e.g., public, private). |
| Modifier | Optional modifier like static. |
| Name | The field or property name. |
| Type | The data type. |
| Default Value | Optional default initializer. |
| Attributes | Optional field or property attributes. |
Result:
![]()
| Option | Description |
|---|---|
| Getter / Setter FlowGraphs | Optional logic for custom get/set. |
| Getter Scope | Access level for the getter. |
| Setter Scope | Access level for the setter. |
Result:
![]()
| Option | Description |
|---|---|
| Scope | Access modifier. |
| Modifier | Optional method modifier. |
| Name | The method name. |
| Return Type | The return type (e.g., void, int). |
| Parameters | The list of input parameters. |
| Body Graph | The FlowGraph used for logic. |
| Attributes | Optional method attributes. |
| Generics | (Experimental) Define generic type parameters. |
Result:
![]()
You can edit the logic of constructors, properties, and methods directly through their FlowGraphs.
Result:
Compile your ClassAsset via the C# Preview window or
Addons → Compile Selected.
This generates a ready-to-use C# class file.
When inheriting a type, the Required Info section lists all members that must be implemented.
Lists all properties and methods that can be overridden from the base type.
A new CSharp section appears in the fuzzy finder, giving you units for:
- Inherited members
- Asset-defined members (
methods,properties,fields) - The asset type (
typeof(CurrentAssetType))