void OnTriggerEnter(Collider other) { if(other.gameObject.tag == "Parede3") { temp++; contador = 1; StartCoroutine("GO"); } if (other.gameObject.tag == "Enemy") { if (other.gameObject.GetComponent<EnemyController>().life > 0 && other.gameObject.GetComponent<EnemyController>().dano) { vol = FMODUnity.RuntimeManager.CreateInstance(dano); vol.setVolume(PlayerPrefs.GetFloat("VolumeFX")); vol.start(); Dano(other.gameObject); } } else if (other.gameObject.tag == "EnemyRanged") { if (other.gameObject.GetComponent<EnemyRanged>().life > 0 && other.gameObject.GetComponent<EnemyRanged>().dano) { vol = FMODUnity.RuntimeManager.CreateInstance(dano); vol.setVolume(PlayerPrefs.GetFloat("VolumeFX")); vol.start(); Dano(other.gameObject); } } }
void Update () { if (SelectPersonagem.personagem.select == meuNumero.meuNumero) { if (podeDpad) { if (tipo == 0) { if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetAxisRaw("DpadXP1") > 0) { anim.SetTrigger("Aperto"); heal = FMODUnity.RuntimeManager.CreateInstance(socoFraco); heal.setVolume(PlayerPrefs.GetFloat("VolumeFX")); heal.start(); } } else if (tipo == 1) { if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetAxisRaw("DpadXP1") < 0) { anim.SetTrigger("Aperto"); heal = FMODUnity.RuntimeManager.CreateInstance(socoFraco); heal.setVolume(PlayerPrefs.GetFloat("VolumeFX")); heal.start(); } } podeDpad = false; } } else if (SelectPersonagem.personagem.select2 == meuNumero.meuNumero) { if (podeDpad2) { if (tipo == 0) { if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetAxisRaw("DpadXP2") > 0) { anim.SetTrigger("Aperto"); } } else if (tipo == 1) { if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetAxisRaw("DpadXP2") < 0) { anim.SetTrigger("Aperto"); } } podeDpad2 = false; } } if (Input.GetAxisRaw("DpadXP1") == 0) { podeDpad = true; } if (Input.GetAxisRaw("DpadXP2") == 0) { podeDpad2 = true; } }
public void Play() { if (evt != null) { ERRCHECK(evt.start()); } else { Debug.Log("Tried to play event without a valid instance: " + path); return; } }
public void Play() { if (evt != null) { ERRCHECK(evt.start()); } else { FMOD.Studio.UnityUtil.Log("Tried to play event without a valid instance: " + path); return; } }
void Start() { vol = FMODUnity.RuntimeManager.CreateInstance(musica1); vol.setVolume(PlayerPrefs.GetFloat("VolumeFX")); vol.start(); }
public override void Initialize(object owner) { base.Initialize(owner); ultSnap = FMODUnity.RuntimeManager.CreateInstance("snapshot:/UltSnap"); ultSnap.getParameter("UltSnapParam", out ultSnapParam); ultSnap.start(); }
void Start() { StartCoroutine("GO"); tiroInstance = FMODUnity.RuntimeManager.CreateInstance(tiro); tiroInstance.setVolume(PlayerPrefs.GetFloat("VolumeFX")); tiroInstance.start(); }
//[SerializeField] //private bool touchControlled; void Awake() { music = FMODUnity.RuntimeManager.CreateInstance("event:/Music"); music.start(); music.getParameter("Clue", out Clues); music.getParameter("Loyalty", out Loyalty); Loyalty.setValue(10); yarnVarRef = yarnVarRefObj.GetComponent <ExampleVariableStorage>(); // Populate the Singleton with the followint if and else if statements if (S == null) { S = this; } else if (S != null) { Destroy(this); } //Make sure that the GameObject this is attached to is not deleted on load DontDestroyOnLoad(gameObject); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.S)) { if (instance != null) { //instance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); instance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); instance.release(); } instance = FMOD_StudioSystem.instance.GetEvent(path); if (instance != null) { var attributes = FMOD.Studio.UnityUtil.to3DAttributes(position); ERRCHECK(instance.set3DAttributes(attributes)); ERRCHECK(instance.setVolume(volume)); instance.start(); } } if (Input.GetKeyDown(KeyCode.J)) { instance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); instance.release(); } if (Input.GetKeyDown(KeyCode.L)) { instance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); instance.release(); } }
void OnMouseDown() { if (playFlag) { playFlag = false; instance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); instance.release(); instance = null; } else { if (instance != null) { //instance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); instance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); instance.release(); } instance = FMOD_StudioSystem.instance.GetEvent(path); if (instance != null) { var attributes = FMOD.Studio.UnityUtil.to3DAttributes(position); ERRCHECK(instance.set3DAttributes(attributes)); ERRCHECK(instance.setVolume(volume)); instance.setParameterValue("Surface", SurfaceValue); instance.start(); } playFlag = true; } }
IEnumerator Wave02() { stalag.stalagmiteDelay += 3; stalag.stalagtiteDelay += 3; yield return(new WaitForSeconds(enemySpawnDelay + 6)); lava.lavaObject.GetComponent <Animation>().Play("Lava_Enter"); FMODUnity.RuntimeManager.PlayOneShot("event:/Environment/lv01/lavaintro"); lavaLoopInst.start(); // plays lava sound lavaLoopInst.release(); yield return(new WaitForSeconds(2)); lava.fireballActive = true; StartCoroutine("FireballSpawn"); yield return(new WaitForSeconds(2)); enemySpawnStartY = 0; SpawnEnemy02(); yield return(new WaitForSeconds(enemySpawnDelay)); enemySpawnStartY = 0; SpawnEnemy01(); enemySpawnStartY = -2.3f; SpawnEnemy02(); enemySpawnStartY = 2.3f; SpawnEnemy02(); yield return(new WaitForSeconds(enemySpawnDelay)); enemySpawnStartY = -2.3f; SpawnEnemy02(); yield return(new WaitForSeconds(1)); enemySpawnStartY = 0; SpawnEnemy02(); yield return(new WaitForSeconds(1)); enemySpawnStartY = 2.3f; SpawnEnemy02(); yield return(new WaitForSeconds(enemySpawnDelay)); enemySpawnStartY = -2.5f; e01.ySpeed = 3; e01.yMax = 2.5f; e01.yMin = -2.5f; SpawnEnemy01(); enemySpawnStartY = 2.5f; e01.ySpeed = 3; SpawnEnemy01(); enemySpawnStartY = 2.3f; SpawnEnemy02(); e02.fireTime = 2; enemySpawnStartY = 0; SpawnEnemy02(); e02.fireTime = 3; enemySpawnStartY = -2.3f; SpawnEnemy02(); yield return(new WaitForSeconds(enemySpawnDelay + 5)); StartCoroutine(Wave03()); }
void UIBOOST() { UIBoost = FMODUnity.RuntimeManager.CreateInstance(BoostAudio); UIBoost.start(); VoiBoost = FMODUnity.RuntimeManager.CreateInstance(VOIBoost); VoiBoost.start(); }
public void Evolve(Player player, float duration) { switch (player) { case Player.P1: evolveP1.setParameterByName("evolve_state", 0.0f); evolveP1.start(); if (p1EvolveRoutine != null) { StopCoroutine(p1EvolveRoutine); } p1EvolveRoutine = EvolveTimer(Player.P1, duration); StartCoroutine(p1EvolveRoutine); break; case Player.P2: evolveP2.setParameterByName("evolve_state", 0.0f); evolveP2.start(); if (p2EvolveRoutine != null) { StopCoroutine(p2EvolveRoutine); } p2EvolveRoutine = EvolveTimer(Player.P2, duration); StartCoroutine(p2EvolveRoutine); break; } }
void Start() { StartCoroutine("GO"); volInicio = FMODUnity.RuntimeManager.CreateInstance(parede); volInicio.setVolume(PlayerPrefs.GetFloat("VolumeFX")); volInicio.start(); }
// Use this for initialization void Start () { musicSound = FMODUnity.RuntimeManager.CreateInstance(MusicEvent); musicSound.getParameter("Light-Dark", out musicParam); //musicSound.setParameterValue("Light-Dark", startAmbient); musicSound.start(); }
// -------------------------- // Use this for initialization void Start() { //FMOD hoverSound = FMOD_StudioSystem.instance.GetEvent("event:/Hoverboard/Ny motor"); hoverSound.start(); soundPlaying = true; if (hoverSound == null) Debug.Log("Laddar inte in eventet!!!"); hoverSound.getParameter("Speed", out speedPitch); if (speedPitch == null) Debug.Log("Hittar inte variabeln!!!"); windSound = FMOD_StudioSystem.instance.GetEvent("event:/Vind/Vind"); windSound.start(); if (windSound == null) Debug.Log("Laddar inte in wind-eventet!!!"); windSound.getParameter("Speed", out speedVolume); if (speedVolume == null) Debug.Log("Hittar inte wind-variabeln!!!"); impactSound = FMOD_StudioSystem.instance.GetEvent("event:/Impact/Impact1"); if (impactSound == null) Debug.Log("Laddar inte in impact-eventet!!!"); //----------------------------- }
void disparo() { if (Input.GetKeyDown("mouse 0")) { inputSoundEv.start(); } }
void Start() { instance = FMODUnity.RuntimeManager.CreateInstance(drums); cb = new FMOD.Studio.EVENT_CALLBACK(StudioEventCallback); instance.setCallback(cb, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT); instance.start(); }
void OnTriggerEnter() { reverb = FMODUnity.RuntimeManager.CreateInstance("event:/snapshot/" + gameObject.name); reverb.start(); reverb.getParameter("reverbDistance", out reverbDistance); reverbDistance.setValue(0f); print( gameObject.name + " triggered" ); }
public void Joga() { agarraAudioInstance = FMODUnity.RuntimeManager.CreateInstance(joga); agarraAudioInstance.setVolume(PlayerPrefs.GetFloat("VolumeFX")); agarraAudioInstance.start(); enemy.GetComponent<EnemyController>().Slam(player.playerStatus.dmg, false, gameObject, 5); End(); }
// Use this for initialization void Start() { Menu = FMOD_StudioSystem.instance.GetEvent ("event:/Menu"); Menu.start (); Menu.getParameter ("OptionsMuch", out OptionsMuch); Menu.getParameter ("StartGame", out StartGame); Time.timeScale = 1.0f; }
// Use this for initialization void Start() { musicEvent = FMOD_StudioSystem.instance.GetEvent(musicAsset); musicEvent.start(); musicEvent.getParameter("Ready", out readyParam); musicEvent.getParameter("Steady", out steadyParam); musicEvent.getParameter("Go", out goParam); }
void Start() { RadioFMOD = FMODUnity.RuntimeManager.CreateInstance("event:/Radio"); RadioFMOD.start(); RadioFMOD.getParameter("Frequency", out RadioParameterFMOD); RadioFMOD.getParameter("Inside", out InsideParameterFMOD); }
private void PlayFallEvent(float fallParameterValue) { FMOD.Studio.EventInstance @event = FMOD_StudioSystem.instance.GetEvent(this.fallEvent); UnityUtil.ERRCHECK(@event.setParameterValue("fall", fallParameterValue)); UnityUtil.ERRCHECK(@event.set3DAttributes(UnityUtil.to3DAttributes(base.gameObject, null))); UnityUtil.ERRCHECK(@event.start()); UnityUtil.ERRCHECK(@event.release()); }
//play sound every repeatInterval private IEnumerator PlaySoundRepeat() { while (true) { coroutineRunning = true; PLAYBACK_STATE isPlaying; sound.getPlaybackState(out isPlaying); if (isPlaying == PLAYBACK_STATE.PLAYING) { sound.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); } sound.start(); yield return(new WaitForSeconds(repeatInterval)); } }
void Start() { musicEV = FMODUnity.RuntimeManager.CreateInstance(music); musicEV.getParameter("Happiness", out happiness); musicEV.getParameter("win", out win); musicEV.getParameter("lose", out lose); musicEV.start(); Progress(); }
public void PlayStructureFall(GameObject emiter, float size) { FMOD.Studio.EventInstance @event = FMOD_StudioSystem.instance.GetEvent(this.StructureFallEvent); UnityUtil.ERRCHECK(@event.set3DAttributes(UnityUtil.to3DAttributes(emiter, null))); UnityUtil.ERRCHECK(@event.setParameterValue("size", Mathf.Clamp01(size))); UnityUtil.ERRCHECK(@event.start()); UnityUtil.ERRCHECK(@event.release()); }
// Use this for initialization void Start() { windEvent = FMOD_StudioSystem.instance.GetEvent("event:/Vind/Vind"); windEvent.start(); windEvent.getParameter("Speed", out speedParam); //windEvent.getParameter("Jump", out jumpParam); }
private void Update() { if (this.Remote) { return; } PLAYBACK_STATE pLAYBACK_STATE = PLAYBACK_STATE.STOPPED; if (this.musicTrack != null) { UnityUtil.ERRCHECK(this.musicTrack.getPlaybackState(out pLAYBACK_STATE)); } if (pLAYBACK_STATE != PLAYBACK_STATE.STOPPED) { PlayerSfx.MusicPlaying = true; } else { PlayerSfx.MusicPlaying = false; } if (base.transform.hasChanged) { base.transform.hasChanged = false; ATTRIBUTES_3D attributes = UnityUtil.to3DAttributes(this.SfxPlayer, null); PlayerSfx.Set3DAttributes(this.staminaBreathInstance, attributes); PlayerSfx.Set3DAttributes(this.walkyTalkyInstance, attributes); PlayerSfx.Set3DAttributes(this.musicTrack, attributes); PlayerSfx.Set3DAttributes(this.afterStormInstance, this.SfxPlayer.transform.position.to3DAttributes()); } if (this.afterStormInstance != null && !this.afterStormInstance.isValid()) { this.afterStormInstance = null; } Vector3 vector = (base.GetComponent <Rigidbody>().position - this.prevPosition) / Time.deltaTime; this.prevPosition = base.GetComponent <Rigidbody>().position; Vector3 vector2 = new Vector3(vector.x, 0f, vector.z); this.flatVelocity = vector2.magnitude; if (!this.Buoyancy.InWater) { this.immersed = false; } else if (!this.immersed && !LocalPlayer.FpCharacter.Grounded && LocalPlayer.FpCharacter.IsAboveWaistDeep()) { this.immersed = true; float num = Mathf.Clamp(this.SplashSpeedMaximum - this.SplashSpeedMinimum, 0f, this.SplashSpeedMaximum); float num2 = (this.Buoyancy.LastWaterEnterSpeed - this.SplashSpeedMinimum) / num; if (num2 >= 0f) { FMOD.Studio.EventInstance @event = FMOD_StudioSystem.instance.GetEvent(this.SplashEvent); UnityUtil.ERRCHECK(@event.set3DAttributes(UnityUtil.to3DAttributes(this.SfxPlayer, null))); UnityUtil.ERRCHECK(@event.setParameterValue("speed", Mathf.Clamp01(num2))); UnityUtil.ERRCHECK(@event.start()); UnityUtil.ERRCHECK(@event.release()); } } }
void Start() { // engine = FMOD_StudioSystem.instance.getEvent("/Background/Orchestral Music"); // engine.start(); // engine.getParameter("RPM", out engineRPM); background = FMOD_StudioSystem.instance.GetEvent ("event:/Background/Ice Ambience"); if(play) background.start (); }
// Use this for initialization void Start () { breathSound = FMODUnity.RuntimeManager.CreateInstance(breathEvent); breathSound.setParameterValue("stamina", 1.0f); breathSound.start(); heartbeatSound = FMODUnity.RuntimeManager.CreateInstance(heartbeatEvent); heartbeatSound.setParameterValue("stamina", 1.0f); heartbeatSound.start(); }
// Use this for initialization void Start () { cachedRigidBody = GetComponent<Rigidbody>(); theSound = FMODUnity.RuntimeManager.CreateInstance(soundEvent); // a bunch of default vaiables which trick fmod into looping theSound.setParameterValue("Distance", 0.0f); theSound.setParameterValue("Direction", 0.0f); theSound.start(); }
// Use this for initialization void Start() { animator = GetComponent<Animator>(); //Initialize FMOD events with parameters stepsEv = FMODUnity.RuntimeManager.CreateInstance(playerSteps); stepsEv.getParameter("moving", out stepsParam); stepsEv.start(); stepsParam.setValue(0); }
IEnumerator GO() { lapisRef = FMODUnity.RuntimeManager.CreateInstance(lapis); lapisRef.setVolume(PlayerPrefs.GetFloat("VolumeFX")); lapisRef.start(); yield return new WaitForSeconds(1); gift.atributo.enabled = true; gift.select.SetActive(false); }
void Start() { m_ControllerBody = m_Controller.GetComponent<Rigidbody>(); m_FootstepState = FMODUnity.RuntimeManager.CreateInstance(m_FootstepEvent); m_FootstepState.start(); m_FootstepState.getParameterByIndex(0, out m_FootstepsWalking); m_FootstepState.getParameterByIndex(1, out m_FootstepsRunning); }
void Start() { if(obj.GetComponent<PlayerController>().transform.localScale.x < 0) { vel *= -1; } volInicio = FMODUnity.RuntimeManager.CreateInstance(inicio); volInicio.setVolume(PlayerPrefs.GetFloat("VolumeFX")); volInicio.start(); }
public void Activate(GameObject origin) { if (!opened) { GetComponent <Animator>().SetTrigger("Open"); openSound.start(); opened = true; GetComponent <BoxCollider>().enabled = false; } }
void Start() { ambience = FMOD_StudioSystem.instance.GetEvent("event:/sfx/environment/ambience"); ambience.getParameter("windSpeed", out windSpeedParam); ambience.getParameter("windIntensity", out windIntensityParam); windSpeedParam.setValue(0); windIntensityParam.setValue(0); ambience.start(); StartCoroutine(VaryWindParam(windSpeedParam)); StartCoroutine(VaryWindParam(windIntensityParam)); }
void Start() { // Set up and start ambience audio ambientSoundEvent = FMOD_StudioSystem.instance.GetEvent("event:/ambience/wind"); var attributes = FMOD.Studio.UnityUtil.to3DAttributes(transform.position); ambientSoundEvent.set3DAttributes(attributes); ambientSoundEvent.start(); // Set up reverb zone for the cave area caveVerbZone = GameObject.Find("verbZone"); }
// Use this for initialization void Start () { ambience = FMOD_StudioSystem.instance.GetEvent("event:/Forest"); ambience.start(); ambience.getParameter("Birds", out ambienceBirds); ambience.getParameter("Wind", out ambienceWind); ambience.getParameter("Rain", out ambienceRain); ambienceBirds.setValue(0f); ambienceWind.setValue(0f); ambienceRain.setValue(0f); }
void Start() { musicLevel0000 = FMODUnity.RuntimeManager.CreateInstance(fmodEvent); FMOD.Studio.EventDescription segmentCodeEventDescription; musicLevel0000.getDescription(out segmentCodeEventDescription); FMOD.Studio.PARAMETER_DESCRIPTION segmentCodeParameterDescription; segmentCodeEventDescription.getParameterDescriptionByName("segmentCode", out segmentCodeParameterDescription); segmentCodeParameterID = segmentCodeParameterDescription.id; musicLevel0000.start(); }
private void SetupSound() { if (music == null) { music = FMODUnity.RuntimeManager.CreateInstance(musicEvent); music?.start(); // FMODUnity.RuntimeManager.PlayOneShot(sheppardEvent); } music?.setParameterValueByIndex(0, 1f); }
public void Interaction_PowerBox() { // Check if character is in Interaction Distance if (Vector2.Distance(pos_powerBox.position, PlatformerCharacter2D.m_InteractionCheck.position) <= interactionDistance) { inRange = true; // Debug.Log("Interactable"); } else if (Vector2.Distance(pos_powerBox.position, PlatformerCharacter2D.m_InteractionCheck.position) > interactionDistance) { inRange = false; // Debug.Log("Not Interactable"); } if (inRange == true && interaction == true && interacted == false && Power.flicker == true) { // play repair sound FMODUnity.RuntimeManager.PlayOneShot("event:/repair", gameObject.transform.position); //Event interacted = true; box_anim.SetBool("powerOn", true); Debug.Log("Interacted"); //Turning On Lanterns GameObject lantern1 = GameObject.Find("Night-Environment-Assets-Lantern"); Power lanternOn1 = (Power)lantern1.GetComponent(typeof(Power)); lanternOn1.PowerOn(true); //2 GameObject lantern2 = GameObject.Find("Night-Environment-Assets-Lantern (3)"); Power lanternOn2 = (Power)lantern2.GetComponent(typeof(Power)); lanternOn2.PowerOn(true); //3 GameObject lantern3 = GameObject.Find("Night-Environment-Assets-Lantern (4)"); Power lanternOn3 = (Power)lantern3.GetComponent(typeof(Power)); lanternOn3.PowerOn(true); //House GameObject house = GameObject.Find("Night-Environment-Assets-House"); Power houseOn = (Power)house.GetComponent(typeof(Power)); houseOn.PowerOn(true); House house1 = (House)house.GetComponent (typeof(House)); house1.disableCollision(); //Tower GameObject tower = GameObject.Find("Night-Environment-Assets-Tower"); Tower towerOn = (Tower)tower.GetComponent (typeof(Tower)); towerOn.PowerOn (true); // play lamp buzz sound lampBuzz = FMODUnity.RuntimeManager.CreateInstance("event:/lamp_buzz"); lampBuzz.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject.transform)); lampBuzz.start(); } }
void Start() { m_PlayerChar = GetComponent<PlayerChar>(); m_Loaded = true; m_IsLoading = false; m_CrossbowShotEvent = FMODUnity.RuntimeManager.CreateInstance(m_CrossbowShotAudio); m_CrossbowShotEvent.start(); m_CrossbowShotEvent.getCue("KeyOff", out m_CrossbowCue); m_CrossbowShotEvent.getParameter("Reload", out m_CrossbowReload); ReadyRotation = Crossbow.transform.localRotation; ReloadRotation = ReadyRotation * Quaternion.AngleAxis(-20f, Vector3.right); }
// Use this for initialization void Start () { ///*Implementazione di Fmod*/ var studioSystem = FMODUnity.RuntimeManager.StudioSystem; ambient = FMODUnity.RuntimeManager.CreateInstance("event:/Ambiente/Vento"); buttonClick = FMODUnity.RuntimeManager.CreateInstance("event:/Menu/Pulsante"); if(StartAmbient) ambient.start(); if (gameController == null && StartAmbient) { gameController = FindObjectOfType<GameController>(); } }
void Start() { current_character = Old_Character; Old_initial_y = Old_Character.transform.position.y; stepsEv = FMODUnity.RuntimeManager.CreateInstance(playerSteps); stepsEv.getParameter("moving", out stepsParam); stepsEv.start(); wormMoveEv = FMODUnity.RuntimeManager.CreateInstance(wormMove); wormMoveEv.getParameter("moving", out wormMoveParam); }
public void PlayPlantRustle() { if (this.plantRustleEnabled && FMOD_StudioSystem.instance) { FMOD.Studio.EventInstance @event = FMOD_StudioSystem.instance.GetEvent(this.PlantRustleEvent); UnityUtil.ERRCHECK(@event.set3DAttributes(UnityUtil.to3DAttributes(this.SfxRustle, null))); UnityUtil.ERRCHECK(@event.setParameterValue("speed", LocalPlayer.FpCharacter.CalculateSpeedParameter(this.flatVelocity))); UnityUtil.ERRCHECK(@event.start()); UnityUtil.ERRCHECK(@event.release()); this.plantRustleEnabled = false; base.Invoke("EnablePlantRustle", 0.2f); } }
void Start() { fmodevent = FMOD_StudioSystem.instance.GetEvent("event:/music/music"); if (fmodevent != null) { fmodevent.setVolume(1.0f); fmodevent.setParameterValue("music_trans", 0.0f); fmodevent.start(); } }
void Update() { if(contador == 0) transform.Translate(vel, 0, 0); if(temp == 2) { volInicio.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); vol = FMODUnity.RuntimeManager.CreateInstance(fim); vol.setVolume(PlayerPrefs.GetFloat("VolumeFX")); vol.start(); Destroy(gameObject); } }
//Called every time the state changes void UpdateAnimations() { if (currentKeyState == "Rail") { animator.SetBool("Grinding", true); grindEvent.start(); } else { animator.SetBool("Grinding", false); grindEvent.stop(); } if (currentKeyState == "Air") { animator.SetBool("Falling", true); if (movementScript.m_getVelocity.y < fallSpeed) { playLanding = true; } } else { animator.SetBool("Falling", false); animator.SetBool("Jumping", false); if (playLanding == true) { playLanding = false; FMOD_StudioSystem.instance.PlayOneShot("event:/Hoverboard/Landing", transform.position); } } if (currentKeyState == "Wall") { if (keyStateDictionary[currentKeyState].setVector.y == 0) { //Wall is to the right animator.SetBool("WallridingRight", true); } else { //Wall is to the left animator.SetBool("WallridingLeft", true); } } else { animator.SetBool("WallridingRight", false); animator.SetBool("WallridingLeft", false); } }
private void SetEventInstance() { eventDescription.getInstanceList(out FMOD.Studio.EventInstance[] instanceList); if (instanceList.Length == 0) { eventDescription.createInstance(out eventInstance); eventInstance.start(); } else { eventInstance = instanceList[0]; } return; }
public void PlayMusic() { FMOD.Studio.PLAYBACK_STATE _music; music.getPlaybackState(out _music); if (_music != FMOD.Studio.PLAYBACK_STATE.PLAYING) { Debug.Log("Music not playing"); music = FMODUnity.RuntimeManager.CreateInstance(FMODPaths.MusicEvent); music.start(); } else { Debug.Log("Music playing"); } }
//-----------------FMOD --------------- public void StartEvent() { if (m_Event == null || !m_Event.isValid()) { CacheEventInstance(); } if (m_Event != null && m_Event.isValid()) { ERRCHECK(m_Event.start()); } else { FMOD.Studio.UnityUtil.LogError("Event failed: " + m_Path); } }
public void bagAppearSnd() { if (!audioWholeSequencePlay) { bagAppearSound = FMODUnity.RuntimeManager.CreateInstance(bagAppearEvent); bagAppearSound.start(); } //CHEAT AND PLAY THE WHOLE ANIM SEQUENCE SOUND if (audioWholeSequencePlay) { levelComplete_ALLSound = FMODUnity.RuntimeManager.CreateInstance(levelComplete_ALLEvent); levelComplete_ALLSound.start(); } }
//for sounds that have parameters, we need to keep track of the instance of the sound //we can attach a sound to an object with a rigidbody, and it will automatically update it's position and velocity public void StartPlayerMovementSound(Transform playerTransform, Rigidbody playerRB) { //check to see if we already have a player move sound running (in which case we just update the parameter) if (!playerMoveSoundInstance.isValid()) { //first we make an instance of the sound playerMoveSoundInstance = FMODUnity.RuntimeManager.CreateInstance(playerMoveSound); //then attach that to the player object (now it will update position and velocity data) FMODUnity.RuntimeManager.AttachInstanceToGameObject(playerMoveSoundInstance, playerTransform, playerRB); //then we start it and release it (release means the instance will be destroyed when playback stops) playerMoveSoundInstance.start(); playerMoveSoundInstance.release(); } playerMoveSoundInstance.setParameterByName("PlayerIsMoving", 1.0f); }
void Update() { if (Input.GetKey(KeyCode.A) && Vector3.Distance(transform.position, player.position) < 1.5f) { an.SetBool("Turn", true); an.SetFloat("Multiplier", 1f); timerTurn += Time.deltaTime * 2; if (turning) { sonneBegin.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); sonneEnd.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); engrenageSound.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); GearsScript.MecanismStop.Invoke(this); turning = false; } } else { an.SetBool("Turn", true); an.SetFloat("Multiplier", -0.5f); if (timerTurn > 0) { timerTurn -= Time.deltaTime; if (!turning) { sonneEnd.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); sonneBegin.start(); engrenageSound.start(); GearsScript.MecanismWorking.Invoke(this); turning = true; } } else { an.SetBool("Turn", false); timerTurn = 0; if (turning) { sonneBegin.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); engrenageSound.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); sonneEnd.start(); GearsScript.MecanismStop.Invoke(this); turning = false; } } } }
public void playSound(int pIndex) { //Do this because FMOD sucks FMOD.Studio.EventInstance sound = FMODUnity.RuntimeManager.CreateInstance(eventPath); //Do this to attach the sound to a gameobject for 3D effect FMODUnity.RuntimeManager.AttachInstanceToGameObject(sound, transform, GetComponent <Rigidbody>()); //Do this to set a certain parameter sound.setParameterByName(parameterName, pIndex); //Start thing sound.start(); //Make sure it doesnt loop sound.release(); }
private void Start() { transform.position = tm.CellToWorld(tm.WorldToCell(transform.position)); playerHealth = 3; Debug.Log(playerHealth); playerAttackCooldown = 0.5f; keyPressedLast = "right"; playerCanMove = true; anim = GetComponent <Animator>(); cDurr = mDurr; ScoreKeeper.playerScoreNum = 0; instance = FMODUnity.RuntimeManager.CreateInstance(fmodEvent); instance.start(); }
void Update() { PLAYBACK_STATE walkingState; walkingSound.getPlaybackState(out walkingState); if (MovementScript.InMotion) { if (walkingState != PLAYBACK_STATE.PLAYING) { walkingSound.start(); } } else { walkingSound.stop(STOP_MODE.ALLOWFADEOUT); } }
public void HandleDoors(bool _open) { if (_open) { openDoors.SetActive(true); closedDoors.SetActive(false); FMODUnity.RuntimeManager.PlayOneShotAttached(doorOpen, this.gameObject); instanceOpen.start(); } else { openDoors.SetActive(false); closedDoors.SetActive(true); FMODUnity.RuntimeManager.PlayOneShotAttached(doorClose, this.gameObject); instanceClose.start(); } }