Web Graph
🕸️ WebGraph Class
Represents a skill web graph containing nodes and connections, with database integration and dataset generation.
Namespace:
Esper.SkillWeb.GraphAccess:publicType:classInherits:SkillWebObject
📦 Fields
public
webName
string
Searchable name of the web graph.
public
changeGuid
string
Guid generated when the web changes.
public
skillNodes
List<SkillNode>
List of all skill nodes.
public
connections
List<Connection>
List of all connections.
public
dataset
WebDataset
Associated dataset.
public static
resourcesPath
string
Path to generated objects relative to Resources folder.
🔍 Properties
public
DatabaseRecord
WebRecord
Database record containing id, objectName, and webName.
public static (Editor only)
DirectoryPath
string
Directory path for generated objects in the editor.
🧰 Methods
public
UpdateDatabaseRecord()
void
Insert or update this web’s record in the database.
public
GetTitle()
string
Returns dataset display name or webName.
public
CreateCopy()
WebGraph
Creates a copy of this web graph with new changeGuid.
public
CopyData(WebGraph other)
void
Copies data from another web, excluding ID.
public
GenerateDataset()
void
Generates a dataset asset (editor only).
public
GenerateDatasetCopy(WebGraph webGraph)
WebDataset
Creates a dataset copy for another web graph.
public static
Create()
WebGraph
Creates a new web graph instance (editor only).
public static
CreateCopy(WebGraph original)
WebGraph
Creates a copy of an existing web graph (editor only).
public
UpdateAssetName()
void
Updates the asset name in the editor.
public override
Save()
void
Saves the asset and updates its database record.
protected override
GetID<T>(string pathInResources = null)
int
Returns a unique ID using resourcesPath.
public virtual
GetAvailableNodeID()
int
Returns an unused node ID.
public static (Editor only)
GetFullPath(WebGraph web)
string
Returns full asset path for a web graph.
public (Editor only)
DeleteDatabaseRecord()
void
Deletes this web’s record from the database.
Creating a Web Graph
Getting a Web Graph
You can get a web graph with the SkillWeb.GetWebGraph method by passing the ID or name of the web graph as a parameter.
To get all web graphs, use SkillWeb.GetAllWebGraphs. Note: this can be a lengthy task.
Custom Dataset
You can create a custom dataset for webs, allowing you to set custom data for each skill—making customization easier.
Step 1: Inherit From WebDataset
Create a new class and inherit from the WebDataset class.
Step 2: Create Asset Menu Option
WebDataset is a ScriptableObject class, which means it can be added to the asset menu.
Step 3: Override Methods
Override the required method. There's only the GetDisplayName method, which is not used anywhere by default. How you use this is up to you.
Step 4: Add Custom Fields
Add your custom fields. If they are serializable, they will be available for each web in the Web Creator.
Step 5: Set For All Web Graphs
All you have left to do now is to create a new instance of your custom dataset from the asset menu and set it as the dataset reference for web graphs from Settings.
Last updated