yyl
2025-09-12 c5c6c915069a1f93d10ee3d2c897beca1e100c8d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using UnityEngine.UI;
using System;
using UnityEngine;
using UnityEngine.EventSystems;
 
public class ToggleEx : Toggle
{
    [SerializeField]
    int m_Audio;
    public int clickAudio {
        get { return this.m_Audio; }
        set { this.m_Audio = value; }
    }
 
    protected override void OnEnable()
    {
        base.OnEnable();
    }
 
    public override void OnPointerClick(PointerEventData eventData)
    {
        base.OnPointerClick(eventData);
 
        SoundPlayer.Instance.PlayUIAudio(clickAudio);
    }
 
}