protected void ExecuteOnceInNormalizedTime(int index, Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { AnimStateComponent component = componentList[index]; if (!_hasExecuted[index]) { if (_currentTime >= component.normalizedStart) { component.ComponentEnter(animator, stateInfo, layerIndex); component.ComponentUpdate(animator, stateInfo, layerIndex); component.ComponentExit(animator, stateInfo, layerIndex); _hasExecuted[index] = true; } } }
protected void UpdateInNormalizedRange(int index, Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { AnimStateComponent component = componentList[index]; if (!_islooping[index] && _currentTime >= component.normalizedStart && _currentTime <= component.normalizedEnd) { component.ComponentEnter(animator, stateInfo, layerIndex); _islooping[index] = true; } else if (_islooping[index] && _currentTime >= component.normalizedEnd) { component.ComponentExit(animator, stateInfo, layerIndex); _islooping[index] = false; } else if (_currentTime >= component.normalizedStart && _currentTime <= component.normalizedEnd) { component.ComponentUpdate(animator, stateInfo, layerIndex); } }