Exemple #1
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (!GameManager.GetInstance())
        {
            SwitchScene switchScene = this.gameObject.AddComponent <SwitchScene> ();
            switchScene.loadScene("Start");
        }
        else
        {
            difficultyLevel = GameManager.GetInstance().GetLevel("MemoryMatch");
            typeOfMonster   = GameManager.GetMonsterType();
            CreateMonster();
            monsterObject.PlaySpawn();
            RetrieveFoodsFromManager();

            if (GameManager.GetInstance().LagoonReview)
            {
                StartReview();
            }
            else
            {
                PregameSetup();
            }
        }
    }
Exemple #2
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (!GameManager.GetInstance())
        {
            SwitchScene switchScene = this.gameObject.AddComponent <SwitchScene> ();
            switchScene.loadScene("Start");
        }
        else
        {
            level = GameManager.GetInstance().GetLevel("BrainMaze") - 1;
            if (level > 2)
            {
                level = 2;
            }

            if (SoundManager.GetInstance())
            {
                SoundManager.GetInstance().ChangeBackgroundMusic(backgroundMusic);
                SoundManager.GetInstance().StopPlayingVoiceOver();
            }

            backButton.SetActive(true);
            stickerPopupCanvas.gameObject.SetActive(false);
            gameOverCanvas.SetActive(false);
            subtitlePanel.SetActive(false);
            tutorialHand.SetActive(false);
            ChangeSlider(0f);
            timeLeft = timeLimit;
            if (timerText == null)
            {
                Debug.LogError("No Timer Found!");
            }
            timerText.text = Mathf.Round(timeLeft).ToString();

            if (GameManager.GetInstance().LagoonTutorial [(int)Constants.BrainstormLagoonLevels.BRAINMAZE])
            {
                tutorialCoroutine = StartCoroutine(RunTutorial());
            }
            else
            {
                SetupMaze(level);
            }

            typeOfMonster = GameManager.GetMonsterType();
        }
    }
Exemple #3
0
 void Start()
 {
     typeOfMonster = GameManager.GetMonsterType();
     animComp      = GetComponent <Animator> ();
     ChangeMonsterSprite(monsterSprites [(int)typeOfMonster]);
     PlayIdle();
     if (idleAnimationOn)
     {
         StartCoroutine(RandomAnimation());
     }
 }
Exemple #4
0
    public void PregameSetup()
    {
        score = 0;
        scoreGauge.maxValue = scoreGoals[difficultyLevel];
        UpdateScoreGauge();

        typeOfMonster = GameManager.GetMonsterType();
        CreateMonster();
        monsterObject.PlaySpawn();

        if (GameManager.GetInstance().LagoonTutorial [(int)Constants.BrainstormLagoonLevels.BRAINBOW])
        {
            tutorialCoroutine = StartCoroutine(RunTutorial());
        }
        else
        {
            StartGame();
        }
    }
Exemple #5
0
    public void PlayDance()
    {
        monster = GameManager.GetMonsterType();
        switch (monster)
        {
        case GameManager.MonsterType.Blue:
            animComp.Play("BMaze_BlueBabyDance");
            break;

        case GameManager.MonsterType.Green:
            animComp.Play("BMaze_GreenBabyDance");
            break;

        case GameManager.MonsterType.Red:
            animComp.Play("BMaze_RedBabyDance");
            break;

        case GameManager.MonsterType.Yellow:
            animComp.Play("BMaze_YellowBabyDance");
            break;
        }
    }
Exemple #6
0
 void Awake()
 {
     animComp = GetComponentInChildren <Animator> ();
     monster  = GameManager.GetMonsterType();
 }
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (!GameManager.GetInstance())
        {
            SwitchScene switchScene = this.gameObject.AddComponent <SwitchScene> ();
            switchScene.loadScene("Start");
        }

        else
        {
            tutorialCanvas.gameObject.SetActive(false);
            tutorialHand.SetActive(false);

            secondaryEmotions = new List <GameObject> ();

            // Checks if game manager exists, if not default values are chosen
            if (GameManager.GetInstance())
            {
                monsterType = GameManager.GetMonsterType();

                if (monsterType == GameManager.MonsterType.Blue)
                {
                    primaryEmotions = blueEmotions;
                }
                else
                {
                    secondaryEmotions.AddRange(blueEmotions);
                }
                if (monsterType == GameManager.MonsterType.Green)
                {
                    primaryEmotions = greenEmotions;
                }
                else
                {
                    secondaryEmotions.AddRange(greenEmotions);
                }
                if (monsterType == GameManager.MonsterType.Red)
                {
                    primaryEmotions = redEmotions;
                }
                else
                {
                    secondaryEmotions.AddRange(redEmotions);
                }
                if (monsterType == GameManager.MonsterType.Yellow)
                {
                    primaryEmotions = yellowEmotions;
                }
                else
                {
                    secondaryEmotions.AddRange(yellowEmotions);
                }

                difficultyLevel = GameManager.GetInstance().GetLevel("MonsterEmotions");
            }
            else
            {
                monsterType     = GameManager.GetMonsterType();
                primaryEmotions = greenEmotions;
                secondaryEmotions.AddRange(blueEmotions);
                secondaryEmotions.AddRange(redEmotions);
                secondaryEmotions.AddRange(yellowEmotions);
                difficultyLevel = 1;
            }

            emotionsSetup = new Dictionary <int, Tuple <int, int> > ()
            {
                { 1, new Tuple <int, int> (2, 0) },
                { 2, new Tuple <int, int> (3, 0) },
                { 3, new Tuple <int, int> (4, 0) },
                { 4, new Tuple <int, int> (3, 1) },
                { 5, new Tuple <int, int> (2, 2) }
            };

            if (GameManager.GetInstance().LagoonTutorial [(int)Constants.BrainstormLagoonLevels.EMOTIONS])
            {
                tutorialCoroutine = StartCoroutine(RunTutorial());
            }
            else
            {
                PregameSetup();
            }
        }
    }