예제 #1
0
 // Update is called once per frame
 void Update()
 {
     if (controller.isGrounded && controller.velocity.magnitude > isWalkingThreshold && !isWalking) // si le joueur est sur le sol et a une vitesse supérieur au seuil
     {
         isWalking      = true;                                                                     // alors c'est qu'il marche
         stoppedWalking = false;
         startWalking   = true;
     }
     else if (isWalking && (!controller.isGrounded || controller.velocity.magnitude < isWalkingThreshold)) // si le joueur était en train de marcher et qu'il n'est pas au sol, ou a une vitesse inférieur au seuil
     {
         isWalking      = false;
         stoppedWalking = true; // alors c'est qu'il s'est arrêté de marcher
     }
     if (startWalking)
     {
         //print("start walking");
         WwiseAudioManager.PlayLoopEvent("footsteps", this.gameObject);
         startWalking = false;
     }
     if (stoppedWalking)
     {
         stoppedWalking = false;
         //print("stopped walking");
         WwiseAudioManager.StopLoopEvent("footsteps", this.gameObject);
     }
 }
예제 #2
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();
            }
        }
    }
예제 #3
0
    //Quand le fragment est laché
    public void Drop()
    {
        rigidbody.isKinematic = false;
        transform.parent      = null;

        //stoppe la convolution
        WwiseAudioManager.StopLoopEvent(GetComponent <InteractibleObject>().soundEvent, gameObject);

        GetComponent <levitation>().IsHeld(false);
    }
예제 #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);
    }
예제 #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);
    }
예제 #6
0
 public void SounStopdIdle()
 {
     WwiseAudioManager.StopLoopEvent(audioName.ToString() + "_idle", this.transform.parent.gameObject);
 }