Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     //Getting material
     origMaterial = GameObject.Find("Mesh417").GetComponent <Renderer>().material;
     //Ray class for check player looking
     myRay = GetComponent <GetRaycast>();
 }
    // Start is called before the first frame update
    void Start()
    {
        myRay = GetComponent <GetRaycast>();                                                        //Getting raycast to detect player looking

        buttonClickSound = FMODUnity.RuntimeManager.CreateInstance("event:/Room1/SFX/ButtonClick"); //Initialising the button click sound

        buttonClickSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(transform));         //Playing button sound in space
    }
Example #3
0
    // Start is called before the first frame update
    void Start()
    {
        //Getting if player looking at button
        myRay = GetComponent <GetRaycast>();

        //Button click sound and setting 3D positon of it
        buttonClickSound = FMODUnity.RuntimeManager.CreateInstance("event:/Room1/SFX/ButtonClick");

        buttonClickSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(transform));
    }
Example #4
0
    // Start is called before the first frame update
    void Start()
    {
        //Get player looking component
        myRay = GetComponent <GetRaycast>();

        //Initialising button click sound and setting it in 3D space
        buttonClickSound = FMODUnity.RuntimeManager.CreateInstance("event:/Room1/SFX/ButtonClick");

        buttonClickSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(transform));
    }
    // Start is called before the first frame update
    void Start()
    {
        //intialis sound of picking up obkect
        objectPickUp = FMODUnity.RuntimeManager.CreateInstance("event:/Room1/SFX/PickUpObject");

        //The original material of keycard
        origMaterial = this.gameObject.GetComponent <Renderer>().material;

        //Getting the raycast to check player looking
        myRay = GetComponent <GetRaycast>();
    }
Example #6
0
    // Start is called before the first frame update
    void Start()
    {
        //Intialise FMOD event
        objectPickUp = FMODUnity.RuntimeManager.CreateInstance("event:/Room1/SFX/PickUpObject");

        //Set original material
        origMaterial = this.gameObject.GetComponent<Renderer>().material;

        //Get raycast for player looking
        myRay = GetComponent<GetRaycast>();

    }
Example #7
0
    void Start()
    {
        //Get player looking variable
        myRay = GetComponent <GetRaycast>();

        //Intialising button click event and it's position
        buttonClickSound = FMODUnity.RuntimeManager.CreateInstance("event:/Room1/SFX/ButtonClick");

        soundEmitter = transform.Find("SoundEmitter");

        buttonClickSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(soundEmitter));
    }
Example #8
0
    // Start is called before the first frame update
    void Start()
    {
        //Getting player look state
        myRay = GetComponent <GetRaycast>();

        //Intialising click sound and location of sound
        leverClickSound = FMODUnity.RuntimeManager.CreateInstance("event:/Room3/SFX/LeverClick");

        soundEmitter = transform.Find("SoundEmitter");

        leverClickSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(soundEmitter));
    }
Example #9
0
    void Start()
    {
        //Getting ray reciever component, which will have a raycast variable true if the player is looking at the object
        myRay = GetComponent <GetRaycast>();

        //Intialising button click sound
        buttonClickSound = FMODUnity.RuntimeManager.CreateInstance("event:/Room1/SFX/ButtonClick");

        //Setting sound position
        soundEmitter          = gameObject.transform.Find("SoundEmitter").transform;
        soundEmitter.position = GetComponentInChildren <MeshRenderer>().bounds.center;
        buttonClickSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(soundEmitter));
    }
Example #10
0
    // Start is called before the first frame update
    void Start()
    {
        //Get original material of object
        origMaterial = origObj.gameObject.GetComponent <Renderer>().material;

        //Get ray for checking player looking
        myRay = GetComponent <GetRaycast>();

        //Intialising sund from scanner and setting position to scanner
        keyCardCorrectSound   = FMODUnity.RuntimeManager.CreateInstance("event:/Room1/SFX/KeycardScanCorrect");
        keyCardIncorrectSound = FMODUnity.RuntimeManager.CreateInstance("event:/Room1/SFX/KeycardScanWrong");
        wallUpSound           = FMODUnity.RuntimeManager.CreateInstance("event:/Room1/SFX/_WallLift");

        soundEmmitter = transform.Find("SoundEmmiter").transform;
        keyCardCorrectSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(soundEmmitter));
        keyCardIncorrectSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(soundEmmitter));

        //Set wall position to centre of the wall
        wallUpSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(room1wall.transform.Find("SoundEmitter")));
    }