Ejemplo n.º 1
0
    public void StartGame()
    {
        if (LilySpawner == null)
        {
            LilySpawner = FindObjectOfType <LilypadSpawner>();
        }
        LilySpawner.gameObject.SetActive(true);
        if (originalLilyDelay == -1)
        {
            originalLilyDelay = LilySpawner.SpawnInfo.DelayBetweenSpawns;
        }
        LilySpawner.SpawnInfo.DelayBetweenSpawns /= PointsMultiplier;

        if (BugsSpawner == null)
        {
            BugsSpawner = FindObjectOfType <BugsSpawner>();
        }
        BugsSpawner.gameObject.SetActive(true);
        if (originalBugsDelay == -1)
        {
            originalBugsDelay = BugsSpawner.SpawnInfo.DelayBetweenSpawns;
        }
        BugsSpawner.SpawnInfo.DelayBetweenSpawns /= PointsMultiplier;

        LilySpawner.SpawnLilypad();

        if (Frog == null)
        {
            Frog = FindObjectOfType <FrogController>();
        }
        Frog.gameObject.SetActive(true);

        LilypadController spawnedLily = GetCloseLilyPad(Frog.transform.position, 100);

        Frog.transform.position = spawnedLily.transform.position;
        Frog.SetParentLily(spawnedLily);

        if (UICtrl == null)
        {
            UICtrl = FindObjectOfType <UIController>();
        }
        UICtrl.ToggleMainMenu(false);

        if (inputCtrl == null)
        {
            inputCtrl = GetComponent <InputController>();
        }
        inputCtrl.enabled = true;
    }
Ejemplo n.º 2
0
 public void SetBugSpawner(BugsSpawner _spawner)
 {
     bugSpawner = _spawner;
 }