fixed bug in 3d model data keeping
This commit is contained in:
@@ -27,14 +27,20 @@ namespace RothenburgAR.PointOfInterest
|
|||||||
return null;
|
return null;
|
||||||
if (_modelPrefab != null)
|
if (_modelPrefab != null)
|
||||||
return _modelPrefab;
|
return _modelPrefab;
|
||||||
return _modelPrefab = new PoiModelLoader().LoadModel(ModelDescription);
|
|
||||||
|
_modelPrefab = new PoiModelLoader().LoadModel(ModelDescription);
|
||||||
|
_modelPrefab.SetActive(false);
|
||||||
|
return _modelPrefab;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameObject InstantiateModelPrefab()
|
public GameObject InstantiateModelPrefab()
|
||||||
{
|
{
|
||||||
if (!HasModelDescription)
|
if (!HasModelDescription)
|
||||||
return null;
|
return null;
|
||||||
var gameObject = GetModelPrefab();
|
var modelPrefab = GetModelPrefab();
|
||||||
|
var gameObject = UnityEngine.Object.Instantiate(modelPrefab);
|
||||||
|
|
||||||
|
gameObject.SetActive(true);
|
||||||
gameObject.transform.localRotation = Quaternion.identity;
|
gameObject.transform.localRotation = Quaternion.identity;
|
||||||
gameObject.transform.localScale = ModelDescription.Scale;
|
gameObject.transform.localScale = ModelDescription.Scale;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user