Ejemplo n.º 1
0
    public void MakeSegment(SegementDifficulty difficulty, TrainType [] names, bool[] trains, bool[] coins, int[] Bonus)
    {
        this.difficulty = difficulty;
        RoadSegements segement = new RoadSegements(names, trains, coins, Bonus);

        AddSegements(segement);
    }
Ejemplo n.º 2
0
    private void OnGUI()
    {
        difficulty = (SegementDifficulty)EditorGUI.EnumPopup(new Rect(10, 10, 100, 10), difficulty);
        GUI.Label(new Rect(10, 40, 300, 15), "Pattern name", EditorStyles.boldLabel);
        GUI.Label(new Rect(10, 60, 300, 15), "Pattern Lenght", EditorStyles.boldLabel);


        FileName = GUI.TextArea(new Rect(120, 40, 300, 15), FileName);
        GUI.Label(new Rect(10, 140, 100, 15), "Train", EditorStyles.boldLabel);
        GUI.Label(new Rect(10, 190, 110, 15), "Coin", EditorStyles.boldLabel);
        GUI.Label(new Rect(10, 210, 110, 15), "Bonus", EditorStyles.boldLabel);



        for (int i = 0; i < RoadLenght; i++)
        {
            GUI.Label(new Rect(45 + (ToogleOffset * i), 120, 100, 10), (i + 1).ToString(), EditorStyles.boldLabel);
            trainType[i]     = (TrainType)EditorGUI.EnumPopup(new Rect(45 + ((ToogleOffset + 60) * i), 160, 60, 10), trainType[i]);
            TrainSelected[i] = EditorGUI.Toggle(new Rect(50 + (ToogleOffset * i), 140, 10, 10), TrainSelected[i]);
            coinsSelected[i] = EditorGUI.Toggle(new Rect(50 + (ToogleOffset * i), 190, 10, 10), coinsSelected[i]);
            BonusSpawned[i]  = EditorGUI.IntField(new Rect(50 + (ToogleOffset * i), 210, 20, 20), BonusSpawned[i]);
            //trainType[i] = (TrainType)EditorGUI.EnumPopup(new Rect(60, 88 + (20 * i), 100, 10),trainType[i]);
        }

        if (GUI.Button(new Rect(10, 240, 200, 50), "Add Segement"))
        {
            AddSegement(TrainSelected, trainType, coinsSelected, BonusSpawned);
        }


        if (GUI.Button(new Rect(10, 315, 200, 50), "Clear pattern"))
        {
            ClearPattern();
        }

        if (GUI.Button(new Rect(10, 375, 200, 50), "Creat build file"))
        {
            CreatAssets();
        }

        for (int i = 0; i < TrainConfirmed.Count; i++)
        {
            for (int j = 0; j < RoadLenght; j++)
            {
                GUI.Label(new Rect(620 + (20 * j), 100, 100, 10), (j + 1).ToString(), EditorStyles.boldLabel);
                EditorGUI.Toggle(new Rect(620 + (20 * j), 120 + (20 * i), 50, 10), TrainConfirmed[i][j]);
            }
        }
    }
    private void CheckDifficulty()
    {
        int currentScore = score.GetScore();

        if (currentScore < NormalDifficultyMax)
        {
            currentDifficulty = SegementDifficulty.Easy;
        }
        else if (currentScore < HardDifficultyMax)
        {
            currentDifficulty = SegementDifficulty.Normal;
        }
        else
        {
            currentDifficulty = SegementDifficulty.Hard;
        }
    }
Ejemplo n.º 4
0
 public void SetDifficulty(SegementDifficulty NewDifficulty)
 {
     patternManager.CurrentDifficulty = NewDifficulty;
 }
 public void SetDifficulty(SegementDifficulty difficulty)
 {
     currentDifficulty = difficulty;
 }