Esempio n. 1
0
    void switchSounds()
    {
        //Tous les sons a switcher sont avec convolver
        for (int i = 0; i < playingObjects.Count; i++)
        {
            if (playingObjects[i].GetComponent <ConvolutionObject>() != null && playingObjects[i].GetComponent <InteractibleObject>().soundEvent != "")
            {
                //Stoppe son du convolver avec switch précédent
                WwiseAudioManager.StopLoopEvent(playingObjects[i].GetComponent <InteractibleObject>().soundEvent, playingObjects[i], true);

                //Lance switch du convolver
                WwiseAudioManager.PlayFiniteEvent(switchType + playingObjects[i].GetComponent <ConvolutionObject>().switchName, playingObjects[i]);

                //Lance son du convolver
                WwiseAudioManager.PlayLoopEvent(playingObjects[i].GetComponent <InteractibleObject>().soundEvent, playingObjects[i], true);
            }

            else if (playingObjects[i].GetComponentInChildren <AudioEventManager>() != null && playingObjects[i].GetComponentInChildren <AudioEventManager>().idleSound)
            {
                GameObject playingNPC = playingObjects[i];

                //Stoppe son Idle (PNJ)
                playingNPC.GetComponentInChildren <AudioEventManager>().SounStopdIdle();

                //play son Idle (PNJ)
                playingNPC.GetComponentInChildren <AudioEventManager>().SoundPlayIdle();
            }
        }
    }
Esempio n. 2
0
 public void PlayFiniteEventWithCallBack(string eventName)
 {
     //Stops previous event
     if (idleSound)
     {
         SounStopdIdle();
     }
     WwiseAudioManager.PlayFiniteEvent(eventName, this.transform.parent.gameObject, MyCallbackFunction);
 }
Esempio n. 3
0
 // Ramasse l'objet toPickUp
 public void PickUpObject(GameObject toPickUp)
 {
     if (toPickUp != null)
     {
         print("Interactor:PickUpObject");
         // on racrroche toPickUp a inHandPosition dans la hiérarchie
         inHandObject = toPickUp;
         inHandObject.transform.parent      = inHandPosition.transform;
         inHandObject.transform.position    = inHandPosition.transform.position;
         inHandObject.transform.rotation    = inHandPosition.transform.rotation;
         inHandObject.rigidbody.isKinematic = true;
         handsFull = true;
         WwiseAudioManager.PlayFiniteEvent("interactions_simples_motion", this.gameObject);            // on joue le son correspondant
     }
 }
Esempio n. 4
0
    public GameObject OnPickUp()
    {
        print("SettingPiece:OnPickUp");

        WwiseAudioManager.StopLoopEvent(this.GetComponent <InteractibleObject>().soundEvent, this.gameObject, true);
        WwiseAudioManager.PlayFiniteEvent("convolution_wet_to0", this.gameObject);

        GameObject fragPicked = fragment.OnTouch();

        SoundUniverseManager.removeSoundEvent(this.gameObject);

        fragment = null;
        this.GetComponentInChildren <Renderer>().material = defaultMaterial;
        //audioSource.clip = defaultClip;
        //audioEventName = defaultAudioEventName;
        return(fragPicked);
    }
Esempio n. 5
0
    //Ramassage du fragment
    public GameObject OnTouch()
    {
        this.gameObject.SetActive(true);

        GetComponent <levitation>().enabled = true;
        GetComponent <levitation>().IsHeld(true);

        //stoppe appel
        WwiseAudioManager.StopLoopEvent("fragment_call_" + family.ToString(), this.gameObject, false);

        WwiseAudioManager.PlayFiniteEvent("prendre_morceau", gameObject);

        //lance convolution du fragment
        WwiseAudioManager.PlayLoopEvent(GetComponent <InteractibleObject>().soundEvent, gameObject);

        return(this.gameObject);
    }
Esempio n. 6
0
    public void DropInHandObject()
    {
        if (inHandObject != null)
        {
            print("Interactor:DropInHandObject");
            WwiseAudioManager.PlayFiniteEvent("interactions_simples_motion", this.gameObject);
            inHandObject.GetComponent <Fragment>().Drop();

            if (hitObject == null)
            {
                inHandObject.GetComponent <Fragment>().Ground();
            }

            handsFull    = false;
            inHandObject = null;
        }
    }
Esempio n. 7
0
    public GameObject OnTouch()
    {
        if (!HasFragment())
        {
            WwiseAudioManager.PlayFiniteEvent("toucher_element", this.gameObject);

            if (GetComponent <InteractibleObject>().type == InteractibleType.SettingPiece)
            {
                WwiseAudioManager.PlayFiniteEvent(SoundUniverseManager.switchType + "RI" + switchName, this.gameObject);

                WwiseAudioManager.PlayFiniteEvent("Sfx_RI", this.gameObject);
            }

            return(null);
        }
        else
        {
            return(OnPickUp());
        }
        //soundEevent
    }
Esempio n. 8
0
    /*
     * public void OnInteract(){
     * print("Parent OnInteract");
     * this.GetComponent<SettingPiece>().OnInteract();
     * }
     */
    public void OnAddingFragment(Fragment fragment)
    {
        if (this.GetComponent <Blend>() != null)
        {
            this.GetComponent <Blend>().enabled = false;
        }
        this.GetComponent <InteractibleObject> ().soundEvent = fragment.GetComponent <InteractibleObject> ().soundEvent;

        //fragment.transform.parent = this.transform;

        //print("SettingPiece:OnAddingFragment:" + GetComponent<InteractibleObject>().type);
        this.fragment = fragment;
        //activatedMaterial = fragment.material;
        this.GetComponentInChildren <Renderer>().material = fragment.material;
        //this.audioSource.clip = fragment.GetClip();
        // this.audioEventName = fragment.audioEventName;

        //AkSoundEngine.SetRTPCValue ("binaural_to_convolver", 100);
        //fragment.Drop ();
        //AkSoundEngine.SetSwitch("Elements_decor", "Batiment_1", inHandObject.gameObject);

        SoundUniverseManager.addSoundEvent(this.gameObject);

        WwiseAudioManager.PlayFiniteEvent("linker_morceau", this.gameObject);

        WwiseAudioManager.PlayFiniteEvent(SoundUniverseManager.switchType + switchName, this.gameObject);

        WwiseAudioManager.PlayLoopEvent(fragment.GetComponent <InteractibleObject>().soundEvent, this.gameObject, true);
        WwiseAudioManager.PlayFiniteEvent("convolution_wet_to100", this.gameObject);



        if (GetComponent <InteractibleObject>().type == InteractibleType.NPC)
        {
            this.GetComponent <Musicien>().OnAddingFragment(fragment);
            GetComponentInChildren <AudioEventManager>().SoundRemovedIdle();
            GetComponentInChildren <AudioEventManager>().idleSound = false;
        }
    }
Esempio n. 9
0
 //Quand le fragment est posé au sol
 public void Ground()
 {
     WwiseAudioManager.PlayFiniteEvent("lacher_morceau", gameObject);
     //relance appel du fragment
     WwiseAudioManager.PlayLoopEvent("fragment_call_" + family.ToString(), gameObject, false);
 }
Esempio n. 10
0
 /*
  * Sound events
  */
 public void SoundPlayIdle()
 {
     WwiseAudioManager.PlayFiniteEvent(SoundUniverseManager.switchType + "_mood", this.transform.parent.gameObject);
     WwiseAudioManager.PlayLoopEvent(audioName.ToString() + "_idle", this.transform.parent.gameObject);
 }
Esempio n. 11
0
 public void EmitSound()// émission du son du passant
 {
     WwiseAudioManager.PlayFiniteEvent(audioEventName, this.gameObject);
     print("Emit Sound");
 }