public void UpdateForPlayerTransform(Transform playerTransform) { if (!m_HeightWasInited) { m_HeightWasInited = true; m_InitialHeight = playerTransform.position.y - 2f; } Vector3 usedPosition = playerTransform.position; float heightDifference = m_InitialHeight - usedPosition.y; float heightSign = Mathf.Sign(heightDifference); heightDifference = Mathf.FloorToInt(Mathf.Abs(heightDifference / MinimapSystemSettings.heightStep)) * heightSign * heightDifference; usedPosition.y = m_InitialHeight + heightDifference; MinimapSystem.Render(m_RT, usedPosition, playerTransform.forward, MinimapSystemSettings); if (MinimapSystemSettings.isFixed) { Arrow.rotation = Quaternion.Euler(0, 0, Vector3.SignedAngle(playerTransform.forward, Vector3.forward, Vector3.up)); } else { Arrow.rotation = Quaternion.identity; } }
public void UpdateForPlayerTransform(Transform playerTransform) { MinimapSystem.Render(m_RT, playerTransform.position, playerTransform.forward, MinimapSystemSettings); if (MinimapSystemSettings.isFixed) { Arrow.rotation = Quaternion.Euler(0, 0, Vector3.SignedAngle(playerTransform.forward, Vector3.forward, Vector3.up)); } else { Arrow.rotation = Quaternion.identity; } }