|
@@ -10,33 +10,29 @@ public class ModelItem
|
|
|
|
|
|
Video,
|
|
|
|
|
|
- ABModel
|
|
|
+ ABModel,
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
- public UserSceneItem sceneItem;
|
|
|
-
|
|
|
-
|
|
|
- public string id;
|
|
|
+ Text
|
|
|
|
|
|
-
|
|
|
- public string name;
|
|
|
+ }
|
|
|
+
|
|
|
+ public GameObject modelList;
|
|
|
|
|
|
private GameObject _model;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public GameObject Model
|
|
|
{
|
|
|
get {
|
|
|
if(_model==null)
|
|
|
{
|
|
|
_model = new GameObject(name);
|
|
|
- _model.transform.parent = sceneItem.SceneModel.transform;
|
|
|
+ _model.transform.parent = modelList.transform;
|
|
|
_model.transform.localPosition = getInfoPos();
|
|
|
_model.transform.localEulerAngles = getInfoEul();
|
|
|
LoadManager.Instance.load(this, (float f)=> {
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
},(GameObject obj)=> {
|
|
@@ -54,25 +50,95 @@ public class ModelItem
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public string url;
|
|
|
|
|
|
-
|
|
|
- public ModelType type;
|
|
|
+
|
|
|
+ public ModelType modelType;
|
|
|
|
|
|
-
|
|
|
- public string info;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- public string Version;
|
|
|
+
|
|
|
+ public string Version { get; set; }
|
|
|
|
|
|
Vector3 getInfoPos()
|
|
|
{
|
|
|
- return Vector3.zero;
|
|
|
+
|
|
|
+ if (objectTransform.nowPos == Vector3.zero)
|
|
|
+ return objectTransform.startPos;
|
|
|
+ else
|
|
|
+ return objectTransform.nowPos;
|
|
|
}
|
|
|
Vector3 getInfoEul()
|
|
|
{
|
|
|
- return Vector3.zero;
|
|
|
+ if (objectTransform.nowRot == Vector3.zero)
|
|
|
+ return objectTransform.startRot;
|
|
|
+ else
|
|
|
+ return objectTransform.nowRot;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Vector3 getInfoScale()
|
|
|
+ {
|
|
|
+ if (objectTransform.nowScale == Vector3.zero)
|
|
|
+ return objectTransform.startScale;
|
|
|
+ else
|
|
|
+ return objectTransform.nowScale;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public string uid { get; set; }
|
|
|
+
|
|
|
+
|
|
|
+ public string name { get; set; }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public int type { get; set; }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public string textContent { get; set; }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public string DownloadPath { get; set; }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public string localSavePath { get; set; }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public ObjectTransform objectTransform { get; set; }
|
|
|
+
|
|
|
+
|
|
|
+ public void init(GameObject modelList)
|
|
|
+ {
|
|
|
+ switch (type)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ modelType = ModelType.Image;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ modelType = ModelType.Video;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ modelType = ModelType.ABModel;
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ modelType = ModelType.Text;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ Debug.LogError(name + " 绱犳潗缁撴瀯绫诲瀷寮傚父锛侊紒锛�");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ url = DownloadPath;
|
|
|
+ this.modelList = modelList;
|
|
|
+ if (Model != null)
|
|
|
+ Debug.Log(" 娣诲姞妯″瀷 " + name);
|
|
|
}
|
|
|
|
|
|
}
|