Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        userControlls     = GameObject.Find("UserController").GetComponent <UserControlls>();
        finished          = false;
        timeSpentStanding = 0;
        //Enable timer
        if (level > 1)
        {
            timerText = GameObject.FindGameObjectWithTag("theTimer").GetComponent <TextMeshProUGUI>();
            tickAudio = timerText.GetComponent <AudioSource>();
        }
        //Enable speed slider
        if (level > 2)
        {
            speedSlider = GameObject.FindGameObjectWithTag("Time_Slider").GetComponent <Slider>();
        }
        coinText   = GameObject.Find("Nmber of Coins").GetComponent <TextMeshProUGUI>();
        levelStart = false;
        setCoinDisplay();



        inventoryManager = GameObject.FindGameObjectWithTag("inventory_manager").GetComponent <InventoryManager>();
        camel            = GameObject.FindGameObjectWithTag("Camel");
        winMessage       = GameObject.FindWithTag("win_message");
        winMessage.SetActive(false);

        looseMessage = GameObject.FindWithTag("loose_message");
        looseMessage.SetActive(false);

        if (!(level == 1))
        {
            float  t       = levelLimitTime;
            string minutes = Mathf.Floor(t / 60).ToString("00");
            string seconds = (t % 60).ToString("00");
            timerText.text = minutes + ":" + seconds;
        }
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        findlevel    = GameObject.FindGameObjectWithTag("GameController").GetComponent <LevelController>();
        level        = findlevel.GetLevel();
        userControls = GameObject.Find("UserController").GetComponent <UserControlls>();

        //Used for enabling and disabling item swapping
        controlClicking = GameObject.FindGameObjectWithTag("inventory_manager").GetComponent <InventoryManager>();
        switch (level)
        {
        case 1:
            textMain.Add("Finally! You're here!\n\n" +
                         "Ohohoh you're in trouble my friend.\n\n" +
                         "The Sultan increased the taxes and if you don't pay them daily you will go to jail!");
            textMain.Add("\nDeliver the goods to me at the market and I will make sure you are paid well.");
            //textMain.Add("\nEvery day I will wait at the market for the goods and I will pay you good coin for your delivery services.\n\n" +
            //    "Your job is to load up my sweet camel G'Zilla efficiently so I receive enough goods and you receive your money.");
            //textMain.Add("\nThe heavier the load - the slower my ol' G'Zilla goes");


            textSecondary.Add("Load the camel's chest by clicking on an item.");
            // textSecondary.Add("The red number represents the weight of the item and the yellow number - how much money you'll get for it.");
            //textSecondary.Add("Be careful. If the chest is too heavy, the camel won't move.");
            textSecondary.Add("This is your money goal for the day.");
            //textSecondary.Add("And remember - you need to reach the goal before the market closes!\nGood Luck!");
            textSecondary.Add("Click on the camel when you're ready to deliver the goods.");



            secondaryPosition.Add(new Vector3(-340, -78, -50));
            //  secondaryPosition.Add(new Vector3(-340, -108, -50));
            //secondaryPosition.Add(new Vector3(-6, -90, -50));
            secondaryPosition.Add(new Vector3(110, -90, -50));
            //secondaryPosition.Add(new Vector3(-75, 55, -50));
            secondaryPosition.Add(new Vector3(-75, 55, -50));



            buttonActive = false;


            mainPanel.SetActive(true);
            secondaryPanel.SetActive(false);
            ChangeMainText();
            break;

        case 2:
            textSecondary.Add("Every Item has a unique price and weight.");
            textSecondary.Add("Click the most expensive item.");
            textSecondary.Add("This is the total chest weight, the heavier the weight the slower G'Zilla goes.");
            textSecondary.Add("Try pressing 'Space' to send this item to the market.");
            textSecondary.Add("This is taking too long, the market will be closed by the time we get there. Press the R key to restart.");
            textSecondary.Add("Come on slacker! You need to pull your own weight now. The taxes won't pay themselves!");

            secondaryPosition.Add(new Vector3(-340, -78, -50));
            secondaryPosition.Add(new Vector3(-340, -78, -50));
            secondaryPosition.Add(new Vector3(0, -90, -50));
            secondaryPosition.Add(new Vector3(-75, 55, -50));
            secondaryPosition.Add(new Vector3(-75, 55, -50));
            secondaryPosition.Add(new Vector3(-75, 55, -50));

            mainPanel.SetActive(false);
            secondaryPanel.SetActive(true);

            if (userControls.GetInstructedToRestart() == true)
            {
                GameObject.Find("Umbrella").GetComponent <Button>().interactable = true;
                SetTextDisplayCount(5);
            }
            if (userControls.GetInstructedToRestart())
            {
                controlClicking.SetSwap(true);
            }
            else
            {
                controlClicking.SetSwap(false);
            }
            ChangeSecondaryText();
            break;

        case 3:
            textMain.Add("Hot and cold items can't be put in the camel's chest together.");

            mainPanel.SetActive(true);
            secondaryPanel.SetActive(false);

            ChangeMainText();
            break;

        case 4:
            break;
        }
    }