Skill Web
  • Skill Web Documentation
  • 🕹️Quick Start
    • Installation
  • Start Developing
  • 💡General
    • Running the Demos
  • Menu Options
  • UI Customizations
    • uGUI
      • Skill Node
      • Connection Line
      • Web View
      • Hovercard
  • Datasets
  • 🎓Tutorials
    • Runes Demo Walkthrough
  • ✏️Editors
    • Skill Bank
  • Web Creator
  • Settings
  • Components
    • Skill Web Initializer
    • uGUI
      • Skill Node UGUI
      • Connection Line
        • Curved Connection Line
      • Web View UGUI
        • Web View Selector UGUI
      • Skill Hovercard UGUI
    • Player Web Link
  • 📄Scripting API
    • Initialization
  • Skills
    • Skill
      • Skill Dataset Attributes
    • Skill Node
  • Webs
    • Web Graph
    • Web
  • UI
    • Loading a Web
    • Web View Input Handling
    • Customize Connection Line
    • Customize Hovercard
  • Player Web Link
  • Custom Logic
  • Saving & Loading
  • Events
  • Skill Web Settings
  • Procedural Generation (Beta)
  • 🛠️Support
    • Getting Help
  • 📚Changelogs
    • Latest Releases
    • Future Plans
    • ⭐Rate Me?
Powered by GitBook
On this page
  • Fields & Properties
  • Creating a Web Graph
  • Getting a Web Graph
  • Custom Dataset
  • Step 1: Inherit From WebDataset
  • Step 2: Create Asset Menu Option
  • Step 3: Override Methods
  • Step 4: Add Custom Fields
  • Step 5: Set For All Web Graphs
  1. Webs

Web Graph

The web graph data class.

The WebGraph class stores skill data. It gives an identity to a Web. Web graphs are created through the Web Creator.

Fields & Properties

Name
Description
Type
Access

webName

The searchable name of the web graph.

string

public

skillNodes

A list of all skill nodes.

List<SkillNode>

public

connections

A list of all connections.

List<Connection>

public

dataset

The dataset.

WebDataset

public

Creating a Web Graph

var webGraph = ScriptableObject.CreateInstance<WebGraph>();

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.

var myWebGraph = SkillWeb.GetWebGraph("My Web");

To get all web graphs, use SkillWeb.GetAllWebGraphs. Note: this can be a lengthy task.

var allWebGraphs = SkillWeb.GetAllWebGraphs();

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.

using Esper.SkillWeb;
using UnityEngine;

public class MyWebDataset : WebDataset
{

}

Step 2: Create Asset Menu Option

WebDataset is a ScriptableObject class, which means it can be added to the asset menu.

using Esper.SkillWeb;
using UnityEngine;

[CreateAssetMenu(fileName = "My Web Dataset", menuName = "Skill Web/Datasets/My Web Dataset")]
public class MyWebDataset : WebDataset
{

}

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.

using Esper.SkillWeb;
using UnityEngine;

[CreateAssetMenu(fileName = "My Web Dataset", menuName = "Skill Web/Datasets/My Web Dataset")]
public class MyWebDataset : WebDataset
{
    public override string GetDisplayName()
    {
        // Implement custom code here
        
        return "";
    }
}

Step 4: Add Custom Fields

Add your custom fields. If they are serializable, they will be available for each web in the Web Creator.

using Esper.SkillWeb;
using UnityEngine;

[CreateAssetMenu(fileName = "My Web Dataset", menuName = "Skill Web/Datasets/My Web Dataset")]
public class MyWebDataset : WebDataset
{
    public float myCustomFloat;

    public override string GetDisplayName()
    {
        // Implement custom code here
        
        return "";
    }
}

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.

PreviousWebsNextWeb

Last updated 13 days ago