| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- /* 勾选框-用户协议和隐私政策 */
- public class AgreenmentOption_Second : MonoBehaviour
- {
- [SerializeField] Toggle toggle;
- void Awake() {
- toggle.onValueChanged.AddListener(SetAgreementChecked);
- InitAgreementOnClickListeners();
- }
- void OnEnable()
- {
- //进来一定是同意条件后才进此页面
- toggle.isOn = true;
- }
- void OnDestroy() {
- }
- void InitAgreementOnClickListeners() {
- transform.Find("TextA").GetComponent<Button>().onClick.AddListener(delegate() {
- GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
- o.GetComponent<AgreementView>().EnterUserAgreement();
- });
- transform.Find("TextB").GetComponent<Button>().onClick.AddListener(delegate() {
- GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
- o.GetComponent<AgreementView>().EnterPrivacyAgreement();
- });
- }
- //public void onAgreeStatusChange(bool isOn) {
- // if (toggle.isOn != isOn)
- // toggle.isOn = isOn;
- //}
- public void SetAgreementChecked(bool value) {
- //修改主页按钮状态
- AgreenmentOption.ins.SetAgreementChecked(value);
- }
- }
|