|
@@ -4,4 +4,64 @@ using UnityEngine;
|
|
|
|
|
|
public class ModelItem
|
|
|
{
|
|
|
+
|
|
|
+ public UserSceneItem sceneItem;
|
|
|
+
|
|
|
+
|
|
|
+ public string id;
|
|
|
+
|
|
|
+
|
|
|
+ public string name;
|
|
|
+
|
|
|
+ private GameObject _model;
|
|
|
+
|
|
|
+
|
|
|
+ public GameObject Model
|
|
|
+ {
|
|
|
+ get {
|
|
|
+ if(_model==null)
|
|
|
+ {
|
|
|
+ _model = new GameObject(name);
|
|
|
+ _model.transform.parent = sceneItem.SceneModel.transform;
|
|
|
+ _model.transform.localPosition = getInfoPos();
|
|
|
+ _model.transform.localEulerAngles = getInfoEul();
|
|
|
+
|
|
|
+ LoadManager.Instance.load(url, Version, (float f)=> {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },(GameObject obj)=> {
|
|
|
+
|
|
|
+
|
|
|
+ obj.transform.transform.parent = _model.transform;
|
|
|
+
|
|
|
+ obj.transform.localPosition = Vector3.zero;
|
|
|
+ obj.transform.localEulerAngles = Vector3.zero;
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return _model; }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public string url;
|
|
|
+
|
|
|
+
|
|
|
+ public string type;
|
|
|
+
|
|
|
+
|
|
|
+ public string info;
|
|
|
+
|
|
|
+
|
|
|
+ public string Version;
|
|
|
+
|
|
|
+ Vector3 getInfoPos()
|
|
|
+ {
|
|
|
+ return Vector3.zero;
|
|
|
+ }
|
|
|
+ Vector3 getInfoEul()
|
|
|
+ {
|
|
|
+ return Vector3.zero;
|
|
|
+ }
|
|
|
}
|