Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
525 B
0
Indexable
Never
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.AddressableAssets;


public class EnvironmentButtonController : MonoBehaviour
{
    public AssetLabelReference addressableKey;

    void Start()
    {
        // Get the Button component attached to the same GameObject
        Button envButton = GetComponent<Button>();

        // Assign a listener to the button's onClick event
        envButton.onClick.AddListener(delegate { EnvironmentTransitionManager.Instance.ChangeEnvironment(addressableKey); });
    }


}