fixed bug in 3d model data keeping
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user