Inheritance: HandleBase
示例#1
1
    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;
        }
    }
示例#3
0
    public void SetParameterFloat(FMOD.Studio.EventInstance instance, string parameter, float value)
    {
        FMOD.Studio.ParameterInstance _parameter;
        instance.getParameter(parameter, out _parameter);

        _parameter.setValue(value);
    }
    protected void PlayCircuitSound(string state)
    {
        string sound = null;

        if (state == "powered")
        {
            sound = Sounds.Instance.BuildingPowerOnMigrated;
        }
        else if (state == "overdraw")
        {
            sound = Sounds.Instance.ElectricGridOverloadMigrated;
        }
        else
        {
            Debug.Log("Invalid state for sound in EnergyConsumer.");
        }
        if (CameraController.Instance.IsAudibleSound(base.transform.GetPosition()))
        {
            if (!lastTimeSoundPlayed.TryGetValue(state, out float value))
            {
                value = 0f;
            }
            float value2 = (Time.time - value) / soundDecayTime;
            FMOD.Studio.EventInstance instance = KFMOD.BeginOneShot(sound, CameraController.Instance.GetVerticallyScaledPosition(base.transform.GetPosition()));
            instance.setParameterValue("timeSinceLast", value2);
            KFMOD.EndOneShot(instance);
            lastTimeSoundPlayed[state] = Time.time;
        }
    }
 void Start()
 {
     StartCoroutine("GO");
     volInicio = FMODUnity.RuntimeManager.CreateInstance(parede);
     volInicio.setVolume(PlayerPrefs.GetFloat("VolumeFX"));
     volInicio.start();
 }
 private void InitMusic()
 {
     eMusic = FMODUtility.GetEvent(path);
     pMood = FMODUtility.GetParameter(eMusic, MOOD_PARAMETER);
     pState = FMODUtility.GetParameter(eMusic, STATE_PARAMETER);
     pTrack = FMODUtility.GetParameter(eMusic, TRACK_PARAMETER);
 }
    void Start()
    {
        vol = FMODUnity.RuntimeManager.CreateInstance(musica1);
        vol.setVolume(PlayerPrefs.GetFloat("VolumeFX"));
        vol.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);
    }
示例#9
0
    void Awake()
    {
        //FMOD
        pickupFX = RuntimeManager.CreateInstance("event:/Sounds/Players/Pickup_sound");
        dropFX = RuntimeManager.CreateInstance("event:/Sounds/Players/Drop_sound");

        if(tag=="Animal1")
        {
            pickup = RuntimeManager.CreateInstance("event:/Sounds/Animals/Chicken_Pickup");
            die = RuntimeManager.CreateInstance("event:/Sounds/Animals/Chicken_Die");
        }
        if (tag == "Animal2")
        {
            pickup = RuntimeManager.CreateInstance("event:/Sounds/Animals/Pig_Pickup");
            die = RuntimeManager.CreateInstance("event:/Sounds/Animals/Pig_Die");
        }
        if (tag == "Animal3")
        {
            pickup = RuntimeManager.CreateInstance("event:/Sounds/Animals/Bison_Pickup");
            die = RuntimeManager.CreateInstance("event:/Sounds/Animals/Bison_Die");
        }


        hole = GameObject.Find("hole");
        originRotation = transform.rotation;
        spawn = true;
        StartCoroutine(WiggleNum());
        StartCoroutine(ChooseDestination());
    }
示例#10
0
文件: Test.cs 项目: slb1988/FmodDemo
    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;
        }
    }
示例#11
0
文件: Test.cs 项目: slb1988/FmodDemo
    // 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();
        }
    }
示例#12
0
 private void Start()
 {
     this.resetHasAttackedPlayer();
     this.resetSearchingFire();
     this.ceilingMarkers     = GameObject.FindGameObjectsWithTag("ceiling");
     this.initLizardAmount   = this.maxLizardAmount;
     this.initRabbitAmount   = this.maxRabbitAmount;
     this.initTurtleAmount   = this.maxTurtleAmount;
     this.initTortoiseAmount = this.maxTortoiseAmount;
     this.initRaccoonAmount  = this.maxRaccoonAmount;
     this.initDeerAmount     = this.maxDeerAmount;
     if (FMOD_StudioSystem.instance)
     {
         this.SurfaceMusic = FMOD_StudioSystem.instance.GetEvent(this.SurfaceMusicPath);
         this.CaveMusic    = FMOD_StudioSystem.instance.GetEvent(this.CaveMusicPath);
     }
     else
     {
         UnityEngine.Debug.LogError("FMOD_StudioSystem.instance is null, could not initialize sceneTracker audio");
     }
     this.MusicEnabled       = true;
     this.CombatMusicEnabled = true;
     base.InvokeRepeating("updateAnimalCount", 1f, 60f);
     base.Invoke("checkPlanePos", 0.5f);
     base.InvokeRepeating("cleanupPlayerLists", 1f, 1f);
 }
示例#13
0
	// Use this for initialization
	void Start () {
		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);
	}
示例#14
0
    private void ClearFinishedSongs()
    {
        if (activeSongs.Count > 0)
        {
            ListPool <string, MusicManager> .PooledList pooledList = ListPool <string, MusicManager> .Allocate();

            foreach (KeyValuePair <string, SongInfo> activeSong in activeSongs)
            {
                SongInfo value = activeSong.Value;
                FMOD.Studio.EventInstance ev = value.ev;
                ev.getPlaybackState(out value.musicPlaybackState);
                if (value.musicPlaybackState == PLAYBACK_STATE.STOPPED || value.musicPlaybackState == PLAYBACK_STATE.STOPPING)
                {
                    pooledList.Add(activeSong.Key);
                    foreach (string item in value.songsOnHold)
                    {
                        SetSongParameter(item, "interrupted_dimmed", 0f, true);
                    }
                    value.songsOnHold.Clear();
                }
            }
            foreach (string item2 in pooledList)
            {
                activeSongs.Remove(item2);
            }
            pooledList.Recycle();
        }
    }
示例#15
0
 public FMOD.Studio.PLAYBACK_STATE eventState(FMOD.Studio.EventInstance soundEvent)
 {
     //FMOD.Studio.EventInstance temp = FMOD_StudioSystem.instance.GetEvent(soundEvent);
     FMOD.Studio.PLAYBACK_STATE temp;
     eventList.Find(listedSoundEvent => listedSoundEvent == soundEvent).getPlaybackState(out temp);
     return(temp);
 }
示例#16
0
 public override void Initialize(object owner)
 {
     base.Initialize(owner);
     ultSnap = FMODUnity.RuntimeManager.CreateInstance("snapshot:/UltSnap");
     ultSnap.getParameter("UltSnapParam", out ultSnapParam);
     ultSnap.start();
 }
示例#17
0
    // Update is called once per frame
    void OnTriggerStay(Collider col)
    {
        if (col.tag == "Player" && GlobalFuncVari.getTutorialSkipped() != true && tutorialPlayed == false && startedPlaying == false)
        {
            movementScript.enabled = false;
            boostScript.enabled    = false;
            jumpScript.enabled     = false;
            tutorialEvent          = soundEmitter.startEvent(tutorialSound, false);
            textureDisplay.tutorialTexture(tutorialHint);
            startedPlaying = true;
        }

        if (col.tag == "Player" && startedPlaying == true)
        {
            tutorialEventState = soundEmitter.eventState(tutorialEvent);
            if (tutorialEventState != PLAYBACK_STATE.PLAYING)
            {
                movementScript.enabled = true;
                boostScript.enabled    = true;
                jumpScript.enabled     = true;
                tutorialPlayed         = true;
                //textureDisplay.tutorialTexture(null);
                Debug.Log("LOL");
            }
            if (Input.GetButtonDown("Cancel"))
            {
                GlobalFuncVari.setTutorialSkipped(true);
                soundEmitter.stopEvent(tutorialEvent);
                //textureDisplay.tutorialTexture(null);
                movementScript.enabled = true;
                boostScript.enabled    = true;
                jumpScript.enabled     = true;
            }
        }
    }
示例#18
0
 // Use this for initialization
 void Start()
 {
     //connect FMOD events and instances to variables
     example = FMOD_StudioSystem.instance.GetEvent ("event:/Pickup");
     example.getParameter ("Type", out examplePara);
     example.getParameter ("Volume", out examplePara2);
 }
示例#19
0
 void Start()
 {
     StartCoroutine("GO");
     tiroInstance = FMODUnity.RuntimeManager.CreateInstance(tiro);
     tiroInstance.setVolume(PlayerPrefs.GetFloat("VolumeFX"));
     tiroInstance.start();
 }
 void UIBOOST()
 {
     UIBoost = FMODUnity.RuntimeManager.CreateInstance(BoostAudio);
     UIBoost.start();
     VoiBoost = FMODUnity.RuntimeManager.CreateInstance(VOIBoost);
     VoiBoost.start();
 }
    void OnDestroy()

    {
        if (isShuttingDown)
        {
            return;
        }



        FMOD.Studio.UnityUtil.Log("Destroy called");

        if (evt != null && evt.isValid())

        {
            if (getPlaybackState() != FMOD.Studio.PLAYBACK_STATE.STOPPED)

            {
                FMOD.Studio.UnityUtil.Log("Release evt: " + path);

                ERRCHECK(evt.stop(FMOD.Studio.STOP_MODE.IMMEDIATE));
            }



            ERRCHECK(evt.release());

            evt = null;
        }
    }
示例#22
0
    void Awake()
    {
        if (Instance == null) Instance = this;
        else
        {
            if (this != Instance)
                Destroy(this.gameObject);
        }

        pickup = RuntimeManager.CreateInstance("event:/Sounds/Players/Pickup_sound");
        drop = RuntimeManager.CreateInstance("event:/Sounds/Players/Drop_sound");


        diePlayers[0] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player1_Die");
        diePlayers[1] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player2_Die");
        diePlayers[2] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player3_Die");
        diePlayers[3] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player4_Die");

        
        pickupPlayers[0] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player1_Pickup");
        pickupPlayers[1] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player2_Pickup");
        pickupPlayers[2] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player3_Pickup");
        pickupPlayers[3] = RuntimeManager.CreateInstance("event:/Sounds/Players/Player4_Pickup");

        playerready[0] = RuntimeManager.CreateInstance("event:/Sounds/Animals/Announcer/Player 1");
        playerready[1] = RuntimeManager.CreateInstance("event:/Sounds/Animals/Announcer/Player 2");
        playerready[2] = RuntimeManager.CreateInstance("event:/Sounds/Animals/Announcer/Player 3");
        playerready[3] = RuntimeManager.CreateInstance("event:/Sounds/Animals/Announcer/Player 4");


        //diePlayers[3].start();
    }
示例#23
0
    // --------------------------
    // 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!!!");

        //-----------------------------
    }
示例#24
0
 private static void Set3DAttributes(FMOD.Studio.EventInstance evt, ATTRIBUTES_3D attributes)
 {
     if (evt != null && evt.isValid())
     {
         UnityUtil.ERRCHECK(evt.set3DAttributes(attributes));
     }
 }
示例#25
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else if (instance != this)
        {
            Destroy(this);
            return;
        }

        musicInstance            = RuntimeManager.CreateInstance(music);
        gameStartInstance        = RuntimeManager.CreateInstance(gameStart);
        nfc_detect_leftInstance  = RuntimeManager.CreateInstance(nfc_detect_left);
        nfc_detect_rightInstance = RuntimeManager.CreateInstance(nfc_detect_right);
        killInstance             = RuntimeManager.CreateInstance(kill);
        bothDestroyedInstance    = RuntimeManager.CreateInstance(bothDestroyed);
        blockedInstance          = RuntimeManager.CreateInstance(blocked);
        baseDamageInstance       = RuntimeManager.CreateInstance(baseDamage);
        evolveP1       = RuntimeManager.CreateInstance(evolve);
        evolveP2       = RuntimeManager.CreateInstance(evolve);
        summonInstance = RuntimeManager.CreateInstance(summon);
    }
示例#26
0
 // Use this for initialization
 void Start ()
 {
     musicSound = FMODUnity.RuntimeManager.CreateInstance(MusicEvent);
     musicSound.getParameter("Light-Dark", out musicParam);
     //musicSound.setParameterValue("Light-Dark", startAmbient);
     musicSound.start();
 }
示例#27
0
    /// <summary>
    /// Gets the event.
    /// </summary>
    /// <param name="path">The path.</param>
    /// <returns></returns>
    public FMOD.Studio.EventInstance GetEvent(string path)
    {
        FMOD.Studio.EventInstance instance = null;

        if (string.IsNullOrEmpty(path))
        {
            Logger.LogError("Empty event path!");
            return(null);
        }

        if (eventDescriptions.ContainsKey(path))
        {
            Logger.ErrorCheck(eventDescriptions[path].CreateInstance(out instance));
        }
        else
        {
            FMOD.Studio.EventDescription desc = GetEventDescription(path);
            Logger.ErrorCheck(desc.CreateInstance(out instance));
        }

        if (instance == null)
        {
            Logger.LogMessage("GetEvent Failed: \"path\"");
        }

        return(instance);
    }
示例#28
0
	void Start () 
	{
		collider.isTrigger = true;
		m_PlayerName = Camera.main.transform.parent.gameObject.name;
		m_MusicManager = GameObject.FindObjectOfType<MusicManager>() as MusicManager;
		m_Event = m_MusicManager.GetEvent;
	}
	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();
	}
示例#30
0
 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());
 }
示例#31
0
 void OnTriggerEnter(Collider col)
 {
     if (col.tag == "Player" && GlobalFuncVari.getTutorialSkipped() != true)
     {
         soundEvent = soundEmitter.startEvent(tutorialSound, false);
         instructionsDisplay.texture = tutorialText;
     }
 }
示例#32
0
    void Start()
    {
        RadioFMOD = FMODUnity.RuntimeManager.CreateInstance("event:/Radio");
        RadioFMOD.start();
        RadioFMOD.getParameter("Frequency", out RadioParameterFMOD);

        RadioFMOD.getParameter("Inside", out InsideParameterFMOD);
    }
示例#33
0
    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();
    }
示例#34
0
 // 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;
 }
 void OnTriggerEnter()
 {
     reverb = FMODUnity.RuntimeManager.CreateInstance("event:/snapshot/" + gameObject.name);
     reverb.start();
     reverb.getParameter("reverbDistance", out reverbDistance);
     reverbDistance.setValue(0f);
     print( gameObject.name + " triggered" );
 }
示例#36
0
    protected void Start()
    {
        
        raidersEv = FMODUnity.RuntimeManager.CreateInstance(raiders);
        raidersEv.getParameter("Attack", out raidersAttackParam);

        StartCoroutine(PregameMockup());
    }
 public static void StopEvent()
 {
     if (currentInstance != null && currentInstance.IsValid())
     {
         Logger.ErrorCheck(currentInstance.Stop(FMOD.Studio.StopNode.Immediate));
         currentInstance = null;
     }
 }
示例#38
0
 // 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);
 }
示例#39
0
 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();
 }
示例#40
0
	// Use this for initialization
	void Start () {
		cachedRigidBody = GetComponent<Rigidbody>();
		openSound = FMODUnity.RuntimeManager.CreateInstance(openEvent);
		closeSound = FMODUnity.RuntimeManager.CreateInstance(closeEvent);

		openSound.setParameterValue("Distance", 0.0f);
		closeSound.setParameterValue("Distance", 0.0f);
	}
示例#41
0
 private void StopMusic()
 {
     if (this.ActiveMusic != null && this.ActiveMusic.isValid())
     {
         UnityUtil.ERRCHECK(this.ActiveMusic.stop(STOP_MODE.ALLOWFADEOUT));
         this.ActiveMusic = null;
     }
 }
示例#42
0
 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());
 }
 public FMOD.Studio.EventInstance GetEvent()
 {
     if (evt == null)
     {
         evt = FMOD_StudioSystem.instance.GetEvent(path);
     }
     return(evt);
 }
示例#44
0
    // 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);
    }
示例#45
0
    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());
            }
        }
    }
示例#46
0
	// 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();
	}
示例#47
0
        public static void AttachInstanceToGameObject(FMOD.Studio.EventInstance instance, Transform transform, Rigidbody rigidBody)
        {
            var attachedInstance = new AttachedInstance();

            attachedInstance.transform = transform;
            attachedInstance.instance  = instance;
            attachedInstance.rigidBody = rigidBody;
            Instance.attachedInstances.Add(attachedInstance);
        }
示例#48
0
	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 ();
	}
        public override void CreateModMenuSection(TextMenu menu, bool inGame, FMOD.Studio.EventInstance snapshot)
        {
            base.CreateModMenuSection(menu, inGame, snapshot);

            menu.Add(new TextMenu.Button("modoptions_celestetas_reload".DialogCleanOrNull() ?? "Reload Settings").Pressed(() => {
                LoadSettings();
                Hotkeys.instance.OnInputInitialize();
            }));
        }
示例#50
0
 void OnTriggerEnter(Collider col)
 {
     if (col.tag == "Player")
     {
         //movementScript.enabled = false;
         introEvent = soundEmitter.startEvent(tutorialStartDialogue, false);
         textureDisplay.texture = tutorialStartHint;
     }
 }
示例#51
0
        public override void CreateModMenuSection(TextMenu menu, bool inGame, FMOD.Studio.EventInstance snapshot)
        {
            if (SettingsOverridden && !Settings.AlwaysShowSettings)
            {
                menu.Add(new TextMenu.SubHeader(Dialog.Clean("modoptions_ghostmodule_overridden") + " | v." + Metadata.VersionString));
                return;
            }

            base.CreateModMenuSection(menu, inGame, snapshot);
        }
    // 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);

    }
示例#54
0
	void Start()
	{
//		engine = FMOD_StudioSystem.instance.getEvent("/Background/Orchestral Music");
//		engine.start();
//		engine.getParameter("RPM", out engineRPM);
		fmodSound = FMOD_StudioSystem.instance.GetEvent (gameObject.GetComponent<FMOD_StudioEventEmitter>().path);
		fmodSound.getParameter ("State", out fmodState);

		fmodState.setValue (state);
	}
示例#55
0
 private void Start()
 {
     soundManager         = GameObject.Find("Main Camera").GetComponent <SoundManager>();
     lavaLoopInst         = FMODUnity.RuntimeManager.CreateInstance("event:/Environment/lv01/lavaloop"); //play sound
     stalagtiteSpawnStart = new Vector3(10, stalag.stalagtiteYSpawn, 0);
     stalagmiteSpawnStart = new Vector3(10, stalag.stalagmiteYSpawn, 0);
     stalag.stalagtite.GetComponent <Mover>().speed = stalag.stalagSpeed;
     stalag.stalagmite.GetComponent <Mover>().speed = stalag.stalagSpeed;
     StartCoroutine(PlayerStart());
 }
示例#56
0
 void Start()
 {
     if(obj.GetComponent<PlayerController>().transform.localScale.x < 0)
     {
         vel *= -1;
     }
     volInicio = FMODUnity.RuntimeManager.CreateInstance(inicio);
     volInicio.setVolume(PlayerPrefs.GetFloat("VolumeFX"));
     volInicio.start();
 }
示例#57
0
 public void StartFadeToPause(FMOD.Studio.EventInstance inst, bool paused, float fadeTime = 0.25f)
 {
     if (paused)
     {
         StartCoroutine(FadeToPause(inst, fadeTime));
     }
     else
     {
         StartCoroutine(FadeToUnpause(inst, fadeTime));
     }
 }
 void Update()
 {
     if (evt != null && evt.isValid())
     {
         Update3DAttributes();
     }
     else
     {
         evt = null;
     }
 }
示例#59
0
    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();
    }
示例#60
0
 void Update()
 {
     if (evt != null && evt.isValid())
     {
         var attributes = UnityUtil.to3DAttributes(gameObject);
         ERRCHECK(evt.set3DAttributes(attributes));
     }
     else
     {
         evt = null;
     }
 }