예제 #1
0
    private void Reset()
    {
        events = GetComponent <UIEvents>();

        StartCoroutine(Init());

        IEnumerator Init()
        {
            yield return(null);

            events.AddPersistentListener(ref events.onEnter, this, "OnEnter");
            events.AddPersistentListener(ref events.onClick, this, "OnClick");
            events.AddPersistentListener(ref events.onExit, this, "OnExit");
        }
    }
예제 #2
0
    private void Reset()
    {
        events = GetComponent <UIEvents>();

        StartCoroutine(Init());

        IEnumerator Init()
        {
            yield return(null);

            events.AddPersistentListener(ref events.onEnter, this, "OnEnter");
            events.AddPersistentListener(ref events.onClick, this, "OnClick");
            events.AddPersistentListener(ref events.onExit, this, "OnExit");

            enterClip = this.LoadAssetRef <AudioClip>("ButtonEnter");
            clickClip = this.LoadAssetRef <AudioClip>("ButtonClick");
            exitClip  = this.LoadAssetRef <AudioClip>("ButtonExit");
        }
    }