Пример #1
0
 // Use this for initialization
 void Start()
 {
     playerTransform = GameObject.Find("OVRPlayerController").transform;
     GameObject pointLight = GameObject.Find("Point light");
     Dimmer = pointLight.GetComponent<Lightswitch>();
     Dimmer.myLight.intensity = 0.3f;
 }
Пример #2
0
    // Update is called once per frame
    void OnTriggerEnter(Collider player)
    {
        if (player.gameObject.tag == "Player")
        {
            /*Das Skript schaltet alle Lichter im Raum aus, damit die Beamerprojektion korrekt funktionieren kann
             * */
            Lightswitch.Trial();


            /*Das Skript schaltet die Hintergrundmusik im Raum aus, damit die Beamerprojektion funktionieren kann
             * */

            GameObject[] gameObjectArray = GameObject.FindGameObjectsWithTag("Hintergrundmusik");

            foreach (GameObject go in gameObjectArray)
            {
                go.SetActive(false);
            }
            AudioSource audio = GetComponent <AudioSource>();

            /*Das Skript setzt alle Lichter im Raum aus, damit die Beamerprojektion korrekt funktionieren kann
             * */
            audio.Play();
            new WaitForSeconds(audio.clip.length);
            audio.clip = otherClip;
            audio.Play();

            /*if (Input.GetKeyDown(KeyCode.F))
             * {
             *
             *  Debug.Log("f gedrueckt");
             * }*/


            //audioSource.mute = !audioSource.mute;
            videoPlayer.SetActive(true);
            Destroy(videoPlayer, timeToStop);
            StartCoroutine(CoFunc());
            Debug.Log("video");

            /*if (GameObject.Find("Video Player") == null)
             * {
             *  AudioSource audio2 = GetComponent<AudioSource>();
             *  audio2.clip = alterClip;
             *  audio2.Play();
             * }*/
            if (GameObject.Find("Meintestobject") != null)
            {
                Debug.Log("trigger");
                AudioSource audio2 = GetComponent <AudioSource>();
                audio2.clip = alterClip;
                audio2.Play();
            }
        }
    }
Пример #3
0
    public override bool canDo()
    {
        l = this.gameObject.GetComponent <Lightswitch> ();



        if (Vector3.Distance(this.transform.position, CommonObjectsStore.player.transform.position) < 2)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }