public bool CheckValue() { if (source != null && source.CurrentStatus == FmodEventAudioSource.Status.Stopped) { source.Play(); } if (source != null && source.GetParameterValue("param01") == wantedValue) { if (eventDialog != null) { if (this.charactere == null) { return(true); } GameManager tmp = this.charactere.GetComponent <GameManager>(); if (tmp == null) { return(true); } tmp.SetDialog(eventDialog, true); eventDialog = null; } return(true); } return(false); }
private void UpdateValueObj(float val) { float value; if (obj == null) { return; } value = obj.GetParameterValue(paramSound); mIncr += Mathf.Abs(val); if (source != null && mIncr > 1) { source.Play(); mIncr = 0; } value += (val / 10); obj.SetParameterValue(paramSound, Mathf.Clamp(value, obj.GetParameterMinRange(paramSound), obj.GetParameterMaxRange(paramSound))); }
private void UpdateValueObj() { float value; if (obj == null) { return; } value = objSound.GetParameterValue(paramSound); value += incr; if (value > objSound.GetParameterMaxRange(paramSound) || value < objSound.GetParameterMinRange(paramSound)) { this.ActiveDialog(eventDialog[1], true); } else { objSound.SetParameterValue(paramSound, Mathf.Clamp(value, objSound.GetParameterMinRange(paramSound), objSound.GetParameterMaxRange(paramSound))); } }