# Hidden Skills

Want your skill web to reveal only unlocked skills? Just add the script below to your scene—it uses event-based logic to automatically hide locked skills and show only the ones you’ve unlocked.

{% hint style="info" %}
You may also want to call `UpdateHiddenSkillStates` when the player level changes, as some skills may have a level requirement.
{% endhint %}

```csharp
using Esper.SkillWeb.UI;
using Esper.SkillWeb.UI.UGUI;
using UnityEngine;

public class LockedSkillHider : MonoBehaviour
{
    private void Awake()
    {
        // Update hidden states skills when a web is loaded
        RuntimeWebViewer.onLoadCompleted.AddListener(webView =>
        {
            UpdateHiddenSkillStates(webView as WebViewUGUI);
        });

        // Update the hidden states when any skill state is changed
        SkillNodeUGUI.onStateChanged.AddListener(skillNodeUI =>
        {
            UpdateHiddenSkillStates(skillNodeUI.webView);
        });
    }

    /// <summary>
    /// Hides all locked skills while also revealing unlocked skills.
    /// </summary>
    /// <param name="webView">The target web view.</param>
    public void UpdateHiddenSkillStates(WebViewUGUI webView)
    {
        foreach (var item in webView.loadedSkillNodes)
        {
            var skillNodeUI = item.Value;
            bool active = !skillNodeUI.skillNode.IsLocked;
            skillNodeUI.gameObject.SetActive(active);

            var connections = skillNodeUI.GetConnections();

            foreach (var connection in connections)
            {
                connection.gameObject.SetActive(active);
            }
        }
    }
}
```
