Скрипт Unity случайным образом называет NativeInputRuntime и застрялC#

Место общения программистов C#
Ответить
Anonymous
 Скрипт Unity случайным образом называет NativeInputRuntime и застрял

Сообщение 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);
}
}
}
}


Подробнее здесь: https://stackoverflow.com/questions/797 ... gets-stuck
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»