| 12345678910111213141516171819202122232425262728293031323334353637 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- /* 勾选框-用户协议和隐私政策 */
- public class AgreenmentOption : MonoBehaviour
- {
- public static AgreenmentOption ins;
- void Awake() {
- ins = this;
- InitAgreementOnClickListeners();
- }
- void OnDestroy() {
- if (ins == this) ins = null;
- }
- 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 bool IsAgreementChecked() {
- return transform.Find("Toggle").GetComponent<Toggle>().isOn;
- }
- public void SetAgreementChecked(bool value) {
- transform.Find("Toggle").GetComponent<Toggle>().isOn = value;
- }
- }
|