本文整理汇总了C#中FMOD.Studio.EventInstance类的典型用法代码示例。如果您正苦于以下问题:C# EventInstance类的具体用法?C# EventInstance怎么用?C# EventInstance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventInstance类属于FMOD.Studio命名空间,在下文中一共展示了EventInstance类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
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();
}
示例2: Start
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;
}
示例3: InitMusic
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);
}
示例4: Update
// 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();
}
}
示例5: Awake
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());
}
示例6: OnMouseDown
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;
}
}
示例7: Start
// 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);
}
示例8: Start
void Start()
{
vol = FMODUnity.RuntimeManager.CreateInstance(musica1);
vol.setVolume(PlayerPrefs.GetFloat("VolumeFX"));
vol.start();
}
示例9: Update
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;
}
}
示例10: OnTriggerEnter
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);
}
}
}
示例11: Start
void Start()
{
StartCoroutine("GO");
volInicio = FMODUnity.RuntimeManager.CreateInstance(parede);
volInicio.setVolume(PlayerPrefs.GetFloat("VolumeFX"));
volInicio.start();
}
示例12: Start
void Start()
{
StartCoroutine("GO");
tiroInstance = FMODUnity.RuntimeManager.CreateInstance(tiro);
tiroInstance.setVolume(PlayerPrefs.GetFloat("VolumeFX"));
tiroInstance.start();
}
示例13: 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!!!");
//-----------------------------
}
示例14: Start
// 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);
}
示例15: 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();
}