コード例 #1
0
    public void onClick()
    {
        //if (!doubleClickTimer.countingDown)
        //{
        //    doubleClickTimer.StartCountdown();
        //    withinTimeLimit = true;
        //}
        //else
        //{
        //    if (withinTimeLimit)
        //    {
        HostedGameLobbies hostedGameLobbiesScript = GetComponentInParent <HostedGameLobbies>();

        hostedGameLobbiesScript.RemoveRefreshHostedGamesListener();

        //ChallengeManager challengeManager = GameObject.Find("ChallengeManager").GetComponent<ChallengeManager>();
        JoinPendingMatchRequest joinPendingMatch = new JoinPendingMatchRequest();

        joinPendingMatch.SetMatchShortCode(matchShortCode);
        joinPendingMatch.SetPendingMatchId(gameID);
        joinPendingMatch.Send(OnJoinPendingMatchSuccess, OnJoinPendingMatchError);

        //        RemoveAllHostedGames();
        //    }
        //}
    }
コード例 #2
0
    private void OnChallengeStarted(ChallengeStartedMessage message)
    {
        UnblockMatchInput();
        HostedGameLobbies hostedGameLobbiesScript = GameObject.Find("HostedGameLobbies").GetComponent <HostedGameLobbies>();

        hostedGameLobbiesScript.RemoveRefreshHostedGamesListener();

        Debug.Log("Challenge Started");
        // Switch to GameBoard Scene connected to opponent
        // SceneManager.LoadScene("GameBoard");
        if (chatWindowPanel == null)
        {
            //chatWindowPanel = GameObject.Find("ChatWindowPanel");
            var objectsChatWindow = Resources.FindObjectsOfTypeAll(typeof(ChatWindowPanel));
            var objectsEnumer     = objectsChatWindow.GetEnumerator();
            objectsEnumer.MoveNext();
            var gameObjectChat = (ChatWindowPanel)objectsEnumer.Current;
            chatWindowPanel = gameObjectChat.gameObject;
        }
        //chatWindowPanel.GetComponent<ChatWindowPanel>().ClearAllFriendsChats();
        GameObject.Find("LevelChanger").GetComponent <LevelChanger>().FadeToLevel("GameBoard");
    }