Esempio n. 1
0
    void Start()
    {
        if (GameObject.Find(MainMenu.ArraysDataName) == null)
        {
            SceneManager.LoadScene("Assets/Scenes/Main Menu.unity", LoadSceneMode.Single);
            return;
        }

        arraysData = GameObject.Find(MainMenu.ArraysDataName).GetComponent <ArraysData>();
        startedCoroutineBombKnife   = new Queue <Coroutine>();
        Application.targetFrameRate = 300;

        online = gameObject.GetComponent <GameScriptOnline>();
        GameObject data = GameObject.Find("Data");

        isOnline = data != null;
        if (isOnline)
        {
            EndGameShow.addPlays(-1);
            online_data = data.GetComponent <OnlineData>();
            strategy    = Online.WRITE;
            rank        = (PlayerPrefs.GetInt("rank", 4) + online_data.rank_him) / 2;
        }
        else
        {
            rank     = PlayerPrefs.GetInt("rank", 4);
            strategy = Online.OFFLINE;
            hideOnlineObjects();
        }
        isT = isOnline? online_data.getTeam() : Random.Range(0, 2) == 1;
        initializeMyTeam();
        gameMode       = 0;
        enemysNameList = new List <String>();
        kills          = 0;
        round          = (WIN_SCORE - round_per_half);
        ctScore        = round / 2;
        tScore         = round - ctScore;
        yourName       = PlayerPrefs.GetString("name", LanguageSystem.GET_NAME());
        maxLooks       = isT ? T_aimPoints.Length : CT_aimPoints.Length;
        getEnemySpawn().initEnemysFirstNameList(START_ENEMY_COUNT, isOnline);
        newTeam();
        resetLook();

        beforeNewRound();
    }
Esempio n. 2
0
 public void addPlays(int i)
 {
     Debug.Log("ADTEST + addPlays: " + i);
     EndGameShow.addPlays(i);
     refreshPlays();
 }