Я не совсем уверен, почему это происходит, но, по сути, у меня есть коратика, которая работает и доходно, чтобы дождаться определенного количества времени. Я запустил это с отладчиком, чтобы увидеть, что происходит, потому что я заметил, что он никогда не заканчивается. Я прошел через и иногда он называет то, что выглядит как функции рендеринга. Но в последний раз он работает, он проходит через эти, и вешает самое последнее: < /p>
DeformationManagerupdater:
void LateUpdate()
{
if (DeformationManager.instance.helperGameObject != gameObject)
{
GameObject.DestroyImmediate(gameObject);
return;
}
m_ProfilerMarker.Begin();
DeformationManager.instance.Update();
m_ProfilerMarker.End();
}
< /code>
BoneGizmo:
void OnSceneGUI(SceneView sceneView)
{
boneGizmoController.OnGUI();
}
< /code>
and lastly NativeInputRuntime запускает 3 функции,
onShouldRunUpdate запускает эту строку:
NativeInputSystem.onShouldRunUpdate = updateType => value((InputUpdateType)updateType);
< /code>
onBeforeUpdate запускает это:
NativeInputSystem.onBeforeUpdate = updateType => value((InputUpdateType)updateType);
< /code>
and then it runs the OnFucusChanged Метод:
private void OnFocusChanged(bool focus)
{
m_FocusChangedMethod(focus);
}
< /code>
It's that last one that seems to hang indefinitely. It looks to be related to the input system, I had originally set my input to both but I changed it to the new to see if that would help but it hasn't beyond changing from hanging on the OnBeforeUpdate функция вместо. Любые идеи относительно того, почему это может происходить?IEnumerator CreateEdge()
{
for (int x = 0; x < tileGrid.GetLength(0); x++)
{
for (int y = 0; y < tileGrid.GetLength(1); y++)
{
Debug.Log($"X Y ({x}, {y}) type: {tileGrid[x, y]}");
bool hasCreatedEdge = false;
if (tileGrid[x, y] == land)
{
if (x + 1 < tileGrid.GetLength(0) && tileGrid[x + 1, y] == empty)
{
tileGrid[x + 1, y] = edge;
map.SetTile(new Vector3Int(x + 1, y, 0), _tileDict[edge]);
hasCreatedEdge = true;
}
if (x - 1 > tileGrid.GetLength(0) && tileGrid[x - 1, y] == empty)
{
tileGrid[x - 1, y] = edge;
map.SetTile(new Vector3Int(x - 1, y, 0), _tileDict[edge]);
hasCreatedEdge = true;
}
if (y + 1 < tileGrid.GetLength(1) && tileGrid[x, y + 1] == empty)
{
tileGrid[x, y + 1] = edge;
map.SetTile(new Vector3Int(x, y + 1, 0), _tileDict[edge]);
hasCreatedEdge = true;
}
if (y - 1 > tileGrid.GetLength(1) && tileGrid[x, y - 1] == empty)
{
tileGrid[x, y - 1] = edge;
map.SetTile(new Vector3Int(x, y - 1, 0), _tileDict[edge]);
hasCreatedEdge = true;
}
}
if (hasCreatedEdge)
{
yield return new WaitForSeconds(waitTime);
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... gets-stuck
Скрипт Unity случайным образом называет NativeInputRuntime и застрял ⇐ C#
Место общения программистов C#
1756929334
Anonymous
Я не совсем уверен, почему это происходит, но, по сути, у меня есть коратика, которая работает и доходно, чтобы дождаться определенного количества времени. Я запустил это с отладчиком, чтобы увидеть, что происходит, потому что я заметил, что он никогда не заканчивается. Я прошел через и иногда он называет то, что выглядит как функции рендеринга. Но в последний раз он работает, он проходит через эти, и вешает самое последнее: < /p>
DeformationManagerupdater:
void LateUpdate()
{
if (DeformationManager.instance.helperGameObject != gameObject)
{
GameObject.DestroyImmediate(gameObject);
return;
}
m_ProfilerMarker.Begin();
DeformationManager.instance.Update();
m_ProfilerMarker.End();
}
< /code>
BoneGizmo:
void OnSceneGUI(SceneView sceneView)
{
boneGizmoController.OnGUI();
}
< /code>
and lastly NativeInputRuntime запускает 3 функции,
onShouldRunUpdate запускает эту строку:
NativeInputSystem.onShouldRunUpdate = updateType => value((InputUpdateType)updateType);
< /code>
onBeforeUpdate запускает это:
NativeInputSystem.onBeforeUpdate = updateType => value((InputUpdateType)updateType);
< /code>
and then it runs the OnFucusChanged Метод:
private void OnFocusChanged(bool focus)
{
m_FocusChangedMethod(focus);
}
< /code>
It's that last one that seems to hang indefinitely. It looks to be related to the input system, I had originally set my input to both but I changed it to the new to see if that would help but it hasn't beyond changing from hanging on the OnBeforeUpdate функция вместо. Любые идеи относительно того, почему это может происходить?IEnumerator CreateEdge()
{
for (int x = 0; x < tileGrid.GetLength(0); x++)
{
for (int y = 0; y < tileGrid.GetLength(1); y++)
{
Debug.Log($"X Y ({x}, {y}) type: {tileGrid[x, y]}");
bool hasCreatedEdge = false;
if (tileGrid[x, y] == land)
{
if (x + 1 < tileGrid.GetLength(0) && tileGrid[x + 1, y] == empty)
{
tileGrid[x + 1, y] = edge;
map.SetTile(new Vector3Int(x + 1, y, 0), _tileDict[edge]);
hasCreatedEdge = true;
}
if (x - 1 > tileGrid.GetLength(0) && tileGrid[x - 1, y] == empty)
{
tileGrid[x - 1, y] = edge;
map.SetTile(new Vector3Int(x - 1, y, 0), _tileDict[edge]);
hasCreatedEdge = true;
}
if (y + 1 < tileGrid.GetLength(1) && tileGrid[x, y + 1] == empty)
{
tileGrid[x, y + 1] = edge;
map.SetTile(new Vector3Int(x, y + 1, 0), _tileDict[edge]);
hasCreatedEdge = true;
}
if (y - 1 > tileGrid.GetLength(1) && tileGrid[x, y - 1] == empty)
{
tileGrid[x, y - 1] = edge;
map.SetTile(new Vector3Int(x, y - 1, 0), _tileDict[edge]);
hasCreatedEdge = true;
}
}
if (hasCreatedEdge)
{
yield return new WaitForSeconds(waitTime);
}
}
}
}
Подробнее здесь: [url]https://stackoverflow.com/questions/79754992/unity-script-randomly-calls-nativeinputruntime-and-gets-stuck[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия