Ejemplo n.º 1
0
    void Awake()
    {
        dataStorage = DataDeserializer.Deserialize();
        gameObjectList.Add(prefab1);
        gameObjectList.Add(prefab2);
        gameObjectList.Add(prefab3);
        gameObjectList.Add(prefab4);
        gameObjectList.Add(prefab5);
        gameObjectList.Add(prefab6);
        gameObjectList.Add(prefab7);
        gameObjectList.Add(prefab8);
        gameObjectList.Add(prefab9);
        pickupList.Add(pickupObject1);
        pickupList.Add(pickupObject2);
        pickupList.Add(obstacle1);
        prefabEndInstance       = prefabEnd;
        highscorePrefabInstance = highscorePrefab;

        skinList.Add(skin1);
        skinList.Add(skin2);


        backgroundList.Add(background1);
        backgroundList.Add(background2);

        goldProbability       = gold_Probability;
        sandProbability       = sand_Probability;
        diamondProbability    = diamond_Probability;
        emptyProbability      = empty_Probability;
        probabilityMultiplier = probability_Multiplier;


        AudioController.ChangingScene();
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        AudioController.ChangingScene();

        GameObject canvas = GameObject.Find("Canvas");
        GameObject scores = GameObject.Find("Scores");
        GameObject times  = GameObject.Find("Times");

        if (GameController.gameType == ENDLESS)
        {
            GameObject.FindGameObjectWithTag("EndGameMessage").GetComponent <Text>().text = (highscore < floors) ? "HIGHSCORE" : "NICE TRY";
            scores.transform.position = new Vector3(canvas.transform.position.x, scores.transform.position.y, scores.transform.position.z);
            times.transform.position  = new Vector3(5000f, times.transform.position.y, times.transform.position.z);
        }
        else
        {
            times.transform.position  = new Vector3(canvas.transform.position.x, times.transform.position.y, times.transform.position.z);
            scores.transform.position = new Vector3(5000f, scores.transform.position.y, scores.transform.position.z);
        }

        GameObject endGameMessage = GameObject.FindGameObjectWithTag("EndGameMessage");

        endGameMessage.GetComponent <Text>().fontSize = 40;

        if (completed && GameController.gameType != ENDLESS)
        {
            GameObject.Find("HighscoreTime").GetComponent <Text>().text = highscore.ToString("0.00");
            GameObject.Find("CurrentTime").GetComponent <Text>().text   = currentTime.ToString("0.00");
            if (highscore > currentTime || highscore == 0)
            {
                endGameMessage.GetComponent <Text>().text = "fastest completion";
                GameObject.Find("HighscoreTime").GetComponent <Text>().text = currentTime.ToString("0.00");
            }
            else
            {
                endGameMessage.GetComponent <Text>().text = "successfully completed challenge";
            }
            endGameMessage.GetComponent <Text>().fontSize = 25;
            completed = false;
        }
        else if (GameController.gameType != ENDLESS)
        {
            times.transform.position = new Vector3(5000f, times.transform.position.y, times.transform.position.z);
            endGameMessage.GetComponent <Text>().text = "better luck next time";
        }

        GameObject.FindGameObjectWithTag("EndGameScore").GetComponent <Text>().text     = floors.ToString();
        GameObject.FindGameObjectWithTag("EndGameHighscore").GetComponent <Text>().text = (highscore < floors) ? floors.ToString() : highscore.ToString();
        GameObject.FindGameObjectWithTag("EndGameMoney").GetComponent <Text>().text     = DataDeserializer.Deserialize().getMoney().ToString();

        GameObject.Find("MoneyGathered").GetComponent <Text>().text = scoredMoney + "";

        //if (scoredMoney == 0)
        //{
        GameObject.Find("WatchAd").transform.position = new Vector3(5000, 0, 0);
        //}
    }
Ejemplo n.º 3
0
 void Awake()
 {
     ShowMenu();
     AudioController.ChangingScene();
     AdvertisementController.StartAdvertisements();
 }