// Use this for initialization
    void Start()
    {
        Video.GetComponent <Renderer>().material.mainTexture = movTexture;
        movTexture.loop = false;

        flushAudio  = Flush.GetComponent <AudioSource>();
        movAudio    = Video.GetComponent <AudioSource>();
        beepAudio   = Beep.GetComponent <AudioSource>();
        screamAudio = Scream.GetComponent <AudioSource>();

        Video.SetActive(false);
        Footprint.SetActive(false);
        WallCode.SetActive(false);
        LastCode.SetActive(false);
        pic114.SetActive(false);
    }
    // Update is called once per frame
    void Update()
    {
        // Flush
        if (Input.GetKeyDown(KeyCode.F1))
        {
            flushAudio.Play();
        }

        // Mirrow
        if (Input.GetKeyDown(KeyCode.F2))
        {
            Video.SetActive(true);
            movTexture.Play();
            movAudio.Play();
            playedOnce = true;
        }
        if (movTexture.isPlaying == false && playedOnce)
        {
            Video.SetActive(false);
            Footprint.SetActive(true);
        }

        // Beep (for footprint)
        if (Input.GetKeyDown(KeyCode.F3))
        {
            beepAudio.Play();
        }

        // Scream (for openning box)
        if (Input.GetKeyDown(KeyCode.F4))
        {
            screamAudio.Play();
        }

        // Codes on the wall
        if (Input.GetKeyDown(KeyCode.F5))
        {
            WallCode.SetActive(true);
            LastCode.SetActive(true);
        }
        if (Input.GetKeyDown(KeyCode.F6))
        {
            pic114.SetActive(true);
        }
    }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        //spR.Open ();
        //spR.ReadTimeout = 1;
        sp.Open();
        sp.ReadTimeout = 1;

        // for video
        Video.GetComponent <Renderer>().material.mainTexture = movTexture;
        movTexture.loop = false;
        //movAudio = Video.GetComponent<AudioSource>();

        playedOnce = false;
        Video.SetActive(false);
        Footprint.SetActive(false);
        WallCode.SetActive(false);
        LastCode.SetActive(false);
        pic114.SetActive(false);
    }
Exemple #4
0
    // Update is called once per frame
    void Update()
    {
        amountToMove = speed * Time.deltaTime;

        if (sp.IsOpen)
        {
            try{
                MoveObject(sp.ReadByte());
                //print(sp.ReadByte());
            }
            catch (System.Exception) {
            }
        }

        if (movTexture.isPlaying == false && playedOnce)
        {
            Video.SetActive(false);

            /* Footprint */
            Footprint.SetActive(true);
        }
    }