|
@@ -223,14 +223,18 @@ public class ModelItem : System.ICloneable
|
|
|
|
|
|
return clonedObject;
|
|
|
}
|
|
|
- public void SetData(byte[] data)
|
|
|
+ public byte[] abByte;
|
|
|
+ public static bool isLoad;
|
|
|
+ public static Queue<ModelItem> loadAB = new Queue<ModelItem>();
|
|
|
+ public void SetData(byte[] data, DownLoadMaterial dm)
|
|
|
{
|
|
|
if(data ==null && modelType!= ModelType.Video)
|
|
|
{
|
|
|
Debug.LogError(name + " 未下载完成 !!!!!");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ Debug.Log("HJJTEST ModelType " + modelType);
|
|
|
switch (modelType)
|
|
|
{
|
|
|
case ModelType.Image:
|
|
@@ -258,9 +262,13 @@ public class ModelItem : System.ICloneable
|
|
|
prefabModel.GetComponent<TemplateVideo>().SetData(Application.persistentDataPath+"/Material/"+Path.GetFileName(DownloadPath));
|
|
|
break;
|
|
|
case ModelType.ABModel:
|
|
|
+ prefabModel.GetComponent<TemplateModel>().Data = dm;
|
|
|
+ abByte = data;
|
|
|
+ loadAB.Enqueue(this);
|
|
|
+
|
|
|
AssetBundle assetBundle = AssetBundle.LoadFromMemory(data);
|
|
|
Debug.Log(data.Length);
|
|
|
- prefabModel.GetComponent<TemplateModel>().LoadModel(assetBundle);
|
|
|
+ prefabModel.GetComponent<TemplateModel>().LoadModel(assetBundle);*/
|
|
|
break;
|
|
|
case ModelType.Text:
|
|
|
Debug.Log("HJJTEST ModelType.Text " + DownloadPath);
|
|
@@ -294,7 +302,36 @@ public class ModelItem : System.ICloneable
|
|
|
{
|
|
|
case ModelType.Text:
|
|
|
prefabModel.GetComponent<TemplateText>().SetData(textContent, TextBJ);
|
|
|
- Debug.Log(" ddddddddddddddddddddd"+prefabModel.name);
|
|
|
+
|
|
|
+ if (textPosition == "top")
|
|
|
+ {
|
|
|
+ if (objectTransform.nowPos == Vector3.zero && prefabModel.transform.localPosition!= new Vector3(0, 0.4f, 0))
|
|
|
+ {
|
|
|
+ prefabModel.transform.localPosition = new Vector3(0, 0.4f, 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (textPosition == "bottom")
|
|
|
+ {
|
|
|
+ if (objectTransform.nowPos == Vector3.zero && prefabModel.transform.localPosition != new Vector3(0, 0.4f, 0))
|
|
|
+ {
|
|
|
+ prefabModel.transform.localPosition = new Vector3(0, -0.4f, 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (textPosition == "left")
|
|
|
+ {
|
|
|
+ if (objectTransform.nowPos == Vector3.zero && prefabModel.transform.localPosition != new Vector3(0, 0.3f, 0))
|
|
|
+ {
|
|
|
+ prefabModel.transform.localPosition = new Vector3(-0.3f, 0, 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (textPosition == "right")
|
|
|
+ {
|
|
|
+ if (objectTransform.nowPos == Vector3.zero && prefabModel.transform.localPosition != new Vector3(0, 0.3f, 0))
|
|
|
+ {
|
|
|
+ prefabModel.transform.localPosition = new Vector3(0.3f, 0f, 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Debug.Log(" ddddddddddddddddddddd"+prefabModel.name+"_" + textPosition);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|