Exemplo n.º 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
        {
            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();
        }
    }
Exemplo n.º 2
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.GetComponent <BMaze_MonsterMovement>())
     {
         col.GetComponent <BMaze_MonsterMovement>().Pickup(pickup);
     }
     if (pickup == TypeOfPickup.Water)
     {
         GetComponent <BMaze_WaterPickup> ().IncreaseTime();
     }
     BMaze_Manager.GetInstance().ShowSubtitle(pickup.ToString());
     pickupMan.pickupList.Remove(gameObject);
     gameObject.SetActive(false);
 }
Exemplo n.º 3
0
    void Start()
    {
        rigBody       = GetComponent <Rigidbody2D> ();
        allowMovement = true;
        manager       = BMaze_Manager.GetInstance();

        /*
         * if (!SnapGen) {
         *      SnapGen = GameObject.Find ("SnapPointCreator").GetComponent<BMaze_SnapPointGenerator>();
         * }
         */

        audioSrc = GetComponent <AudioSource> ();

        //locationX = SnapGen.startingGridX;
        //locationY = SnapGen.startingGridY;
        //MoveToSnapPoint ();
        //CheckAllCollisions ();
    }
Exemplo n.º 4
0
    public void Display(string subtitle, AudioClip clip = null, bool queue = false)
    {
        if (!gameObject.activeSelf)
        {
            gameObject.SetActive(true);
        }

        if (sub == null)
        {
            sub = new Subtitle();
        }

        if (!queue || !isDisplaying)
        {
            isDisplaying = true;
            sub.Display(gameObject, textComp, subtitle, clip);
            if (EmotionsGameManager.GetInstance())
            {
                StartCoroutine(WaitTillHide(EmotionsGameManager.GetInstance().waitDuration));
            }
            else if (BMaze_Manager.GetInstance())
            {
                StartCoroutine(WaitTillHide(2f));
            }

            /*
             * else if (MemoryMatchGameManager.GetInstance ()) {
             *      StopCoroutine (WaitTillHide(3f));
             *      StartCoroutine (WaitTillHide (3f));
             * }
             */
        }
        else
        {
            Tuple <string, AudioClip> t = new Tuple <string, AudioClip>(subtitle, clip);
            displayQueue.Enqueue(t);
            t.ToString();
        }
    }
Exemplo n.º 5
0
    void OnTriggerEnter2D(Collider2D col)
    {
        print("Finish");
        if (finished)
        {
            col.GetComponentInChildren <BMaze_Monster> ().PlayDance();
            col.GetComponent <BMaze_MonsterMovement> ().allowMovement = false;
            col.GetComponent <BMaze_MonsterMovement> ().finished      = true;
            col.GetComponent <BMaze_MonsterMovement> ().gotoPos       = finishSpot.transform.position;
            //col.transform.position = finishSpot.transform.position;

            audioSrc.Play();
            if (!BMaze_Manager.isTutorialRunning)
            {
                StartCoroutine(BMaze_Manager.GetInstance().EndGameWait(3f));
            }
            else
            {
                BMaze_Manager.GetInstance().TutorialFinished();
            }
        }
    }
Exemplo n.º 6
0
 void GoalAchieved()
 {
     audioSrc.Play();
     BMaze_Manager.UnlockDoor();
 }