Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        // //Check if instance already exists
        // if (instance == null)
        // {
        //  //if not, set instance to this
        //  instance = this;
        // }
        // //If instance already exists and it's not this:
        // else if (instance != this)
        // {
        //  //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
        //  Destroy(gameObject);
        // }

        currentPuzzleLevel = PuzzleLevel.One;

        setupCorrectCode();

        numpadDisplayText      = GameObject.Find("NumpadDisplayText").GetComponent <Text>();
        numpadDisplayText.text = "";
        numpadDisplayImage     = GameObject.Find("NumpadDisplayBackground").GetComponent <Image>();


        audioSource = GetComponent <AudioSource>();

        Debug.Log("Puzzle Manager GameObject name : " + transform.name);
    }
Beispiel #2
0
    public void OnPuzzleThreeSolved()
    {
        GameObject pointLight01 = GameObject.Find("Point Light (2)");

        if (pointLight01)
        {
            pointLight01.GetComponent <Light>().color = Color.green;
        }

        // play audio
        playLevelUpAudio();

        isPuzzleThreeSolved = true;
        currentPuzzleLevel  = PuzzleLevel.Four;
    }
Beispiel #3
0
    public void OnPuzzleOneSolved()
    {
        Debug.Log("PuzzleOneSolved()");

        GameObject pointLight00 = GameObject.Find("Point Light (0)");

        if (pointLight00)
        {
            pointLight00.GetComponent <Light>().color = Color.green;
        }

        // play audio
        playLevelUpAudio();

        isPuzzleOneSolved  = true;
        currentPuzzleLevel = PuzzleLevel.Two;
    }