Exemplo n.º 1
0
 public void BattleLose()
 {
     if (!string.IsNullOrEmpty(_battleRoomId))
     {
         GameSkillsApi.SetMyBattleStatus(_battleRoomId, ApiBattleStatus.lose.ToString());
     }
 }
Exemplo n.º 2
0
 public void CollectReward()
 {
     if (!string.IsNullOrEmpty(_rewardToken))
     {
         GameSkillsApi.CoinCollect(_rewardToken);
     }
 }
Exemplo n.º 3
0
 private void Start()
 {
     GameSkillsApi.Init("player_0", "DemoPlayerName");
     GameSkillsApi.OnLoginCallback  += OnLogin;
     GameSkillsApi.OnUpdateCallback += OnApiUpdate;
     GameSkillsApi.OnCoinCallback   += OnCoinUpdate;
 }
Exemplo n.º 4
0
        public static void Init(
            string playerId,
            string playerName        = "User",
            string localeBackBtnName = "Close",
            string socialId          = "none",
            string pushId            = "none")
        {
            if (_isInit)
            {
                return;
            }
            GameObject go   = new GameObject("GameSkillsApi");
            var        comp = go.AddComponent <GameSkillsApi>();

            _instance = comp;
            _isInit   = true;
            DontDestroyOnLoad(comp);

            _instance._playerId       = playerId;
            _instance._playerName     = playerName;
            _instance._webviewBackBtn = localeBackBtnName;
            _instance._socialId       = socialId;
            _instance._pushId         = pushId;

            Config config = Resources.Load <Config>("Config");

            if (config != null)
            {
                _instance._gameId = config.GameId;
                _instance.Login(socialId, pushId);
            }
        }
Exemplo n.º 5
0
 public void OpenPage()
 {
     GameSkillsApi.OpenDefaultWebPage();
 }