GetRTPCValue() публичный статический Метод

public static GetRTPCValue ( string in_pszRtpcName, UnityEngine in_gameObjectID, uint in_playingID, float &out_rValue, int &io_rValueType ) : AKRESULT
in_pszRtpcName string
in_gameObjectID UnityEngine
in_playingID uint
out_rValue float
io_rValueType int
Результат AKRESULT
Пример #1
0
    void Update()
    {
        anim.SetBool("onGround", coll.onGround);
        anim.SetBool("onWall", coll.onWall);
        anim.SetBool("onRightWall", coll.onRightWall);
        anim.SetBool("wallGrab", move.wallGrab);
        anim.SetBool("wallSlide", move.wallSlide);
        anim.SetBool("canMove", move.canMove);
        anim.SetBool("isDashing", move.isDashing);
        //if joystick hasn't been touched OR character is not moving, then when character is idle, will talk.
        if ((Mathf.Abs(movement.horizontalAxis) == 0 && Mathf.Abs(movement.verticalAxis) == 0) ||
            (Mathf.Abs(movement.rb.velocity.x) == 0 && Mathf.Abs(movement.rb.velocity.y) == 0))
        {
            CanTalkOrNot = true;
        }
        else
        {
            CanTalkOrNot = false;
        }

        //Debug.LogWarning(canTalk);
        int      valueTypeTalkingVol = (int)AkQueryRTPCValue.RTPCValue_GameObject;
        AKRESULT result = AkSoundEngine.GetRTPCValue(talkingVol.Name, go, 0, out rtpcValueTalkingVol, ref valueTypeTalkingVol);

        sr.transform.localScale = new Vector2(map(rtpcValueTalkingVol, -48f, 0f, spriteSizeMin, spriteSizeMax),
                                              map(rtpcValueTalkingVol, -48f, 0f, spriteSizeMin, spriteSizeMax));
        sr.transform.localPosition = new Vector2(0, (map(rtpcValueTalkingVol, -48f, 0f, spriteSizeMin, spriteSizeMax) - 1f) * 0.5f);
    }
    // Update is called once per frame
    void Update()
    {
        // RTPCValue_type.RTPCValue_Global
        // for whatever reason, this constant isn‘t exposed by name by WWise C#/Unity headers
        int type = 1;

        // will contain the value of the RTPC parameter after the GetRTPCValue call
        float value;

        // retrieves current value of the RTPC parameter and stores it in ‘value‘
        AkSoundEngine.GetRTPCValue(rtpcID, gameObject, 0, out value, ref type);

        //
        // use ‘value‘ here

        Debug.Log("RTPC returned value of: " + value);
        //
        // e.g. transform.localScale += Vector3( value, 0, 0 );
        // which would scale by the value of the RTPC parameter
        //
        // or whatever else you want to do with the RTPC parameter value
        //
        // Note that WWise Meter output bus volume parameters are measured in decibels and so are negative
        // e.g. –60.0 (softer) to –20.0 (louder)
        //
    }
Пример #3
0
    public void Update()
    {
        int type = 1;

        AkSoundEngine.GetRTPCValue(rtpcId.Id, gameObject, 0, out ColorIntensity, ref type);

        ChangeColor();
    }
Пример #4
0
    // Update is called once per frame
    void Update()
    {
        int   type = 1;
        float value;

        AkSoundEngine.GetRTPCValue(RTPCName, gameObject, 0, out value, ref type);
        Debug.Log(value);
    }
Пример #5
0
        void Update()
        {
            float value;
            int   type = 1;

            AkSoundEngine.GetRTPCValue(rtpcName, gameObject, 0, out value, ref type);
            dbLevel = value;
            //Debug.Log(rtpcName + ": " + value);
        }
Пример #6
0
    void Update()
    {
        //var main = ps.main;
        int      valueType = (int)AkQueryRTPCValue.RTPCValue_Global;
        AKRESULT result    = AkSoundEngine.GetRTPCValue(rtpcID, gameObject, 0, out rtpcValue, ref valueType);

        //main.simulationSpeed = map(rtpcValue, -48.0f, 0.0f, 1.0f, 0.2f);
        Time.timeScale = map(rtpcValue, -48.0f, 0.0f, 1.0f, 0.2f);
    }
Пример #7
0
    private void getMeterValues()
    {
        int type = 1;

        AkSoundEngine.GetRTPCValue("DRMLowMeter", obj, playingID, out lowMeter, ref type);
        AkSoundEngine.GetRTPCValue("DRMLowMidMeter", obj, playingID, out lowMidMeter, ref type);
        AkSoundEngine.GetRTPCValue("DRMHiMidMeter", obj, playingID, out hiMidMeter, ref type);
        AkSoundEngine.GetRTPCValue("DRMHiMeter", obj, playingID, out hiMeter, ref type);
    }
Пример #8
0
        void Update()
        {
            float value;
            int   type = 1;

            AkSoundEngine.GetRTPCValue(RTPCName, gameObject, 0, out value, ref type);

            dbLevel = value;
        }
            // Token: 0x06000B49 RID: 2889 RVA: 0x00037DFC File Offset: 0x00035FFC
            public override string GetString()
            {
                int      num = 1;
                float    value;
                AKRESULT rtpcvalue = AkSoundEngine.GetRTPCValue(this.rtpcName, null, 0u, out value, ref num);

                if (rtpcvalue == AKRESULT.AK_Success)
                {
                    return(TextSerialization.ToStringInvariant(value));
                }
                return("ERROR: " + rtpcvalue);
            }
Пример #10
0
        private void Update()
        {
            int valueTypeGlitch = (int)AkQueryRTPCValue.RTPCValue_GameObject;

            AkSoundEngine.GetRTPCValue("TimeFreezeL", gameObject, 1, out GD, ref valueTypeGlitch);

            float gdConverted = map(GD, -48f, 0f, 0f, 1f);

            _scanLineJitter  = gdConverted;
            _verticalJump    = gdConverted;
            _horizontalShake = gdConverted;
            _colorDrift      = gdConverted;
        }
Пример #11
0
    void FixedUpdate()
    {
        GetMicrophoneSamples();

        if (IsPlaying)
        {
            int RTPCValue = (int)AkQueryRTPCValue.RTPCValue_GameObject;
            AkSoundEngine.GetRTPCValue((uint)MicrophoneLevelRTPC.Id, gameObject, m_PlayingID, out currentMicLevel, ref RTPCValue);
            if (IsAboveThreshold)
            {
                OnMicrophoneAction.Invoke();
            }
        }
    }
Пример #12
0
        public float GetValue(UnityEngine.GameObject gameObject)
        {
            float value = 0;

            if (IsValid())
            {
                var akQueryValue = gameObject ? AkQueryRTPCValue.RTPCValue_GameObject : AkQueryRTPCValue.RTPCValue_Global;
                var queryValue   = (int)akQueryValue;
                var result       = AkSoundEngine.GetRTPCValue(Id, gameObject, AkSoundEngine.AK_INVALID_PLAYING_ID, out value, ref queryValue);
                Verify(result);
            }

            return(value);
        }
Пример #13
0
    void Update()
    {
        var query = (int)AkQueryRTPCValue.RTPCValue_GameObject;

        foreach (var e in SoundEvent)
        {
            AkSoundEngine.GetRTPCValue("RTPC_SpectrumData", gameObject, e.Id, out RtpcData, ref query);
        }

        // Used for demo.
        if (Input.GetKeyDown(KeyCode.Keypad1))
        {
            SoundEvent[0].Post(gameObject);
        }
    }
Пример #14
0
    // Update is called once per frame
    void Update()
    {
        int type = 2; //type 2 is a game object rtpc. type 1 is a global rtpc (for example a bus volume)



        //Set RTPCs from public variables

        //set on/off switches for different bands
        AkSoundEngine.SetRTPCValue("lowband_onoff", lowbandOnOff);
        AkSoundEngine.SetRTPCValue("midband_onoff", midbandOnOff);
        AkSoundEngine.SetRTPCValue("highband_onoff", highbandOnOff);
        AkSoundEngine.SetRTPCValue("vhighband_onoff", vhighbandOnOff);
        AkSoundEngine.SetRTPCValue("drysignal_onoff", drySignalOnOff);

        //set gain for different bands
        AkSoundEngine.SetRTPCValue("lowband_gain", lowbandGain);
        AkSoundEngine.SetRTPCValue("midband_gain", midbandGain);
        AkSoundEngine.SetRTPCValue("highband_gain", highbandGain);
        AkSoundEngine.SetRTPCValue("vhighband_gain", vhighbandGain);

        //get RTPC output

        //get lowband volume in db
        AkSoundEngine.GetRTPCValue(rtpcName_lowbandVolumedb, RTPCgameObject, 0, out lb_volume_db, ref type);
        //get lowband volume in rms
        //  AkSoundEngine.GetRTPCValue(rtpcName_lowbandVolumerms, RTPCgameObject, 0, out lb_volume_rms, ref type);

        //get midband volume in db
        AkSoundEngine.GetRTPCValue(rtpcName_midbandVolumedb, RTPCgameObject, 0, out mb_volume_db, ref type);
        //get midband volume in rms
        //  AkSoundEngine.GetRTPCValue(rtpcName_midbandVolumerms, RTPCgameObject, 0, out mb_volume_rms, ref type);

        //get highband volume in db
        AkSoundEngine.GetRTPCValue(rtpcName_lowbandVolumedb, RTPCgameObject, 0, out hb_volume_db, ref type);
        //get highband volume in rms
        //  AkSoundEngine.GetRTPCValue(rtpcName_highbandVolumerms, RTPCgameObject, 0, out hb_volume_rms, ref type);

        //get very highband volume in db
        AkSoundEngine.GetRTPCValue(rtpcName_vhighbandVolumedb, RTPCgameObject, 0, out vhb_volume_db, ref type);
        //get very highband volume in rms
        //  AkSoundEngine.GetRTPCValue(rtpcName_vhighbandVolumerms, RTPCgameObject, 0, out vhb_volume_rms, ref type);

        // Debug.Log(lb_volume_db);
    }
Пример #15
0
    void Update()
    {
        if (!RTPC.IsValid())
        {
            return;
        }

        var akQueryRTPCValue = UseGlobalRTPC || ReferenceGameObject == null ? AkQueryRTPCValue.RTPCValue_Global : AkQueryRTPCValue.RTPCValue_GameObject;
        int queryValue       = (int)akQueryRTPCValue;

        float value = 0;

        if (AKRESULT.AK_Success == AkSoundEngine.GetRTPCValue((uint)RTPC.ID, ReferenceGameObject, AkSoundEngine.AK_INVALID_PLAYING_ID, out value, ref queryValue))
        {
            _axisValue.targetValue = value;
        }

        _valueEvent.Invoke(_axisValue.Step());
    }
Пример #16
0
    IEnumerator FadeToNewSpeed(float targetRTPC)
    {
        float outrtpc;
        int   reftype = 1;

        AkSoundEngine.GetRTPCValue("PlaybackSpeedRTPC", null, 0, out outrtpc, ref reftype);
        //Debug.Log(outrtpc);
        float currentRTPC = outrtpc;

        //Debug.Log("Beginning Speed change now.");

        for (int i = 0; i <= 10; i++)
        {
            currentRTPC = Mathf.Lerp(outrtpc, targetRTPC, i / 10);
            AkSoundEngine.SetRTPCValue("PlaybackSpeedRTPC", currentRTPC);
            yield return(new WaitForSeconds(changeSpeedFrameLength));
        }
        //Debug.Log("Finished shifting to RTPC Value: " + currentRTPC);
    }
Пример #17
0
    // Update is called once per frame
    void Update()
    {
        // RTPCValue_type.RTPCValue_Global
        // for whatever reason, this constant isn't exposed by name by WWise C#/Unity headers
        int type = 1;

        // will contain the value of the RTPC parameter after the GetRTPCValue call
        float value;

        // retrieves current value of the RTPC parameter and stores it in 'value'
        AkSoundEngine.GetRTPCValue("Modulation", gameObject, 0, out value, ref type);

        // Scaling the value down and smoothing the value a little for visual representation
        value = scaleMultiplier * (value + 48) / 48;
        value = Mathf.Round(value * 1000f) / 1000f;

        // Setting the scale ~
        transform.localScale = Vector3.Lerp(transform.localScale, new Vector3(value, value, value), (Time.deltaTime * smoothingMultiplier));
    }
Пример #18
0
        void Update()
        {
            /*
             * if (sampleCount < 1) return;
             *
             * var rms = Mathf.Min(1.0f, Mathf.Sqrt(squareSum / sampleCount));
             * dbLevel = 20.0f * Mathf.Log10(rms / refLevel + zeroOffset);
             *
             * squareSum = 0;
             * sampleCount = 0;
             */

            int   type = 1;
            float value;

            AkSoundEngine.GetRTPCValue(rtpcID, gameObject, 0, out value, ref type);

            dbLevel = value;
            Debug.Log("We read the dbLevel to be: " + value);
        }
Пример #19
0
    // Updates meterValue using RTPC value from Wwise
    void updateMeter()
    {
        int type = 1;

        AkSoundEngine.GetRTPCValue("meter", obj, playingID, out meterValue, ref type);
    }
Пример #20
0
    public void UpdateRTPCValue(int index)
    {
        int type = 1;

        AkSoundEngine.GetRTPCValue(listInstru[index].rtpcId.Id, gameObject, 0, out listInstru[index].rtpcValue, ref type);
    }