示例#1
0
    public void ClickBall(  )
    {
        if (this.gameObject.GetComponentInChildren <Text>().text == sharedobj.getCurentNumber().ToString())
        {
            if (!sharedobj.getHardLevel())
            {
                this.gameObject.GetComponent <Image>().sprite        = DisableBall;
                this.gameObject.GetComponent <Button>().interactable = false;
            }
            sharedobj.setCurentNumber(sharedobj.getCurentNumber() + 1);

            sharedobj.setPlayersScoreListIndex(sharedobj.getPlayersScoreListIndex(sharedobj.getPlayersTurn() - 1) + 1,
                                               sharedobj.getPlayersTurn() - 1);
            //Debug.Log("score player num" +sharedobj.getPlayersTurn() + " : " + sharedobj.getPlayersScoreListIndex(sharedobj.getPlayersTurn()-1));
        }
    }
示例#2
0
    public void SaveSetting()
    {
        //Debug.Log(PlayerTextCount.text);
        sharedobj.setPlayersCount(int.Parse(PlayerTextCount.text));
        sharedobj.setIsFirstRound(true);
        //sharedobj.setIsGameStarted(true);
        sharedobj.setTimerForEveryone(TimerTextCount.text);
        sharedobj.setCountNum(int.Parse(NumTextCount.text));
        sharedobj.setCurentNumber(1);
        sharedobj.setPlayersTurn(0);         //نوبت نفر اول
        int[] Empty_Score = new int[6];
        Empty_Score[0] = 0;
        Empty_Score[1] = 0;
        Empty_Score[2] = 0;
        Empty_Score[3] = 0;
        Empty_Score[4] = 0;
        Empty_Score[5] = 0;

        sharedobj.setPlayersScoreList(Empty_Score);

        //PlayerPrefs.SetInt("IsGameStarted1",0);
        Debug.Log(sharedobj.getIsGameStarted());
        set();
    }