Null Guard. Unity C#. Код подругому переписываем. Привет, общаемся на русском. Задача:…
- User
Null Guard. Unity C#. Код подругому переписываем. Привет, общаемся на русском.
Задача: реализовать Null Guard из лапши if'ов.
Есть кусок код: public void PlayIdleCinemation() { AnimatorStateInfo stateInfo = cinemator.GetCurrentAnimatorStateInfo(0);
codeif (!cinemator.GetBool(isWalkHash)) { if (stateInfo.fullPathHash != idleStateHash) // Проверяем, не воспроизводится ли уже нужная анимация { if (cinemator != null) { //cinemator.Play(idleStateHash); cinemator.CrossFade(idleStateHash, 0f); // мгновенный переход cinemator.Update(0f); // принудительно обновить } } } } Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.