Beispiel #1
0
    // Use this for initialization
    public void InitiateGame()
    {
        if (intiateGame)
        {
            return;
        }
        intiateGame = true;
        Debug.Log("Initiating Game!!");
        WhotConstants.SetColorFolderDic();
        PlayerPrefs.SetInt("PickTwo", 0);
        PlayerPrefs.SetInt("PickThree", 0);

        if (!WhotConstants.isAI)
        {
            isOnlineMode = true;
            WhotUiManager.instance.resultDisplayed = false;
            myRemainingLives.transform.parent.gameObject.SetActive(true);
            opponentRemainingLives.transform.parent.gameObject.SetActive(true);

            if (WHOTMultiplayerManager.Instance.myTurn == 0)
            {
                //StartTimer ();        //*commented before modification
                WhotManager.instance.turnMsg.SetActive(true);
                myTurn     = 0;
                playerTurn = true;
                AddCardsInPile();
                Debug.Log("Distribute cards under whotmanager 285");
                Invoke("DistributeCards", 1);
                UpdateUserAreaAndMsg();
                //WHOTMultiplayerManager.instance.SendProfile();        //No need to send profile as we are getting info from photon
            }
            else
            {
                WhotManager.instance.turnMsg.SetActive(false);
                myTurn     = 1;
                playerTurn = false;
                //DistributeForSecondPlayer();
                //Invoke ("AddOneCardInPlayedList", 1.1f);
            }
            StartCoroutine(ResetUIForGame());
        }
        else
        {
            myRemainingLives.transform.parent.gameObject.SetActive(false);
            opponentRemainingLives.transform.parent.gameObject.SetActive(false);
        }
    }
Beispiel #2
0
    public void OnStart()
    {
        WhotConstants.SetColorFolderDic();


        if (WhotConstants.isAI)
        {
            isOnlineMode = false;
            AddCardsInPile();
            Debug.Log("Distribute cards under whotmanager");
            Invoke("DistributeCards", 1);
            UpdateUserAreaAndMsg();
            List <string> AINames = new List <string> {
                "Rainbow", "Sunshine", "Marigold"
            };
            CPUName.text        = AINames[UnityEngine.Random.Range(0, 2)];
            PlayerNameText.text = UserDetailsManager.userName;
            chatOptions.SetActive(false);
        }
    }