added icons to signal a 3d object being loaded in the DetailsPanel

This commit is contained in:
2018-09-27 21:16:03 +02:00
parent 93006f880c
commit 6c96d5434d
7 changed files with 362 additions and 29 deletions

View File

@@ -41,27 +41,16 @@ namespace RothenburgAR.PointOfInterest
var loader = new OBJLoader(ModelDescription.ModelPath);
//TODO do this in new thread
ThreadStart start = new ThreadStart(loader.ParseObjFile);
Thread t = new Thread(start);
t.Start();
while (t.ThreadState != ThreadState.Stopped)
{
Debug.Log("loading model from subthread");
yield return null;
yield return new WaitForSecondsRealtime(.1f);
}
Debug.Log("loaded model from subthread");
//TODO wait for thread finish with yield return null
var model = loader.BuildUnityObjects();
if (!model)
{
Debug.LogError("Failed to load Model!");
}
model.SetActive(false);
_modelPrefab = model;
}

View File

@@ -15,6 +15,8 @@ namespace RothenburgAR.UI
public TextMeshProUGUI DetailsText;
public ScrollRect DetailsTextScrollRect;
public DetailsModelBehaviour DetailsModel;
public GameObject IconLoading;
public GameObject Icon3D;
private void Start()
{
@@ -55,17 +57,19 @@ namespace RothenburgAR.UI
if (!data.IsModelLoaded)
{
Debug.Log("Model not loaded, starting thread...");
StartCoroutine(data.LoadModel());
DetailsModel.gameObject.SetActive(true);
Icon3D.SetActive(true);
IconLoading.SetActive(true);
while (!data.IsModelLoaded)
{
// display loading icon or sth idk
Debug.Log("waiting for data to be loaded..");
yield return null;
}
IconLoading.transform.Rotate(new Vector3(0, 0, 1), -3f);
Debug.Log("exited while loop");
yield return new WaitForSecondsRealtime(.01f);
}
}
try
@@ -90,6 +94,8 @@ namespace RothenburgAR.UI
DetailsModel.CurrentModel = _currentDisplayedModelGo;
DetailsModel.gameObject.SetActive(true);
Icon3D.SetActive(false);
IconLoading.SetActive(false);
}
public void RemoveModel()
@@ -101,6 +107,8 @@ namespace RothenburgAR.UI
{
Destroy(_currentDisplayedModelGo);
_currentDisplayedModelGo = null;
Icon3D.SetActive(false);
IconLoading.SetActive(false);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,98 @@
fileFormatVersion: 2
guid: 5ebf3714321c5f74784cc76bbde2fb85
timeCreated: 1538072671
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 1
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,98 @@
fileFormatVersion: 2
guid: 1957047573239854895a9ba2a69c12c8
timeCreated: 1538072670
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 1
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant: