Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }
        if (!gameStarted && Input.anyKey)
        {
            gameStarted = true;
            GameObject.FindGameObjectWithTag("MainMenu").SetActive(false);

            GameObject lavaObject = GameObject.FindGameObjectWithTag("Lava");
            if (lavaObject)
            {
                Eruption lava = lavaObject.GetComponent <Eruption>();
                lava.StartCoroutine(lava.Erupt());
            }
        }
    }
Exemplo n.º 2
0
    private static void GetHitDetails(out Spell spell, out int row, out int col)
    {
        spell = null;

        string[] input = Console.ReadLine()
            .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
            .ToArray();

        string spellName = input[0];
        if (spellName == "Cloud")
        {
            spell = new Cloud();
        }
        else if (spellName == "Eruption")
        {
            spell = new Eruption();
        }

        row = int.Parse(input[1]);
        col = int.Parse(input[2]);
    }