本演示项目在Unity for Android Build中启用部分华为HMS和AGC服务,对应的类和函数的名称和用法相同。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

40 行
1010 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace HuaweiAuthDemo
{
public class LoginInstatus : MonoBehaviour
{
// Start is called before the first frame update
[SerializeField] private GameObject loginButton;
public GameObject LoginButton
{
get { return loginButton; }
private set { loginButton = value; }
}
[SerializeField] private GameObject accountButton;
public GameObject AccountButton
{
get { return accountButton; }
private set { accountButton = value; }
}
public void OnLogin()
{
LoginButton.GetComponent<Canvas>().enabled = false;
AccountButton.GetComponent<Canvas>().enabled = true;
}
public void OnLogout()
{
LoginButton.GetComponent<Canvas>().enabled = true;
AccountButton.GetComponent<Canvas>().enabled = false;
}
}
}