void InitAndStartNewVoiceInfo(LogicVoiceInfo _voiceInfo) { LogicVoiceInfo vi = _voiceInfo; step = LogVoiceCollectionStep.waitingForFinishingVoiceStartDelay; curIndex = GetVoiceInfoIndex(vi); curVoiceStartDelayTime = voiceInfos[curIndex].startDelay; shouldStopCurVoiceAfterItsFinishing = false; }
int GetVoiceInfoIndex(LogicVoiceInfo _voiceInfo) { LogicVoiceInfo vi = _voiceInfo; for (int i = 0; i < voiceInfos.Length; i++) { if (voiceInfos[i] == vi) { return(i); } } Debug.LogError(vi + " not found in logVoiceInfos list!"); return(-1); }