1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /****************************************************************************
- * 2025.6 LXD
- ****************************************************************************/
- using System;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using QFramework;
- namespace QFramework
- {
- public partial class OptionItem : UIElement
- {
- public bool isOn;
- private void Awake()
- {
- ClickBtn.onClick.AddListener(OnClickBtnClick);
- SetState();
- }
- public void InitData(string str)
- {
- var arr = str.Split('_');
- string tmpPicturePath = "Config/Ìâ¿âͼÎÄͼƬ/" + arr[1];
- ClickBtn.GetComponent<Image>().sprite = LoadHelper.LoadSpriteFromStreamming(tmpPicturePath);
- var arr1 = arr[0].Split('¡¢');
- Text.text = arr1[1];
- }
- protected override void OnBeforeDestroy()
- {
- }
- private void OnClickBtnClick()
- {
- isOn = !isOn;
- SetState();
- }
- private void SetState()
- {
- HighterState.gameObject.SetActive(isOn);
- NormalState.gameObject.SetActive(!isOn);
- }
-
- }
- }
|