fixed bug in 3d model data keeping

This commit is contained in:
2018-09-27 15:45:21 +02:00
parent 9fa6309212
commit 43ced99445

View File

@@ -27,14 +27,20 @@ namespace RothenburgAR.PointOfInterest
return null;
if (_modelPrefab != null)
return _modelPrefab;
return _modelPrefab = new PoiModelLoader().LoadModel(ModelDescription);
_modelPrefab = new PoiModelLoader().LoadModel(ModelDescription);
_modelPrefab.SetActive(false);
return _modelPrefab;
}
public GameObject InstantiateModelPrefab()
{
if (!HasModelDescription)
return null;
var gameObject = GetModelPrefab();
var modelPrefab = GetModelPrefab();
var gameObject = UnityEngine.Object.Instantiate(modelPrefab);
gameObject.SetActive(true);
gameObject.transform.localRotation = Quaternion.identity;
gameObject.transform.localScale = ModelDescription.Scale;