Audiokinetic의 커뮤니티 Q&A는 사용자가 Wwise와 Strata 커뮤니티 내에서 서로 질문과 답변을 하는 포럼입니다. Audiokinetic의 기술 지원팀에게 문의하고 싶으신 경우 지원 티켓 페이지를 사용해주세요.

Using key input to call wwise events in unity

0 투표
I am able to call an event i created which changes a RTPC value, but only when i attach this event to a game object. I cant figure out how to call, activate, this event  with key input.

Any ideas what i need to declare or set? Im not familiar with the AK. api.

Thanks in advance.
문의 2016 11월 6 General Discussion ian s. (100 포인트) 로 부터

1 답변

0 투표

You need some scripts, No No NO don't run, take it easy.

Create a new script, attach it to an empty gameobject 

Imagine this gameobject is your keys input manager. 

Script:

using UnityEngine;             // mandatory
using System.Collections;  // mandatory... i think

public class test : MonoBehaviour {        // NAME OF THE CLASS MUST BE THE SAME AS THE FILENAME; Here; test.cs

    void Update () {                     // Called each frame
        float rtpcValueToSend = 22;     // set the rtpc as you which, value is declared as a float, no need to write 22f
        if (Input.GetKey ("up")) {        // will execute the next commands in {} if the up key is pressed
            AkSoundEngine.SetRTPCValue ("nameofyourrtpc", rtpcValueToSend); // send rtpc to wwise
        }
    }
}

 

 You should look at AkSoundEngine class, most functions are called with this class,

for example, AksoundEngine.PostEvent("play_Footstep, gameObject) 

답변 2016 11월 15 olivier h. (290 포인트) 로 부터
수정 2016 11월 16 olivier h. 로 부터
...