Пример #1
0
 public void MCR_PressButtonChampionship()
 {
     changeBtnNavigation.MCR_NewButtonNavigation(btn_BackSelectMode, btn_ValidateChampionship, "Down");
 }
Пример #2
0
    public void MCR_NextTrackOrRestartChampionship_Part2(List <int> carName, List <int> carPoints)
    {
        objNextPage.SetActive(false);

        b_btn_NextTrack = true;
        EventSystem eventSystem = GameObject.Find("EventSystem").GetComponent <EventSystem>();



        championshipM championshipManager = GameObject.Find("championshipManager").GetComponent <championshipM>();

        // Championship continue
        if (championshipManager.currentTrackInTheList < championshipManager.champInventory.listOfChampionship[championshipManager.currentSelectedChampionship].scenesName.Count - 1)
        {
            objNextTrack.SetActive(true);
            championshipManager.currentTrackInTheList++;
            txt_ScreenTitle.text = s_NewTitleGlobalresult;
            if (objStamp_02)
            {
                objStamp_02.gameObject.SetActive(true);
                objStamp_02.AP_LogoAnimation();
            }
            updateSpriteScale.MCR_UpdateNextTrackSprite();
            //Debug.Log("Next Page");
            eventSystem.SetSelectedGameObject(btn_NextTrack.gameObject);
            changeBtnNavigation.MCR_NewButtonNavigation(btn_MainMenu, btn_NextTrack, "Right");
        }
        // End of the championship
        else
        {
            objRestartChampionship.SetActive(true);
            championshipManager.currentTrackInTheList++;
            txt_ScreenTitle.text = s_NewTitleFinalResult;
            if (objStamp_03)
            {
                objStamp_03.gameObject.SetActive(true);
                objStamp_03.AP_LogoAnimation();
            }
            updateSpriteScale.MCR_UpdateTrackSprite();
            eventSystem.SetSelectedGameObject(btn_MainMenu.gameObject);
            //Debug.Log("Next Track");
            changeBtnNavigation.MCR_NewButtonNavigation(btn_MainMenu, btn_RestartChampionship, "Right");
        }


        objTxt_Time.SetActive(false);


        //Update Score List
        for (var i = 0; i < listScore.Count; i++)
        {
            listScore[i].GetChild(0).gameObject.GetComponent <Text>().text = (i + 1).ToString();

            if (carName[i] == 0 &&
                PlayerPrefs.GetInt("HowManyPlayers") == 1)
            {                                           // --> Player 1
                listScore[i].GetChild(1).gameObject.GetComponent <Text>().text = stringForPlayerText + 1;
            }
            else if (
                (carName[i] == 0 || carName[i] == 1) &&
                PlayerPrefs.GetInt("HowManyPlayers") == 2)
            {                                           // --> Player 2
                if (carName[i] == 0)
                {
                    listScore[i].GetChild(1).gameObject.GetComponent <Text>().text = stringForPlayerText + 1;
                }
                if (carName[i] == 1)
                {
                    listScore[i].GetChild(1).gameObject.GetComponent <Text>().text = stringForPlayerText + 2;
                }
            }
            else
            {
                if (useCarName)
                {
                    listScore[i].GetChild(1).gameObject.GetComponent <Text>().text = lapCounter.carController[carName[i]].name;                                    // display name
                }
                else
                {
                    listScore[i].GetChild(1).gameObject.GetComponent <Text>().text = stringForCPUText + " " + (carName[i] + 1).ToString();
                }
            }

            listScore[i].GetChild(2).gameObject.SetActive(false);
            listScore[i].GetChild(3).gameObject.GetComponent <Text>().text = carPoints[i].ToString();
        }

        MCR_checkIfNewChampionshipNeedToBeUnlocked(carName, carPoints);
    }