setValue() публичный Метод

public setValue ( float value ) : RESULT
value float
Результат RESULT
Пример #1
0
    //[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);
    }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     if (player.transform.position.x >= 9f)
     {
         stage3.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
     }
     else if (player.HP <= 0)
     {
         stage3.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
     }
     else if (boss.HP >= 101)
     {
         bosshp.setValue(1.0f);
     }
     else if (boss.HP >= 50)
     {
         bosshp.setValue(2.2f);
     }
     else if (boss.HP >= 2)
     {
         bosshp.setValue(3.2f);
     }
     else if (boss.HP <= 1)
     {
         bosshp.setValue(3.9f);
     }
 }
Пример #3
0
    public void UpdateTheme(int[] scoreArray)
    {
        maxScore       = GetComponent <GameStateScript>().GetScoreMax();
        totalScore     = 0;
        leadScoreIndex = 0;
        for (int i = 0; i < playerCount; i++)
        {
            totalScore += scoreArray[i];
            if (scoreArray[i] > scoreArray[leadScoreIndex])
            {
                leadScoreIndex = i;
                tied           = false;
            }
            else if (scoreArray[i] == scoreArray[leadScoreIndex])
            {
                tied = true;
            }
        }

        points.setValue((totalScore / playerCount) * (50f / maxScore));
        //Debug.Log((totalScore/playerCount) * (50f / maxScore));

        if (tied == true)
        {
            themeDecision.setValue(-1f);
        }
        else
        {
            themeDecision.setValue(leadScoreIndex);
        }
    }
Пример #4
0
    // Update is called once per frame
    void Update()
    {
        fullvolume.setValue(1);
        currentscene.setValue(1);

        scene = SceneManager.GetActiveScene();
        //print(scene.name);


        if (shbm.starvationTimer > 1)
        {
            fullspanning.setValue(1);
        }
        else
        {
            fullspanning.setValue(0);
        }

        if (scene.name == "Farm")
        {
            currentscene.setValue(1);
        }
        else if (scene.name == "Lake")
        {
            currentscene.setValue(2);
        }
        else if (scene.name == "Forest")
        {
            currentscene.setValue(3);
        }
    }
Пример #5
0
    private void HappensOnAttack(RhythmGrade grade)
    {
        switch (grade)
        {
        case RhythmGrade.Miss:
            Intense.setValue(100f);
            RuntimeManager.PlayOneShot(OffBeatNoCombatSFX);
            Invoke("ResetSnap", 0.3f);
            break;

        case RhythmGrade.Good:
            RuntimeManager.PlayOneShot(OnBeatNoCombatSFX);
            break;

        case RhythmGrade.Great:
            RuntimeManager.PlayOneShot(OnBeatNoCombatSFX);
            break;

        case RhythmGrade.Excellent:
            RuntimeManager.PlayOneShot(OnBeatNoCombatSFX);
            break;

        case RhythmGrade.Super:
            RuntimeManager.PlayOneShot(OnBeatNoCombatSFX);
            break;
        }
    }
Пример #6
0
    void changeState()      //Método de troca de estados.
    {
        if (vivo)           //Se o inimigo estiver vivo,

        {
            if (ativo)               //Se ele estiver ativo,

            {
                ativoParam.setValue(1f);

                if (recebeuDano)                   //Se recebeu dano...

                {
                    stopState();         //Chama o método de ficar parado.
                }
                else                     //Caso não tenha recebido dano...

                {
                    wanderingState();                      //Chama o método de ficar vagando.
                }
            }
            else                 //Caso não esteja ativo,
            {
                ativoParam.setValue(0f);
                stopState();                  //Chama o método de ficar parado.
            }
        }
        else             //Caso não esteja vivo,

        {
            stopState();
            rb.gravityScale = 25;
            ativoParam.setValue(0f);
        }
    }
Пример #7
0
    static void SearchFilePt2()
    {
        //UpdateFmod to appropriate intense levels
        hackingIntensity.setValue(3);

        SearchLibrary(tempString);

        if (foundFiles.Count == 0)
        {
            controller.currentActionLog.Add("No results found");
        }

        //Add each file name to the output log
        else
        {
            controller.currentActionLog.Add("Files found:" + "\n");

            foreach (HackableFile file in foundFiles)
            {
                string output = file.Name;
                controller.currentActionLog.Add("Name: " + output);
            }

            controller.LogStringWithReturn("");
        }

        //Clear the files we found for next use
        foundFiles.Clear();
        //As enter hasn't been pressed, we need to manually called display logged text if we want any text to output from this function
        controller.DisplayLoggedText();
    }
    private void Start()
    {
        particles     = GetComponentsInChildren <ParticleSystem>();
        mover         = GetComponent <Mover>();
        _colorObject  = GetComponent <ColorObject>();
        _colorChanger = GetComponent <ColorChanger>();
        //FMODUnity.RuntimeManager.PlayOneShot("event:/Train/Engine");

        chuuSound = FMODUnity.RuntimeManager.CreateInstance("event:/Train/Chuu");
        chuuSound.getParameter("ChuuActive", out chuuActive);

        engineSound = FMODUnity.RuntimeManager.CreateInstance("event:/Train/Engine");
        engineSound.getParameter("GameSpeed", out engineSpeed);

        musicSound = FMODUnity.RuntimeManager.CreateInstance("event:/Music/Saloon");
        musicSound.getParameter("GameSpeed", out musicSpeed);

        engineSpeed.setValue(0.05f);
        musicSpeed.setValue(0.2f);

        engineSound.setVolume(EngineVolume);


        engineSound.start();
        musicSound.setVolume(MusicVolume);
        musicSound.start();
    }
Пример #9
0
 // Use this for initialization
 void Start()
 {
     menuMusic = FMODUnity.RuntimeManager.CreateInstance(MenuMusicEvent);
     menuMusic.start();
     menuMusic.getParameter("IntroDone", out IntroFinishParameter);
     IntroFinishParameter.setValue(0);
 }
    public Text displayParameter;                 // displays the parameter's value on screen

    // Use this for initialization
    void Start()
    {
        musicEvent = FMOD_StudioSystem.instance.GetEvent("event:/MusicIntensity"); // get an instance of the event
        musicEvent.getParameter("Intensity", out musicIntensity);                  // Use the instance of the event to access the Intensity parameter on that event
        musicIntensity.setValue(0);                                                // set the initial music Intensity to 0
        displayParameter.text = ("Parameter Value: 0 ");                           // initially show 0 in the parameter text on screen
        musicEvent.start();                                                        // Start the music event
    }
Пример #11
0
 private void OnCollisionEnter2D(Collision2D col)
 {
     // 벽에 닿아도 삭제
     if (col.gameObject.tag == "Wall")
     {
         Destroy(gameObject);
     }
     // 점프오브젝트에 닿아도 삭제
     else if (col.gameObject.tag == "Jump")
     {
         Destroy(gameObject);
     }
     // 아이템상자에 닿아도 삭제
     else if (col.gameObject.tag == "Item")
     {
         Destroy(gameObject);
     }
     // 땅에 닿아도 삭제
     else if (col.gameObject.tag == "Ground")
     {
         anim.SetBool("isAttack", true);
         BoxCollider2D[] colls = gameObject.GetComponents <BoxCollider2D>(); //박스2개선언
         colls[0].enabled = false;                                           //서있는상태박스false
         colls[1].enabled = true;                                            //서있는상태박스false
         Destroy(gameObject, 0.3f);
         Broken.setValue(1.0f);
     }
     else if (col.gameObject.tag.Equals("Player") && player.isUnBeatTime == false)
     {
         player.HP--;
         anim.SetBool("isAttack", true);
         BoxCollider2D[] colls = gameObject.GetComponents <BoxCollider2D>(); //박스2개선언
         colls[0].enabled = false;                                           //서있는상태박스false
         Destroy(gameObject, 0.3f);
         Broken.setValue(1.0f);
     }
     else if (col.gameObject.tag.Equals("Player") && player.isUnBeatTime == true)
     {
         anim.SetBool("isAttack", true);
         BoxCollider2D[] colls = gameObject.GetComponents <BoxCollider2D>(); //박스2개선언
         colls[0].enabled = false;                                           //서있는상태박스false
         Destroy(gameObject, 0.3f);
         Broken.setValue(1.0f);
     }
     else if (col.gameObject.tag == "EnemyBullet")
     {
         Destroy(gameObject);
     }
     else if (col.gameObject.tag == "Enemy")
     {
         Destroy(gameObject);
     }
     else if (col.gameObject.tag == "Scene")
     {
         Destroy(gameObject);
     }
 }
Пример #12
0
    void Start()
    {
        musicInstance = FMODUnity.RuntimeManager.CreateInstance("event:/Music/Music_Main");
        musicInstance.getParameter("Music_Controller", out parametr);

        musicInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(this.gameObject, this.GetComponent <Rigidbody>()));
        musicInstance.start();
        parametr.setValue(parametrValue);
    }
Пример #13
0
 public void PlayMusic()
 {
     if (play_state != FMOD.Studio.PLAYBACK_STATE.PLAYING)
     {
         musicEvent.start();
         intensity.setValue(0);
         intensityValue = 0;
         EventSystem.current.SetSelectedGameObject(null);
     }
 }
Пример #14
0
    void Start()
    {
        obj  = GameObject.FindGameObjectWithTag("Elevator");
        obj2 = GameObject.FindGameObjectWithTag("GameModeManager");

        OST_Intro = FMODUnity.RuntimeManager.CreateInstance("event:/OST/OST_Intro");
        OST_Intro.getParameter("MainGame", out MainGame);
        OST_Intro.getParameter("IV", out IV);
        MainGame.setValue(0);
        IV.setValue(0.9f);

        OST_Intro.start();

        OST_2 = FMODUnity.RuntimeManager.CreateInstance("event:/OST/OST_2");
        OST_2.getParameter("MainGame2", out MainGame2);
        OST_2.getParameter("OV", out OV);
        OST_2.getParameter("EndGame", out EndGame);
        OST_2.getParameter("GameOver", out GameOver);
        MainGame2.setValue(0);
        EndGame.setValue(0);
        GameOver.setValue(0);
        OV.setValue(0.9f);

        FluxEffect = FMODUnity.RuntimeManager.CreateInstance("event:/SD/FluxCarrier");
        FluxEffect.getParameter("FV", out FV);
        FV.setValue(0.8f);

        Checkpoint = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Hexagon");
        Checkpoint.getParameter("HV", out HV);
        Checkpoint.getParameter("HP", out HP);
        HV.setValue(0.95f);
        HP.setValue(0);

        Jump = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Jump");
        Jump.getParameter("JV", out JV);
        JV.setValue(0.8f);

        Headroll = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Headroll");
        Headroll.getParameter("HRV", out HRV);
        HRV.setValue(0.75f);

        JumpPad = FMODUnity.RuntimeManager.CreateInstance("event:/SD/JumpPad");
        JumpPad.getParameter("JPV", out JPV);
        JPV.setValue(0.74f);

        Atmosphere = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Atmosphere");
        Atmosphere.getParameter("AV", out AV);
        AV.setValue(0.7f);

        Atmosphere.start();

        Stinger = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Stinger");
        Stinger.getParameter("STV", out STV);
        STV.setValue(0.8f);
    }
Пример #15
0
 public static void gerenciaSom()
 {
     if (pararMusica)
     {
         pararParam.setValue(1f);
     }
     else
     {
         pararParam.setValue(0f);
     }
 }
Пример #16
0
 public void SetPaused(bool pauseValue)
 {
     if (pauseValue == true)
     {
         pauseMenu.setValue(1f);
     }
     else
     {
         pauseMenu.setValue(0f);
     }
 }
Пример #17
0
 public void SetInGame(bool inGameValue)
 {
     if (inGameValue == true)
     {
         inGame.setValue(1f);
     }
     else
     {
         inGame.setValue(0f);
     }
 }
Пример #18
0
 // Update is called once per frame
 void Update()
 {
     Volume.setValue(1);
     if (Stahea.hunger < 30)
     {
         Spanning.setValue(1);
     }
     else
     {
         Spanning.setValue(0);
     }
 }
Пример #19
0
 public override void Enter()
 {
     RuntimeManager.PlayOneShotAttached(PlayerDeathSFX, player.gameObject);
     snapIntensity.setValue(100f);
     PlayerAnimator.SetFloat("Velocity", 0);
     PlayerAnimator.SetTrigger("Death");
     Velocity = Vector3.zero;
     PlayerAnimator.SetTrigger(DeathAnimationTag);
     respawnTimer = 0f;
     player.OnPlayerDeath?.Invoke();
     StreakCounterUI.CollectDeath();
 }
Пример #20
0
    // Use this for initialization
    void Start()
    {
        soloEventInstance = FMODUnity.RuntimeManager.CreateInstance(soloSound);

        soloEventInstance.getParameter("Play", out shouldPlay);
        shouldPlay.setValue(0);

        // // soloEventInstance.set3DAttributes();
        soloEventInstance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);

        time = 0f;
    }
Пример #21
0
 // Update is called once per frame
 void Update()
 {
     if (GameManager.Instance.UIManager)
     {
         furySound.setValue(GameManager.Instance.UIManager.FuryGauge.Fury / 100f);
     }
     else
     {
         furySound.setValue(fury / 100);
         volumeMusic.setValue(volumeSoundMusic * (GameManager.Instance.VolumeMaster / 100) * (GameManager.Instance.VolumeMusic / 100));
     }
 }
Пример #22
0
    void Start()
    {
        obj = GameObject.FindGameObjectWithTag("Player2");

        Steps_scape = FMODUnity.RuntimeManager.CreateInstance("event:/SD/Steps_scape");
        Steps_scape.getParameter("SSV", out SSV);
        SSV.setValue(0.7f);

        StepsWall = FMODUnity.RuntimeManager.CreateInstance("event:/SD/StepsWall");
        StepsWall.getParameter("SWV", out SWV);
        SWV.setValue(0.75f);
    }
    void OnTriggerEnter(Collider other)
    {
        /* if colliding with cubes */

        if (other.gameObject.CompareTag("Pickup"))
        {
            other.gameObject.SetActive(false);
        }

        if (other.gameObject.CompareTag("Playcube"))
        {
            // When collision with the Playcube is detected, and if not already playing music event, play the music

            FMOD.Studio.PLAYBACK_STATE play_state;
            musicEv.getPlaybackState(out play_state);
            if (play_state != FMOD.Studio.PLAYBACK_STATE.PLAYING)
            {
                musicEndParam.setValue(0);
                musicEv.start();
            }
        }

        if (other.gameObject.CompareTag("Stopcube"))
        {
            // When collision with the Stopcube is detected, set end param to 1, which transitions to the end of the event music

            musicEndParam.setValue(1);

            // musicEv.release (); if you do not intend on playing this sound again
        }

        if (other.gameObject.CompareTag("Killcube"))
        {
            // When collision with the Killcube is detected, immediately stop the event music

            musicEv.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);

            //musicEv.release (); can be called if the music does not need to be switched on again.
        }

        if (other.gameObject.CompareTag("ReverbZone"))
        {
            // When collision with the ReverbZone is detected, turn on the Reverb Snapshot

            reverbSnapshotEv.start();
            other.GetComponent <Renderer>().material.color = Color.red;

            Debug.Log("reverb snapshot begin");
        }
    }
Пример #24
0
    // Update is called once per frame
    void Update()
    {
        fullvolume.setValue(0.7f);
        currentscene.setValue(2);

        if (shbm.hunger < 30)
        {
            fullspanning.setValue(1);
        }
        else
        {
            fullspanning.setValue(0);
        }
    }
Пример #25
0
 // Start is called before the first frame update
 void Start()
 {
     if (loop)
     {
         loopSound.setValue(1);
     }
     else
     {
         loopSound.setValue(0);
     }
     music.start();
     volumeMusic.setValue(volumeSoundMusic * (GameManager.Instance.VolumeMaster / 100) * (GameManager.Instance.VolumeMusic / 100));
     FMODUnity.RuntimeManager.AttachInstanceToGameObject(music, transform, GetComponent <Rigidbody2D>());
 }
Пример #26
0
    void Start()
    {
        atmoEv = FMODUnity.RuntimeManager.CreateInstance(atmoAll);
        atmoEv.getParameter("location", out atmoLoc);
        atmoEv.getParameter("rain", out atmoRain);

        musicEv = FMODUnity.RuntimeManager.CreateInstance(music);
        musicEv.getParameter("music_style", out musicType);

        musicEv.getVolume(out volume);
        musicType.setValue(1);

        rainlvl = 0;
    }
Пример #27
0
    IEnumerator IChangingParameterColor(float numColor)
    {
        float areaIni = numColor;
        float areaFin = areaIni + 1;

        for (float i = areaIni; i < areaFin; i += Time.deltaTime)
        {
            parameterColor.setValue(i);
            yield return(null);
        }

        parameterColor.setValue(areaFin);
        Debug.Log("Color is " + areaFin);
    }
Пример #28
0
    void Awake()
    {
        OST = FMODUnity.RuntimeManager.CreateInstance("event:/Music All");
        OST.getParameter("fullspanning", out fullspanning);
        OST.getParameter("fullvolume", out fullvolume);
        OST.getParameter("currentscene", out currentscene);
        currentscene.setValue(1);

        scene = SceneManager.GetActiveScene();

        print(scene.name);

        FMODUnity.RuntimeManager.AttachInstanceToGameObject(OST, GetComponent <Transform>(), GetComponent <Rigidbody>());
        OST.start();
    }
Пример #29
0
    void Occlusion()
    {
        bool col = Physics.Linecast(this.transform.position, _Player.transform.position, OcclusionLayer);

        if (!col)
        {
            Occluded.setValue(0);
        }


        else
        {
            Occluded.setValue(1.0f);
        }
    }
    void Update()
    {
        if (!Alive)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.UpArrow) && transform.position.y < 6)
        {
            transform.position += new Vector3(0, 2, 0);
            changeRails.Play();
        }
        if (Input.GetKeyDown(KeyCode.DownArrow) && transform.position.y > 0)
        {
            transform.position += new Vector3(0, -2, 0);
            changeRails.Play();
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            chuuSound.start();
            chuuActive.setValue(1.0f);
        }
        if (Input.GetKeyUp(KeyCode.Space))
        {
            chuuActive.setValue(0.0f);
        }


        //musicSpeed.setValue((mover.speed - 25.0f) / 200.0f + 0.5f);
        engineSpeed.setValue((mover.speed - 25.0f) / 200.0f + 0.5f);

        float initialSpeed = GetComponent <Mover>().speed;
        float currentSpeed = GetComponent <Mover>().currentSpeed;
        float gameSpeed    = 0.5f;

        if (currentSpeed < initialSpeed)
        {
            gameSpeed = currentSpeed / initialSpeed * 0.5f;
        }
        else
        {
            gameSpeed = 0.5f + ((currentSpeed - initialSpeed) / (25.0f - initialSpeed)) * 0.1f;
        }

        //musicSpeed.setValue(gameSpeed);
        engineSpeed.setValue(gameSpeed);
    }
Пример #31
0
    IEnumerator VaryWindParam(ParameterInstance param)
    {
        float currValue;
        param.getValue(out currValue);

        // random range is based on the current settings in FMOD
        float newValue = Random.Range(0, 10);
        float amountOfChange = Mathf.Abs(currValue - newValue);

        // a larger change in speed should be applied over a longer period of time
        float changeTime = amountOfChange * 3;
        float elapsedTime = 0;

        while (elapsedTime < changeTime)
        {
            currValue = Mathf.Lerp(currValue, newValue, (elapsedTime / changeTime));
            param.setValue(currValue);
            elapsedTime += Time.deltaTime;

            yield return null;
        }

        StartCoroutine(VaryWindParam(param));
    }