Untitled

 avatar
unknown
plain_text
2 years ago
525 B
4
Indexable
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); });
    }


}
Editor is loading...