GameManager.cs 70 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using QFramework;
  5. using UniRx;
  6. using QFramework.MREditor;
  7. using System;
  8. using Newtonsoft.Json;
  9. using UnityEngine.UI;
  10. using System.IO;
  11. using LitJson;
  12. using Newtonsoft.Json.Linq;
  13. public class GameManager : MonoSingleton<GameManager>
  14. {
  15. public bool isPointColud = false;
  16. public bool isEditor = true;
  17. // public ImageTargetManager targetManager;
  18. public Text text;
  19. public Text text2;
  20. public Text text3;
  21. // public Text text4;
  22. public GameObject editorPanel;
  23. // public UIMove uiMove;
  24. public List<GameObject> listEditorBJs;
  25. public GameObject showObjPos;
  26. private GameObject nowBJ;
  27. private ObjectTransform startObjTransform;
  28. /// <summary>
  29. /// 当前场景信息
  30. /// </summary>
  31. public SceneValue scene = null;
  32. /// <summary>
  33. /// 素材库素材信息
  34. /// </summary>
  35. public List<CompositeMaterialValue> listCMValue = null;
  36. /// <summary>
  37. /// ARCore 识别图
  38. /// </summary>
  39. public List<String> listImageTracked = new List<string>();
  40. public Dictionary<string, Sprite> dicImageTracked = new Dictionary<string, Sprite>();
  41. List<DownLoadMaterial> listDownLoad = new List<DownLoadMaterial>();
  42. public bool state = false;
  43. public bool finish = true; // ARCore 动态识别图加载完毕
  44. public GameObject uiMove;
  45. public GameObject Saloon;
  46. // Start is called before the first frame update
  47. void Start()
  48. {
  49. startObjTransform = new ObjectTransform();
  50. startObjTransform.startPos = Vector3.zero;
  51. startObjTransform.startRot = Vector3.zero;
  52. startObjTransform.startScale = Vector3.one;
  53. startObjTransform.nowPos = Vector3.zero;
  54. startObjTransform.nowRot = Vector3.zero;
  55. startObjTransform.nowScale = Vector3.zero;
  56. // scene = new SceneValue();
  57. // listCMValue = new List<CompositeMaterialValue>();
  58. // uiMove = editorPanel.GetComponent<UIMove>();
  59. // OpenPlanel();
  60. // PlayerPrefs.DeleteAll();
  61. state = false;
  62. finish = false;
  63. }
  64. // Update is called once per frame
  65. void Update()
  66. {
  67. // text.text = editorPanel.name;
  68. // text3.text = "1111 ";
  69. // editorPanel.Show();
  70. //if(isPointColud)
  71. // UIKit.GetPanel<EditorPanel>().SelectSpoitObj("模型景点");
  72. // Debug.Log(state);
  73. if(state && scene !=null && listCMValue!=null&& finish)
  74. {
  75. Debug.Log("素材下载结束 ARCore识别图加载完成 打开编辑界面");
  76. text3.text = "素材下载结束 ARCore识别图加载完成 打开编辑界面";
  77. finish = false;
  78. state = false;
  79. SandTable.Instance.OpenSandTable();
  80. LoadShow.Instance.ViewShow(false);
  81. // OpenPlanel();
  82. // LoginPanel.Instance.gameObject.SetActive(false);
  83. }
  84. }
  85. public void OpenPlanel()
  86. {
  87. // Debug.Log(listEditorBJs.Count + "@@@@@OpenPlanel");
  88. #region NewSceneData
  89. //MaterialObjValue obj1_1 = new MaterialObjValue();
  90. //obj1_1.Name = "SpaceStation";
  91. //obj1_1.TextBJ = "Null";
  92. //obj1_1.DownloadPath = "Resources/Model/SpaceStation";
  93. //obj1_1.DataTime = DateTime.Now.ToString();
  94. //obj1_1.Type = MaterialType.Model;
  95. //obj1_1.startPos = Vector3.zero;
  96. //obj1_1.startRot = Vector3.zero;
  97. //obj1_1.startScale = new Vector3(0.01f, 0.01f, 0.01f);
  98. //obj1_1.nowPos = Vector3.zero;
  99. //obj1_1.nowRot = Vector3.zero;
  100. //obj1_1.nowScale = Vector3.zero;
  101. //MaterialObjValue obj2_1 = new MaterialObjValue();
  102. //obj2_1.Name = "TestText1";
  103. //obj2_1.TextBJ = "BJ1";
  104. //obj2_1.DownloadPath = "/Text/TestText1.json";
  105. //obj2_1.DataTime = DateTime.Now.ToString();
  106. //obj2_1.Type = MaterialType.Text;
  107. //obj2_1.startPos = new Vector3(0, 0.075f, 0);
  108. //obj2_1.startRot = Vector3.zero;
  109. //obj2_1.startScale = Vector3.one;
  110. //obj2_1.nowPos = Vector3.zero;
  111. //obj2_1.nowRot = Vector3.zero;
  112. //obj2_1.nowScale = Vector3.zero;
  113. //MaterialObjValue obj2_2 = new MaterialObjValue();
  114. //obj2_2.Name = "TestImage1";
  115. //obj2_2.TextBJ = "Null";
  116. //obj2_2.DownloadPath = "Resources/Image/TestImage1";
  117. //obj2_2.DataTime = DateTime.Now.ToString();
  118. //obj2_2.Type = MaterialType.Image;
  119. //obj2_2.startPos = new Vector3(-0.085f, -0.075f, 0);
  120. //obj2_2.startRot = Vector3.zero;
  121. //obj2_2.startScale = Vector3.one;
  122. //obj2_2.nowPos = Vector3.zero;
  123. //obj2_2.nowRot = Vector3.zero;
  124. //obj2_2.nowScale = Vector3.zero;
  125. //MaterialObjValue obj2_3 = new MaterialObjValue();
  126. //obj2_3.Name = "TestImage2";
  127. //obj2_3.TextBJ = "Null";
  128. //obj2_3.DownloadPath = "Resources/Image/TestImage2";
  129. //obj2_3.DataTime = DateTime.Now.ToString();
  130. //obj2_3.Type = MaterialType.Image;
  131. //obj2_3.startPos = new Vector3(0.085f, -0.075f, 0);
  132. //obj2_3.startRot = Vector3.zero;
  133. //obj2_3.startScale = Vector3.one;
  134. //obj2_3.nowPos = Vector3.zero;
  135. //obj2_3.nowRot = Vector3.zero;
  136. //obj2_3.nowScale = Vector3.zero;
  137. //MaterialObjValue obj3_1 = new MaterialObjValue();
  138. //obj3_1.Name = "TestImage3";
  139. //obj3_1.TextBJ = "Null";
  140. //obj3_1.DownloadPath = "Resources/Image/TestImage3";
  141. //obj3_1.DataTime = DateTime.Now.ToString();
  142. //obj3_1.Type = MaterialType.Image;
  143. //obj3_1.startPos = new Vector3(-0.3f, 0, -0.15f);
  144. //obj3_1.startRot = new Vector3(0, -45, 0);
  145. //obj3_1.startScale = Vector3.one;
  146. //obj3_1.nowPos = Vector3.zero;
  147. //obj3_1.nowRot = Vector3.zero;
  148. //obj3_1.nowScale = Vector3.zero;
  149. //MaterialObjValue obj3_2 = new MaterialObjValue();
  150. //obj3_2.Name = "TestImage4";
  151. //obj3_2.TextBJ = "Null";
  152. //obj3_2.DownloadPath = "Resources/Image/TestImage4";
  153. //obj3_2.DataTime = DateTime.Now.ToString();
  154. //obj3_2.Type = MaterialType.Image;
  155. //obj3_2.startPos = new Vector3(-0.17f, 0, -0.05f);
  156. //obj3_2.startRot = new Vector3(0, -30, 0);
  157. //obj3_2.startScale = Vector3.one;
  158. //obj3_2.nowPos = Vector3.zero;
  159. //obj3_2.nowRot = Vector3.zero;
  160. //obj3_2.nowScale = Vector3.zero;
  161. //MaterialObjValue obj3_3 = new MaterialObjValue();
  162. //obj3_3.Name = "Education";
  163. //obj3_3.TextBJ = "Null";
  164. //obj3_3.DownloadPath = Application.streamingAssetsPath + "/Video/Education.mp4";
  165. //obj3_3.DataTime = DateTime.Now.ToString();
  166. //obj3_3.Type = MaterialType.Video;
  167. //obj3_3.startPos = Vector3.zero;
  168. //obj3_3.startRot = Vector3.zero;
  169. //obj3_3.startScale = Vector3.one;
  170. //obj3_3.nowPos = Vector3.zero;
  171. //obj3_3.nowRot = Vector3.zero;
  172. //obj3_3.nowScale = Vector3.zero;
  173. //MaterialObjValue obj3_4 = new MaterialObjValue();
  174. //obj3_4.Name = "TestImage5";
  175. //obj3_4.TextBJ = "Null";
  176. //obj3_4.DownloadPath = "Resources/Image/TestImage5";
  177. //obj3_4.DataTime = DateTime.Now.ToString();
  178. //obj3_4.Type = MaterialType.Image;
  179. //obj3_4.startPos = new Vector3(0.17f, 0, -0.05f);
  180. //obj3_4.startRot = new Vector3(0, 30, 0);
  181. //obj3_4.startScale = Vector3.one;
  182. //obj3_4.nowPos = Vector3.zero;
  183. //obj3_4.nowRot = Vector3.zero;
  184. //obj3_4.nowScale = Vector3.zero;
  185. //MaterialObjValue obj3_5 = new MaterialObjValue();
  186. //obj3_5.Name = "TestImage6";
  187. //obj3_5.TextBJ = "Null";
  188. //obj3_5.DownloadPath = "Resources/Image/TestImage6";
  189. //obj3_5.DataTime = DateTime.Now.ToString();
  190. //obj3_5.Type = MaterialType.Image;
  191. //obj3_5.startPos = new Vector3(0.3f, 0, -0.15f);
  192. //obj3_5.startRot = new Vector3(0, 45, 0);
  193. //obj3_5.startScale = Vector3.one;
  194. //obj3_5.nowPos = Vector3.zero;
  195. //obj3_5.nowRot = Vector3.zero;
  196. //obj3_5.nowScale = Vector3.zero;
  197. //SpoitValue spoit1 = new SpoitValue();
  198. //spoit1.Name = "模型景点";
  199. //spoit1.DataTime = DateTime.Now.ToString();
  200. //spoit1.Type = SpoitType.Null;
  201. //spoit1.startPos = new Vector3(0, 0, 0);
  202. //spoit1.startRot = Vector3.zero;
  203. //spoit1.startScale = Vector3.one;
  204. //spoit1.nowPos = Vector3.zero;
  205. //spoit1.nowRot = Vector3.zero;
  206. //spoit1.nowScale = Vector3.zero;
  207. //spoit1.listMaterial = new List<MaterialObjValue>();
  208. //spoit1.listMaterial.Add(obj1_1);
  209. //SpoitValue spoit2 = new SpoitValue();
  210. //spoit2.Name = "视频景点";
  211. //spoit2.DataTime = DateTime.Now.ToString();
  212. //spoit2.Type = SpoitType.Null;
  213. //spoit2.startPos = new Vector3(0, 0, 0);
  214. //spoit2.startRot = Vector3.zero;
  215. //spoit2.startScale = Vector3.one;
  216. //spoit2.nowPos = Vector3.zero;
  217. //spoit2.nowRot = Vector3.zero;
  218. //spoit2.nowScale = Vector3.zero;
  219. //spoit2.listMaterial = new List<MaterialObjValue>();
  220. //spoit2.listMaterial.Add(obj3_1);
  221. //spoit2.listMaterial.Add(obj3_2);
  222. //spoit2.listMaterial.Add(obj3_3);
  223. //spoit2.listMaterial.Add(obj3_4);
  224. //spoit2.listMaterial.Add(obj3_5);
  225. //SpoitValue spoit3 = new SpoitValue();
  226. //spoit3.Name = "图片文字";
  227. //spoit3.DataTime = DateTime.Now.ToString();
  228. //spoit3.Type = SpoitType.Null;
  229. //spoit3.startPos = new Vector3(0, 0, 0);
  230. //spoit3.startRot = Vector3.zero;
  231. //spoit3.startScale = Vector3.one;
  232. //spoit3.nowPos = Vector3.zero;
  233. //spoit3.nowRot = Vector3.zero;
  234. //spoit3.nowScale = Vector3.zero;
  235. //spoit3.listMaterial = new List<MaterialObjValue>();
  236. //spoit3.listMaterial.Add(obj2_1);
  237. //spoit3.listMaterial.Add(obj2_2);
  238. //spoit3.listMaterial.Add(obj2_3);
  239. //SceneValue scene = new SceneValue();
  240. //scene.username = "VuforialEditor";
  241. //scene.Type = SceneType.Vuforial;
  242. //scene.DataTime = DateTime.Now.ToString();
  243. //scene.UpdatePath = "";
  244. //scene.listSpoit = new List<SpoitValue>();
  245. //scene.listSpoit.Add(spoit1);
  246. //scene.listSpoit.Add(spoit2);
  247. //scene.listSpoit.Add(spoit3);
  248. #endregion
  249. #region LocalMaterial
  250. //List<MaterialObjValue> listMaterialData = new List<MaterialObjValue>();
  251. ObjectTransform startObjTransform = new ObjectTransform();
  252. startObjTransform.startPos = Vector3.zero;
  253. startObjTransform.startRot = Vector3.zero;
  254. startObjTransform.startScale = Vector3.one;
  255. startObjTransform.nowPos = Vector3.zero;
  256. startObjTransform.nowRot = Vector3.zero;
  257. startObjTransform.nowScale = Vector3.zero;
  258. //MaterialObjValue obj1 = new MaterialObjValue();
  259. //obj1.name = "空间站_1";
  260. //obj1.TextBJ = "-1";
  261. //obj1.textContent = null;
  262. //obj1.type = "3";
  263. //obj1.DownloadPath = "Resources/LocalMaterials/Model/SpaceStation";
  264. //obj1.DownloadPath = "Resources/LocalMaterials/Model/SpaceStation";
  265. //obj1.ObjectTransform = startObjTransform;
  266. //obj1.ObjectTransform.startScale = new Vector3(0.01f, 0.01f, 0.01f);
  267. //obj1.textPosition = null;
  268. //MaterialObjValue obj2 = new MaterialObjValue();
  269. //obj2.name = "LocalText1";
  270. //obj2.TextBJ = "2";
  271. //obj2.textContent = "This is Test ";
  272. //obj2.type = "4";
  273. //obj2.DownloadPath = null;
  274. //obj2.localSavePath = null;
  275. //obj2.ObjectTransform = startObjTransform;
  276. //obj2.textPosition = null;
  277. MaterialObjValue obj3 = new MaterialObjValue();
  278. obj3.name = "前进箭头";
  279. obj3.TextBJ = "-1";
  280. obj3.textContent = null;
  281. obj3.type = "1";
  282. obj3.DownloadPath = "Resources/LocalMaterials/Image/Dir_0";
  283. obj3.localSavePath = "Resources/LocalMaterials/Image/Dir_0";
  284. obj3.ObjectTransform = startObjTransform;
  285. obj3.textPosition = null;
  286. MaterialObjValue obj4 = new MaterialObjValue();
  287. obj4.name = "右箭头";
  288. obj4.TextBJ = "-1";
  289. obj4.textContent = null;
  290. obj4.type = "1";
  291. obj4.DownloadPath = "Resources/LocalMaterials/Image/Dir_1";
  292. obj4.localSavePath = "Resources/LocalMaterials/Image/Dir_1";
  293. obj4.ObjectTransform = startObjTransform;
  294. obj4.textPosition = null;
  295. MaterialObjValue obj5 = new MaterialObjValue();
  296. obj5.name = "左箭头";
  297. obj5.TextBJ = "-1";
  298. obj5.textContent = null;
  299. obj5.type = "1";
  300. obj5.DownloadPath = "Resources/LocalMaterials/Image/Dir_2";
  301. obj5.localSavePath = "Resources/LocalMaterials/Image/Dir_2";
  302. obj5.ObjectTransform = startObjTransform;
  303. obj5.textPosition = null;
  304. MaterialObjValue obj6 = new MaterialObjValue();
  305. obj6.name = "后转箭头";
  306. obj6.TextBJ = "-1";
  307. obj6.textContent = null;
  308. obj6.type = "1";
  309. obj6.DownloadPath = "Resources/LocalMaterials/Image/Dir_3";
  310. obj6.localSavePath = "Resources/LocalMaterials/Image/Dir_3";
  311. obj6.ObjectTransform = startObjTransform;
  312. MaterialObjValue obj7 = new MaterialObjValue();
  313. obj7.name = "右转箭头";
  314. obj7.TextBJ = "-1";
  315. obj7.textContent = null;
  316. obj7.type = "1";
  317. obj7.DownloadPath = "Resources/LocalMaterials/Image/Dir_4";
  318. obj7.localSavePath = "Resources/LocalMaterials/Image/Dir_4";
  319. obj7.ObjectTransform = startObjTransform;
  320. obj7.textPosition = null;
  321. MaterialObjValue obj8 = new MaterialObjValue();
  322. obj8.name = "左转箭头";
  323. obj8.TextBJ = "-1";
  324. obj8.textContent = null;
  325. obj8.type = "1";
  326. obj8.DownloadPath = "Resources/LocalMaterials/Image/Dir_5";
  327. obj8.localSavePath = "Resources/LocalMaterials/Image/Dir_5";
  328. obj8.ObjectTransform = startObjTransform;
  329. obj8.textPosition = null;
  330. //CompositeMaterialValue CMV1 = new CompositeMaterialValue();
  331. //CMV1.name = "空间站";
  332. //CMV1.type = 3;
  333. //CMV1.template = null;
  334. //CMV1.updateTime = GetTimeStamp();
  335. //CMV1.describe = "";
  336. //CMV1.icon = "Resources/LocalMaterials/Image/ModelIcon";
  337. //CMV1.objectTransform = startObjTransform;
  338. //CMV1.materialList = new List<MaterialObjValue>();
  339. //CMV1.materialList.Add(obj1);
  340. //CompositeMaterialValue CMV2 = new CompositeMaterialValue();
  341. //CMV2.name = "测试文本";
  342. //CMV2.type = 4;
  343. //CMV2.template = "2";
  344. //CMV2.updateTime = GetTimeStamp();
  345. //CMV2.describe = "";
  346. //CMV2.icon = "Resources/LocalMaterials/Image/ModelIcon";
  347. //CMV2.objectTransform = startObjTransform;
  348. //CMV2.materialList = new List<MaterialObjValue>();
  349. //CMV2.materialList.Add(obj2);
  350. CompositeMaterialValue CMV3 = new CompositeMaterialValue();
  351. CMV3.name = "前进箭头";
  352. CMV3.type = 1;
  353. CMV3.template = null;
  354. CMV3.updateTime = GetTimeStamp();
  355. CMV3.describe = "";
  356. CMV3.icon = "Resources/LocalMaterials/Image/Dir_0";
  357. CMV3.objectTransform = startObjTransform;
  358. CMV3.materialList = new List<MaterialObjValue>();
  359. CMV3.materialList.Add(obj3);
  360. CompositeMaterialValue CMV4 = new CompositeMaterialValue();
  361. CMV4.name = "右箭头";
  362. CMV4.type = 1;
  363. CMV4.template = null;
  364. CMV4.updateTime = GetTimeStamp();
  365. CMV4.describe = "";
  366. CMV4.icon = "Resources/LocalMaterials/Image/Dir_1";
  367. CMV4.objectTransform = startObjTransform;
  368. CMV4.materialList = new List<MaterialObjValue>();
  369. CMV4.materialList.Add(obj4);
  370. CompositeMaterialValue CMV5 = new CompositeMaterialValue();
  371. CMV5.name = "左箭头";
  372. CMV5.type = 1;
  373. CMV5.template = null;
  374. CMV5.updateTime = GetTimeStamp();
  375. CMV5.describe = "";
  376. CMV5.icon = "Resources/LocalMaterials/Image/Dir_2";
  377. CMV5.objectTransform = startObjTransform;
  378. CMV5.materialList = new List<MaterialObjValue>();
  379. CMV5.materialList.Add(obj5);
  380. CompositeMaterialValue CMV6 = new CompositeMaterialValue();
  381. CMV6.name = "后转箭头";
  382. CMV6.type = 1;
  383. CMV6.template = null;
  384. CMV6.updateTime = GetTimeStamp();
  385. CMV6.describe = "";
  386. CMV6.icon = "Resources/LocalMaterials/Image/Dir_3";
  387. CMV6.objectTransform = startObjTransform;
  388. CMV6.materialList = new List<MaterialObjValue>();
  389. CMV6.materialList.Add(obj6);
  390. CompositeMaterialValue CMV7 = new CompositeMaterialValue();
  391. CMV7.name = "右转箭头";
  392. CMV7.type = 1;
  393. CMV7.template = null;
  394. CMV7.updateTime = GetTimeStamp();
  395. CMV7.describe = "";
  396. CMV7.icon = "Resources/LocalMaterials/Image/Dir_4";
  397. CMV7.objectTransform = startObjTransform;
  398. CMV7.materialList = new List<MaterialObjValue>();
  399. CMV7.materialList.Add(obj7);
  400. CompositeMaterialValue CMV8 = new CompositeMaterialValue();
  401. CMV8.name = "左转箭头";
  402. CMV8.type = 1;
  403. CMV8.template = null;
  404. CMV8.updateTime = GetTimeStamp();
  405. CMV8.describe = "";
  406. CMV8.icon = "Resources/LocalMaterials/Image/Dir_5";
  407. CMV8.objectTransform = startObjTransform;
  408. CMV8.materialList = new List<MaterialObjValue>();
  409. CMV8.materialList.Add(obj8);
  410. List<CompositeMaterialValue> listLocalCMVs = new List<CompositeMaterialValue>();
  411. //listLocalCMVs.Add(CMV1);
  412. //listLocalCMVs.Add(CMV2);
  413. listLocalCMVs.Add(CMV3);
  414. listLocalCMVs.Add(CMV4);
  415. listLocalCMVs.Add(CMV5);
  416. listLocalCMVs.Add(CMV6);
  417. listLocalCMVs.Add(CMV7);
  418. listLocalCMVs.Add(CMV8);
  419. SpoitValue spoitValue = new SpoitValue();
  420. spoitValue.name = "景点1";
  421. spoitValue.spoitTf = startObjTransform;
  422. spoitValue.updateTime = GetTimeStamp();
  423. spoitValue.material = new List<CompositeMaterialValue>();
  424. // spoitValue.material.Add(CMV1);
  425. #endregion
  426. //string str = JsonConvert.SerializeObject(listLocalCMVs);
  427. //Debug.Log("%%%%%%%%%% " + str);
  428. //str = JsonMapper.ToJson(scene);
  429. //Debug.Log(str);
  430. //text2.text = str;
  431. //Save(scene);
  432. try
  433. {
  434. text.text = "Init";
  435. ResMgr.Init();
  436. ResKit.Init();
  437. Debug.Log(listCMValue.Count);
  438. // Debug.Log("@@@@ "+scene.listSpoit.Count);
  439. // VuforialControl.Instance.LoadARCamera();
  440. scene.listSpoit.ForEach(item =>
  441. {
  442. Debug.Log(item.name + " @@@@#### " + item.spoitTf.nowPos);
  443. // LoadSpoitObj(item.name, item);
  444. });
  445. UIKit.OpenPanel<EditorPanel>(new EditorPanelData() { SceneValue = scene, listLocalMaterials = listLocalCMVs, listUpLoadMaterials = listCMValue });
  446. // targetManager.enabled = true;
  447. uiMove.SetActive(true);
  448. }
  449. catch (Exception e)
  450. {
  451. text2.text = e.ToString();
  452. }
  453. }
  454. /// <summary>
  455. /// 更改当前所属模式
  456. /// </summary>
  457. /// <param name="state"></param>
  458. public void SetIsEditor(bool state)
  459. {
  460. //if (editorPanel == null)
  461. // return;
  462. isEditor = state;
  463. try
  464. {
  465. // editorPanel.SetActive(state);
  466. if (nowBJ.IsNotNull())
  467. nowBJ.SetActive(state);
  468. // VuforialControl.Instance.SetEditor(state);
  469. //editorPanel.SetActive(false);
  470. //editorPanel.SetActive(true);
  471. }
  472. catch (Exception e)
  473. {
  474. text2.text = "@@@@ " + state + e.Message;
  475. }
  476. }
  477. public void SetImageBJ(int i)
  478. {
  479. Debug.Log(i);
  480. if (nowBJ.IsNotNull())
  481. nowBJ.SetActive(false);
  482. nowBJ = listEditorBJs[i];
  483. nowBJ.SetActive(true);
  484. }
  485. public void Save(SceneValue scene)
  486. {
  487. List<SendEditorData> listSendData = new List<SendEditorData>();
  488. // 上传
  489. for (int i = 0; i < scene.listSpoit.Count; i++)
  490. {
  491. Debug.Log("a上传 " + scene.listSpoit[i].spoitTf.nowPos);
  492. // string spoittf = JsonMapper.ToJson(scene.listSpoit[i].spoitTf);
  493. SendEditorData data = new SendEditorData();
  494. data.material = scene.listSpoit[i].material;
  495. data.spoittf = scene.listSpoit[i].spoitTf;
  496. data.id = scene.listSpoit[i].id;
  497. // data.visitcout = 1;
  498. listSendData.Add(data);
  499. }
  500. try
  501. {
  502. // string sendData = JsonMapper.ToJson(listSendData);
  503. string sendData = JsonConvert.SerializeObject(listSendData);
  504. Debug.Log("b上传 " + sendData);
  505. text2.text = sendData;
  506. HttpTool.Instance.PostTest("/viewpoint/update", sendData, SaveCallBack);
  507. }
  508. catch (Exception e)
  509. {
  510. Debug.LogError(e);
  511. ErrorLogPanel.Instance.Show(" 上传失败 ");
  512. }
  513. // string str = JsonConvert.SerializeObject(scene);
  514. // PlayerPrefs.SetString("DataScene", str);
  515. }
  516. public void SaveCallBack(string message)
  517. {
  518. Debug.Log(message);
  519. JObject jObject = JObject.Parse(message);
  520. string str = jObject["message"].ToString();
  521. if (200 == int.Parse(jObject["code"].ToString()))
  522. {
  523. // HintLogPanel.Instance.Show(" 保存成功 ");
  524. HintLogPanel.Instance.Show(" 保存成功 ");
  525. }
  526. else
  527. {
  528. HintLogPanel.Instance.Show(" 保存失败 ");
  529. }
  530. GameManager.Instance.text2.text = "CallBack上传 " + str;
  531. }
  532. /// <summary>
  533. /// 初始化本地数据
  534. /// </summary>
  535. public void InitData()
  536. {
  537. PlayerPrefs.DeleteKey("DataScene");
  538. }
  539. /// <summary>
  540. /// 选择场景 //根据场景信息进行初始加载
  541. /// </summary>
  542. /// <param name="message"></param>
  543. public void SelectScene(string message)
  544. {
  545. }
  546. /// <summary>
  547. /// 处理后端SceneValue 数据
  548. /// </summary>
  549. /// <param name="scene"></param>
  550. /// <returns></returns>
  551. public SceneValue ProcesSceneValueJsonData(SceneValue scene)
  552. {
  553. List<CompositeMaterialValue> listCMV = new List<CompositeMaterialValue>();
  554. for (int i = 0; i < scene.listSpoit.Count; i++)
  555. {
  556. if (scene.listSpoit[i].spoitTf == null)
  557. scene.listSpoit[i].spoitTf = startObjTransform;
  558. if (scene.listSpoit[i].material == null)
  559. scene.listSpoit[i].material = new List<CompositeMaterialValue>();
  560. for (int j = 0; j < scene.listSpoit[i].material.Count; j++)
  561. {
  562. //Debug.Log(scene.listSpoit[i].material[j].type +" @@@@@@@@@");
  563. listCMV.Add(scene.listSpoit[i].material[j]);
  564. }
  565. }
  566. // 下载 Vuforia 识别图 和 xml 文件
  567. List<DownLoadMaterial> listVuforia = new List<DownLoadMaterial>();
  568. MaterialObjValue datFile = new MaterialObjValue();
  569. datFile.name = "datFile";
  570. datFile.type = "2";
  571. datFile.DownloadPath = scene.vuforiaDat;
  572. datFile.localSavePath = Application.persistentDataPath + "/StreamingAssets/Vuforia/" + Path.GetFileName(scene.vuforiaDat);
  573. MaterialObjValue xmlFile = new MaterialObjValue();
  574. xmlFile.name = "xmlFile";
  575. xmlFile.type = "2";
  576. xmlFile.DownloadPath = scene.vuforiaXML;
  577. string str = Path.GetFileName(scene.vuforiaXML);
  578. if (str.IsNotNullAndEmpty())
  579. {
  580. str = str.Substring(0, str.Length - 4);
  581. Debug.Log("VuforialName " + str);
  582. AppConfigConst.IMAGE_TARGET_FILE_NAME = str;
  583. }
  584. xmlFile.localSavePath = Application.persistentDataPath + "/StreamingAssets/Vuforia/" + Path.GetFileName(scene.vuforiaXML);
  585. MaterialObjValue sandTableModel = new MaterialObjValue();
  586. sandTableModel.name = "sandTableMoel";
  587. sandTableModel.type = "3";
  588. sandTableModel.DownloadPath = scene.sandTable;
  589. sandTableModel.localSavePath = Application.persistentDataPath + "/StreamingAssets/Vuforia/" + Path.GetFileName(scene.sandTable);
  590. if (sandTableModel.DownloadPath.IsNotNullAndEmpty())
  591. {
  592. SandTable.Instance.value = sandTableModel;
  593. SandTable.Instance.updateTime = scene.updateTime;
  594. }
  595. else
  596. {
  597. SandTable.Instance.value = null;
  598. SandTable.Instance.updateTime = 0;
  599. }
  600. listDownLoad.Insert(0, new DownLoadMaterial(datFile, scene.updateTime));
  601. listDownLoad.Insert(1, new DownLoadMaterial(xmlFile, scene.updateTime));
  602. listDownLoad.Insert(2, new DownLoadMaterial(sandTableModel, scene.updateTime));
  603. List<DownLoadMaterial> listDownload2 = new List<DownLoadMaterial>();
  604. for (int i = 0; i < scene.listSpoit.Count; i++)
  605. {
  606. scene.listSpoit[i].localTriggerImage = Application.persistentDataPath + "/ImageTracked/" + Path.GetFileName(scene.listSpoit[i].triggerImage);
  607. Debug.Log(scene.listSpoit[i].triggerImage);
  608. Debug.Log(scene.listSpoit[i].localTriggerImage);
  609. MaterialObjValue imageTracked = new MaterialObjValue();
  610. imageTracked.name = scene.listSpoit[i].name;
  611. imageTracked.type = "1";
  612. imageTracked.DownloadPath = scene.listSpoit[i].triggerImage;
  613. imageTracked.localSavePath = scene.listSpoit[i].localTriggerImage;
  614. listDownLoad.Add(new DownLoadMaterial(imageTracked, scene.listSpoit[i].updateTime));
  615. }
  616. SettingImageTarked( scene );
  617. //Debug.Log(listDownload2.Count);
  618. //for (int i = 0; i < listDownload2.Count; i++)
  619. //{
  620. // Debug.Log(listDownload2[i].mObj.localSavePath);
  621. //}
  622. List<CompositeMaterialValue> listProcessCMV = ProcessCMVJsonData(listCMV, false );
  623. if(listDownLoad.Count>2)
  624. {
  625. GameManager.Instance.text3.text = " 准备下载素材 " + listDownLoad.Count;
  626. // LoginPanel.Instance.gameObject.SetActive(false);
  627. LoadManager.Instance.InitLoad(listDownLoad);
  628. }
  629. //for (int i = 0; i < listProcessCMV.Count; i++)
  630. //{
  631. // Debug.Log("######### "+listProcessCMV[i].name);
  632. //}
  633. int num = 0;
  634. for (int i = 0; i < scene.listSpoit.Count; i++)
  635. {
  636. for (int j = 0; j < scene.listSpoit[i].material.Count; j++)
  637. {
  638. scene.listSpoit[i].material[j] = listProcessCMV[num++];
  639. // Debug.Log("!!!!!!!"+scene.listSpoit[i].material[j].name);
  640. }
  641. }
  642. return scene;
  643. }
  644. /// <summary>
  645. /// 处理上传素材数据
  646. /// </summary>
  647. /// <param name="listCMV"></param>
  648. /// <returns></returns>
  649. public List<CompositeMaterialValue> ProcessCMVJsonData(List<CompositeMaterialValue> listCMV, bool finish)
  650. {
  651. bool state = false;
  652. if (listDownLoad.Count > 1)
  653. state = true;
  654. for (int i = 0; i < listCMV.Count; i++)
  655. {
  656. if (listCMV[i].objectTransform == null)
  657. SetObjectTransform(listCMV[i].objectTransform);
  658. // listCMV[i].objectTransform = startObjTransform;
  659. Debug.Log(listCMV[i].name);
  660. if (listCMV[i].materialList != null)
  661. for (int j = 0; j < listCMV[i].materialList.Count; j++)
  662. {
  663. // Debug.Log(listCMV[i].materialList[j].name + " " + listCMV[i].materialList[j].ObjectTransform.nowScale.x.ToString());
  664. if (listCMV[i].materialList[j].ObjectTransform == null)
  665. SetObjectTransform(listCMV[i].materialList[j].ObjectTransform);
  666. // listCMV[i].materialList[j].ObjectTransform = startObjTransform;
  667. if (listCMV[i].materialList[j].ObjectTransform.startScale != Vector3.one)
  668. listCMV[i].materialList[j].ObjectTransform.startScale = Vector3.one;
  669. // listCMV[i].materialList[j].ObjectTransform = startObjTransform;
  670. if (listCMV[i].icon != "")
  671. {
  672. MaterialObjValue mObj = new MaterialObjValue();
  673. mObj.name = listCMV[i].name;
  674. mObj.DownloadPath = listCMV[i].icon;
  675. mObj.type = "1";
  676. mObj.localSavePath = Application.persistentDataPath + "/Image/" + Path.GetFileName(listCMV[i].icon);
  677. DownLoadMaterial value = new DownLoadMaterial(mObj, listCMV[i].updateTime);
  678. if (finish)
  679. AddListDaownLoad(value);
  680. }
  681. if (listCMV[i].materialList[j].DownloadPath == listCMV[i].materialList[j].localSavePath&& listCMV[i].materialList[j].type!="4")
  682. continue;
  683. listCMV[i].materialList[j].name = listCMV[i].name + "_" + j.ToString();
  684. // Debug.Log(listCMV[i].materialList[j].name +" "+ listCMV[i].materialList[j].type);
  685. switch ((MaterialType)int.Parse(listCMV[i].materialList[j].type))
  686. {
  687. case MaterialType.NULL:
  688. break;
  689. case MaterialType.Image:
  690. listCMV[i].materialList[j].localSavePath = Application.persistentDataPath + "/Image/" + Path.GetFileName(listCMV[i].materialList[j].DownloadPath);
  691. if (finish)
  692. AddListDaownLoad(new DownLoadMaterial(listCMV[i].materialList[j], listCMV[i].updateTime));
  693. break;
  694. case MaterialType.Video:
  695. listCMV[i].materialList[j].localSavePath = Application.persistentDataPath + "/Video/" + Path.GetFileName(listCMV[i].materialList[j].DownloadPath);
  696. if (finish)
  697. AddListDaownLoad(new DownLoadMaterial(listCMV[i].materialList[j], listCMV[i].updateTime));
  698. break;
  699. case MaterialType.Model:
  700. listCMV[i].materialList[j].localSavePath = Application.persistentDataPath + "/Model/" + Path.GetFileName(listCMV[i].materialList[j].DownloadPath);
  701. if (finish)
  702. AddListDaownLoad(new DownLoadMaterial(listCMV[i].materialList[j], listCMV[i].updateTime));
  703. break;
  704. case MaterialType.Text:
  705. break;
  706. default:
  707. break;
  708. }
  709. }
  710. }
  711. if (finish && state)
  712. {
  713. GameManager.Instance.text3.text = " 准备下载素材 " + listDownLoad.Count;
  714. LoginPanel.Instance.gameObject.SetActive(false);
  715. LoadManager.Instance.InitLoad(listDownLoad);
  716. }
  717. for (int i = 0; i < listCMV.Count; i++)
  718. {
  719. switch (listCMV[i].typesetting)
  720. {
  721. case "1": // 平铺
  722. int num1 = listCMV[i].materialList.Count;
  723. for (int j = 0; j < listCMV[i].materialList.Count; j++)
  724. {
  725. if (listCMV[i].materialList[j].type == "4")
  726. num1--;
  727. }
  728. switch (num1)
  729. {
  730. case 2:
  731. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0, 0);
  732. listCMV[i].materialList[0].ObjectTransform.startRot = Vector3.zero;
  733. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  734. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0.5f, 0, 0);
  735. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  736. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  737. break;
  738. case 3:
  739. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0, 0);
  740. listCMV[i].materialList[0].ObjectTransform.startRot = Vector3.zero;
  741. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  742. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0, 0);
  743. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  744. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  745. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0, 0);
  746. listCMV[i].materialList[2].ObjectTransform.startRot = Vector3.zero;
  747. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  748. break;
  749. case 4:
  750. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-1f, 0, 0);
  751. listCMV[i].materialList[0].ObjectTransform.startRot = Vector3.zero;
  752. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  753. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(-0.5f, 0, 0);
  754. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  755. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  756. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0, 0);
  757. listCMV[i].materialList[2].ObjectTransform.startRot = Vector3.zero;
  758. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  759. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(1f, 0, 0);
  760. listCMV[i].materialList[3].ObjectTransform.startRot = Vector3.zero;
  761. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  762. break;
  763. case 5:
  764. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-1f, 0, 0);
  765. listCMV[i].materialList[0].ObjectTransform.startRot = Vector3.zero;
  766. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  767. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(-0.5f, 0, 0);
  768. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  769. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  770. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0, 0, 0);
  771. listCMV[i].materialList[2].ObjectTransform.startRot = Vector3.zero;
  772. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  773. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(0.5f, 0, 0);
  774. listCMV[i].materialList[3].ObjectTransform.startRot = Vector3.zero;
  775. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  776. listCMV[i].materialList[4].ObjectTransform.startPos = new Vector3(1f, 0, 0);
  777. listCMV[i].materialList[4].ObjectTransform.startRot = Vector3.zero;
  778. listCMV[i].materialList[4].ObjectTransform.startScale = Vector3.one;
  779. break;
  780. case 6:
  781. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-1.5f, 0, 0);
  782. listCMV[i].materialList[0].ObjectTransform.startRot = Vector3.zero;
  783. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  784. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(-1f, 0, 0);
  785. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  786. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  787. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(-0.5f, 0, 0);
  788. listCMV[i].materialList[2].ObjectTransform.startRot = Vector3.zero;
  789. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  790. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(0.5f, 0, 0);
  791. listCMV[i].materialList[3].ObjectTransform.startRot = Vector3.zero;
  792. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  793. listCMV[i].materialList[4].ObjectTransform.startPos = new Vector3(1f, 0, 0);
  794. listCMV[i].materialList[4].ObjectTransform.startRot = Vector3.zero;
  795. listCMV[i].materialList[4].ObjectTransform.startScale = Vector3.one;
  796. listCMV[i].materialList[5].ObjectTransform.startPos = new Vector3(1.5f, 0, 0);
  797. listCMV[i].materialList[5].ObjectTransform.startRot = Vector3.zero;
  798. listCMV[i].materialList[5].ObjectTransform.startScale = Vector3.one;
  799. break;
  800. default:
  801. break;
  802. }
  803. break;
  804. case "2": // 扇形
  805. int num2 = listCMV[i].materialList.Count;
  806. for (int j = 0; j < listCMV[i].materialList.Count; j++)
  807. {
  808. if (listCMV[i].materialList[j].type == "4")
  809. num2--;
  810. }
  811. switch (num2)
  812. {
  813. case 2:
  814. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0, 0.26f);
  815. listCMV[i].materialList[0].ObjectTransform.startRot = new Vector3(0, -15, 0);
  816. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  817. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0.5f, 0, 0.26f);
  818. listCMV[i].materialList[1].ObjectTransform.startRot = new Vector3(0, 15, 0);
  819. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  820. break;
  821. case 3:
  822. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-5f, 0, -0.05f);
  823. listCMV[i].materialList[0].ObjectTransform.startRot = new Vector3(0, -30, 0);
  824. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  825. listCMV[i].materialList[1].ObjectTransform.startPos = Vector3.zero;
  826. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  827. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  828. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0, -0.05f);
  829. listCMV[i].materialList[2].ObjectTransform.startRot = new Vector3(0, 30, 0);
  830. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  831. break;
  832. case 4:
  833. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-1f, 0, 0.16f);
  834. listCMV[i].materialList[0].ObjectTransform.startRot = new Vector3(0, -30, 0);
  835. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  836. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(-0.5f, 0, 0.26f);
  837. listCMV[i].materialList[1].ObjectTransform.startRot = new Vector3(0, -15, 0);
  838. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  839. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0, 0.26f);
  840. listCMV[i].materialList[2].ObjectTransform.startRot = new Vector3(0, 15, 0);
  841. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  842. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(1f, 0, 0.16f);
  843. listCMV[i].materialList[3].ObjectTransform.startRot = new Vector3(0, 30, 0);
  844. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  845. break;
  846. case 5:
  847. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-1f, 0, -0.15f);
  848. listCMV[i].materialList[0].ObjectTransform.startRot = new Vector3(0, -45, 0);
  849. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  850. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(-0.5f, 0, -0.05f);
  851. listCMV[i].materialList[1].ObjectTransform.startRot = new Vector3(0, -30, 0);
  852. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  853. listCMV[i].materialList[2].ObjectTransform.startPos = Vector3.zero;
  854. listCMV[i].materialList[2].ObjectTransform.startRot = Vector3.zero;
  855. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  856. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(0.5f, 0, -0.05f);
  857. listCMV[i].materialList[3].ObjectTransform.startRot = new Vector3(0, 30, 0);
  858. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  859. listCMV[i].materialList[4].ObjectTransform.startPos = new Vector3(1f, 0, -0.15f);
  860. listCMV[i].materialList[4].ObjectTransform.startRot = new Vector3(0, 45, 0);
  861. listCMV[i].materialList[4].ObjectTransform.startScale = Vector3.one;
  862. break;
  863. case 6:
  864. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-1.5f, 0, 0);
  865. listCMV[i].materialList[0].ObjectTransform.startRot = new Vector3(0, -45, 0);
  866. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  867. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(-1f, 0, 0.16f);
  868. listCMV[i].materialList[1].ObjectTransform.startRot = new Vector3(0, -30, 0);
  869. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  870. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(-0.5f, 0, 0.26f);
  871. listCMV[i].materialList[2].ObjectTransform.startRot = new Vector3(0, -15, 0);
  872. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  873. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(0.5f, 0, 0.26f);
  874. listCMV[i].materialList[3].ObjectTransform.startRot = new Vector3(0, 15, 0);
  875. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  876. listCMV[i].materialList[4].ObjectTransform.startPos = new Vector3(1f, 0, 0.16f);
  877. listCMV[i].materialList[4].ObjectTransform.startRot = new Vector3(0, 30, 0);
  878. listCMV[i].materialList[4].ObjectTransform.startScale = Vector3.one;
  879. listCMV[i].materialList[5].ObjectTransform.startPos = new Vector3(1.5f, 0, 0);
  880. listCMV[i].materialList[5].ObjectTransform.startRot = new Vector3(0, 45, 0);
  881. listCMV[i].materialList[5].ObjectTransform.startScale = Vector3.one;
  882. break;
  883. default:
  884. break;
  885. }
  886. break;
  887. case "3": // 双层 平铺
  888. int num3 = listCMV[i].materialList.Count;
  889. for (int j = 0; j < listCMV[i].materialList.Count; j++)
  890. {
  891. if (listCMV[i].materialList[j].type == "4")
  892. num3--;
  893. }
  894. switch (num3)
  895. {
  896. case 2:
  897. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0.3f, 0);
  898. listCMV[i].materialList[0].ObjectTransform.startRot = Vector3.zero;
  899. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  900. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0.3f, 0);
  901. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  902. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  903. break;
  904. case 3:
  905. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0.3f, 0);
  906. listCMV[i].materialList[0].ObjectTransform.startRot = Vector3.zero;
  907. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  908. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0.3f, 0);
  909. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  910. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  911. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0.3f, 0);
  912. listCMV[i].materialList[2].ObjectTransform.startRot = Vector3.zero;
  913. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  914. Vector3 pos = Vector3.zero;
  915. pos.x = -0.17f;
  916. Debug.Log(pos.x);
  917. break;
  918. case 4:
  919. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0.3f, 0);
  920. listCMV[i].materialList[0].ObjectTransform.startRot = Vector3.zero;
  921. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  922. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0.3f, 0);
  923. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  924. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  925. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0.3f, 0);
  926. listCMV[i].materialList[2].ObjectTransform.startRot = Vector3.zero;
  927. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  928. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(-0.5f, -0.3f, 0);
  929. listCMV[i].materialList[3].ObjectTransform.startRot = Vector3.zero;
  930. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  931. break;
  932. case 5:
  933. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0.3f, 0);
  934. listCMV[i].materialList[0].ObjectTransform.startRot = Vector3.zero;
  935. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  936. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0.3f, 0);
  937. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  938. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  939. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0.3f, 0);
  940. listCMV[i].materialList[2].ObjectTransform.startRot = Vector3.zero;
  941. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  942. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(-0.5f, -0.3f, 0);
  943. listCMV[i].materialList[3].ObjectTransform.startRot = Vector3.zero;
  944. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  945. listCMV[i].materialList[4].ObjectTransform.startPos = new Vector3(0, -0.3f, 0);
  946. listCMV[i].materialList[4].ObjectTransform.startRot = Vector3.zero;
  947. listCMV[i].materialList[4].ObjectTransform.startScale = Vector3.one;
  948. break;
  949. case 6:
  950. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0.3f, 0);
  951. listCMV[i].materialList[0].ObjectTransform.startRot = Vector3.zero;
  952. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  953. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0.3f, 0);
  954. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  955. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  956. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0.3f, 0);
  957. listCMV[i].materialList[2].ObjectTransform.startRot = Vector3.zero;
  958. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  959. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(-0.5f, -0.3f, 0);
  960. listCMV[i].materialList[3].ObjectTransform.startRot = Vector3.zero;
  961. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  962. listCMV[i].materialList[4].ObjectTransform.startPos = new Vector3(0, -0.3f, 0);
  963. listCMV[i].materialList[4].ObjectTransform.startRot = Vector3.zero;
  964. listCMV[i].materialList[4].ObjectTransform.startScale = Vector3.one;
  965. listCMV[i].materialList[5].ObjectTransform.startPos = new Vector3(0.5f, -0.3f, 0);
  966. listCMV[i].materialList[5].ObjectTransform.startRot = Vector3.zero;
  967. listCMV[i].materialList[5].ObjectTransform.startScale = Vector3.one;
  968. break;
  969. default:
  970. break;
  971. }
  972. break;
  973. case "4": //双层 扇形摆放
  974. Debug.Log(listCMV[i].name + 2);
  975. int num4 = listCMV[i].materialList.Count;
  976. for (int j = 0; j < listCMV[i].materialList.Count; j++)
  977. {
  978. if (listCMV[i].materialList[j].type == "4")
  979. num4--;
  980. }
  981. switch (num4)
  982. {
  983. case 2:
  984. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0.3f, -0.05f);
  985. listCMV[i].materialList[0].ObjectTransform.startRot = new Vector3(0, -30, 0);
  986. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  987. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0.3f, 0);
  988. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  989. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  990. break;
  991. case 3:
  992. Debug.Log("listCMV[i] " + listCMV[i].name);
  993. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0.3f, -0.05f);
  994. listCMV[i].materialList[0].ObjectTransform.startRot = new Vector3(0, -30, 0);
  995. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  996. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0.3f, 0);
  997. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  998. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  999. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0.3f, -0.05f);
  1000. listCMV[i].materialList[2].ObjectTransform.startRot = new Vector3(0, 30, 0);
  1001. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  1002. Debug.Log(listCMV[i].materialList[0].ObjectTransform.startPos);
  1003. Debug.Log(listCMV[i].materialList[1].ObjectTransform.startPos);
  1004. Debug.Log(listCMV[i].materialList[2].ObjectTransform.startPos);
  1005. break;
  1006. case 4:
  1007. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0.3f, -0.05f);
  1008. listCMV[i].materialList[0].ObjectTransform.startRot = new Vector3(0, -30, 0);
  1009. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  1010. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0.3f, 0);
  1011. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  1012. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  1013. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0.3f, -0.05f);
  1014. listCMV[i].materialList[2].ObjectTransform.startRot = new Vector3(0, 30, 0);
  1015. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  1016. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(-0.5f, -0.3f, 0);
  1017. listCMV[i].materialList[3].ObjectTransform.startRot = new Vector3(0, -30, 0);
  1018. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  1019. break;
  1020. case 5:
  1021. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0.3f, -0.05f);
  1022. listCMV[i].materialList[0].ObjectTransform.startRot = new Vector3(0, -30, 0);
  1023. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  1024. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0.3f, 0);
  1025. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  1026. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  1027. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0.3f, -0.05f);
  1028. listCMV[i].materialList[2].ObjectTransform.startRot = new Vector3(0, 30, 0);
  1029. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  1030. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(-0.5f, -0.3f, 0);
  1031. listCMV[i].materialList[3].ObjectTransform.startRot = new Vector3(0, -30, 0);
  1032. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  1033. listCMV[i].materialList[4].ObjectTransform.startPos = new Vector3(0, -0.3f, 0);
  1034. listCMV[i].materialList[4].ObjectTransform.startRot = Vector3.zero;
  1035. listCMV[i].materialList[4].ObjectTransform.startScale = Vector3.one;
  1036. break;
  1037. case 6:
  1038. listCMV[i].materialList[0].ObjectTransform.startPos = new Vector3(-0.5f, 0.3f, -0.05f);
  1039. listCMV[i].materialList[0].ObjectTransform.startRot = new Vector3(0, -30, 0);
  1040. listCMV[i].materialList[0].ObjectTransform.startScale = Vector3.one;
  1041. listCMV[i].materialList[1].ObjectTransform.startPos = new Vector3(0, 0.3f, 0);
  1042. listCMV[i].materialList[1].ObjectTransform.startRot = Vector3.zero;
  1043. listCMV[i].materialList[1].ObjectTransform.startScale = Vector3.one;
  1044. listCMV[i].materialList[2].ObjectTransform.startPos = new Vector3(0.5f, 0.3f, -0.05f);
  1045. listCMV[i].materialList[2].ObjectTransform.startRot = new Vector3(0, 30, 0);
  1046. listCMV[i].materialList[2].ObjectTransform.startScale = Vector3.one;
  1047. listCMV[i].materialList[3].ObjectTransform.startPos = new Vector3(-0.5f, -0.3f, 0);
  1048. listCMV[i].materialList[3].ObjectTransform.startRot = new Vector3(0, -30, 0);
  1049. listCMV[i].materialList[3].ObjectTransform.startScale = Vector3.one;
  1050. listCMV[i].materialList[4].ObjectTransform.startPos = new Vector3(0, -0.3f, 0);
  1051. listCMV[i].materialList[4].ObjectTransform.startRot = Vector3.zero;
  1052. listCMV[i].materialList[4].ObjectTransform.startScale = Vector3.one;
  1053. listCMV[i].materialList[5].ObjectTransform.startPos = new Vector3(0.5f, -0.3f, -0.05f);
  1054. listCMV[i].materialList[5].ObjectTransform.startRot = new Vector3(0, 30, 0);
  1055. listCMV[i].materialList[5].ObjectTransform.startScale = Vector3.one;
  1056. break;
  1057. default:
  1058. break;
  1059. }
  1060. break;
  1061. case "5":
  1062. for (int j = 0; j < listCMV[i].materialList.Count; j++)
  1063. {
  1064. listCMV[i].materialList[j].ObjectTransform.startPos = Vector3.zero;
  1065. listCMV[i].materialList[j].ObjectTransform.startRot = Vector3.zero;
  1066. listCMV[i].materialList[j].ObjectTransform.startScale = new Vector3(5, 5, 5);
  1067. }
  1068. break;
  1069. default:
  1070. break;
  1071. }
  1072. }
  1073. //for (int i = 0; i < listCMV.Count; i++)
  1074. //{
  1075. // for (int j = 0; j < listCMV[i].materialList.Count; j++)
  1076. // {
  1077. // Debug.Log(listCMV[i].materialList[j].name + " " + listCMV[i].materialList[j].ObjectTransform.startPos.x);
  1078. // }
  1079. //}
  1080. return listCMV;
  1081. }
  1082. public void AddListDaownLoad(DownLoadMaterial value)
  1083. {
  1084. for (int i = 0; i < listDownLoad.Count; i++)
  1085. {
  1086. if (listDownLoad[i].mObj.DownloadPath == value.mObj.DownloadPath || listDownLoad[i].mObj.type=="4")
  1087. return;
  1088. }
  1089. listDownLoad.Add(value);
  1090. }
  1091. public void SetObjectTransform(ObjectTransform obj)
  1092. {
  1093. obj = new ObjectTransform();
  1094. obj.startPos = Vector3.zero;
  1095. obj.startRot = Vector3.zero;
  1096. obj.startScale = Vector3.one;
  1097. obj.nowPos = Vector3.zero;
  1098. obj.nowRot = Vector3.zero;
  1099. obj.nowScale = Vector3.zero;
  1100. }
  1101. /// <summary>
  1102. /// ARCore 识别图排序
  1103. /// </summary>
  1104. /// <param name="scene"></param>
  1105. public void SettingImageTarked( SceneValue scene )
  1106. {
  1107. List<SpoitImage> list_spoitImage = new List<SpoitImage>();
  1108. for (int i = 0; i < scene.listSpoit.Count; i++)
  1109. {
  1110. list_spoitImage.Add(new SpoitImage(scene.listSpoit[i].id, scene.listSpoit[i].localTriggerImage));
  1111. }
  1112. SpoitImage spoitImage = null;
  1113. for (int i = 0; i < list_spoitImage.Count; i++)
  1114. {
  1115. for (int j = 0; j < list_spoitImage.Count ; j++)
  1116. {
  1117. if(list_spoitImage[i].id<list_spoitImage[j].id)
  1118. {
  1119. spoitImage = list_spoitImage[i];
  1120. list_spoitImage[i] = list_spoitImage[j];
  1121. list_spoitImage[j] = spoitImage;
  1122. spoitImage = null;
  1123. }
  1124. }
  1125. }
  1126. for (int i = 0; i < list_spoitImage.Count; i++)
  1127. {
  1128. Debug.Log(list_spoitImage[i].id + " ###@@@ " + list_spoitImage[i].localSave);
  1129. listImageTracked.Add(list_spoitImage[i].localSave);
  1130. }
  1131. for (int i = 0; i < listImageTracked.Count; i++)
  1132. {
  1133. Debug.Log(listImageTracked[i] + " ####@@@@@");
  1134. }
  1135. //for (int i = 0; i < list_Spoit.Count; i++)
  1136. //{
  1137. // Debug.Log("#############" + list_Spoit[i].name);
  1138. // listImageTracked.Add(list_Spoit[i].localTriggerImage);
  1139. // // dicImageTracked.Add(list_Spoit[i].localTriggerImage, null);
  1140. //}
  1141. }
  1142. /// <summary>
  1143. /// 获取当前时间的时间戳
  1144. /// </summary>
  1145. /// <returns></returns>
  1146. public int GetTimeStamp()
  1147. {
  1148. TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
  1149. return int.Parse( Convert.ToInt64(ts.TotalSeconds).ToString());
  1150. }
  1151. }
  1152. public enum MaterialType
  1153. {
  1154. NULL,
  1155. Image,
  1156. Video,
  1157. Model,
  1158. Text,
  1159. ImageorViedoAndText,
  1160. ModelAndText,
  1161. }
  1162. public enum SpoitType
  1163. {
  1164. Null,
  1165. ShanXin,
  1166. PingZiXing,
  1167. BingLie,
  1168. LunBo,
  1169. }
  1170. public enum SceneType
  1171. {
  1172. Vuforial,
  1173. PointCloud,
  1174. }
  1175. /// <summary>
  1176. /// 单个素材属性
  1177. /// </summary>
  1178. public class MaterialObjValue
  1179. {
  1180. public string name { get; set; }
  1181. public string type { get; set; } //图片/文字/视频/模型
  1182. public string textContent { get; set; } // 文字内容(如果类型不为文字 则为NULL)
  1183. public string textPosition { get; set; }// 文字位置(如果类型不为文字 则为NULL)
  1184. public string TextBJ { get; set; } // 文本框的背景 (如果类型不为文字 则为NULL)
  1185. public string DownloadPath { get; set; } // 下载地址 (如果类型是文字 则为NULL)
  1186. public string localSavePath { get; set; } // 保存在本地的地址默认为NULL
  1187. public string cdnUrl { get; set; }
  1188. public ObjectTransform ObjectTransform { get; set; } //坐标 旋转 尺寸 如果没有数据的话默认为NULL
  1189. }
  1190. /// <summary>
  1191. /// 组合素材属性
  1192. /// </summary>
  1193. public class CompositeMaterialValue
  1194. {
  1195. public int id { get; set; }
  1196. public string name { get; set; }
  1197. // public String textContent { get; set; } //文字内容
  1198. public int type { get; set; } //1. 图片 2.视频 3.模型 4.文字 5.图片+文字/视频+文字 6.模型+文字
  1199. public string describe { get; set; } // 简介
  1200. public List<MaterialObjValue> materialList { get; set; }
  1201. public string icon { get; set; } // 缩略图下载地址
  1202. public int updateTime { get; set; } // 更新时间
  1203. public string template { get; set; } // 排列样式 没有的话为NULL
  1204. public ObjectTransform objectTransform { get; set; }
  1205. public int userId { get; set; }
  1206. public string typesetting { get; set; }
  1207. }
  1208. /// <summary>
  1209. /// 景点属性
  1210. /// </summary>
  1211. public class SpoitValue
  1212. {
  1213. public int id { get; set; }
  1214. //场景id
  1215. public int projectId { get; set; }
  1216. //景点名称
  1217. public string name { get; set; }
  1218. //更新时间
  1219. public int updateTime { get; set; }
  1220. // 识别图下载地址
  1221. public string triggerImage { get; set; }
  1222. // 识别图本地地址
  1223. public string localTriggerImage { get; set; }
  1224. //当前景点所有素材
  1225. public List<CompositeMaterialValue> material { get; set; }
  1226. //坐标 旋转 尺寸 如果没有数据的话默认为NULL
  1227. public ObjectTransform spoitTf { get; set; }
  1228. public List<MapPos> SpoitTransform { get; set; }
  1229. }
  1230. /// <summary>
  1231. /// 整个场景属性
  1232. /// </summary>
  1233. public class SceneValue
  1234. {
  1235. //场景名称
  1236. public string name { get; set; }
  1237. //人气
  1238. public string sentiment { get; set; }
  1239. //识别图XML文件
  1240. public string vuforiaXML { get; set; }
  1241. //识别图DAT文件
  1242. public string vuforiaDat { get; set; }
  1243. public int updateTime { get; set; }
  1244. //状态 0停用 1请用
  1245. public int status { get; set; }
  1246. //描述
  1247. public string describe { get; set; }
  1248. //场景照片
  1249. public string image { get; set; }
  1250. //沙盘
  1251. public string sandTable { get; set; }
  1252. //场景内所有景点信息
  1253. public List<SpoitValue> listSpoit { get; set; }
  1254. }
  1255. /// <summary>
  1256. /// 坐标 旋转 尺寸
  1257. /// </summary>
  1258. public class ObjectTransform
  1259. {
  1260. public Vector3 startPos { get; set; }
  1261. public Vector3 startRot { get; set; }
  1262. public Vector3 startScale { get; set; }
  1263. public Vector3 nowPos { get; set; }
  1264. public Vector3 nowRot { get; set; }
  1265. public Vector3 nowScale { get; set; }
  1266. }
  1267. public class SpoitImage
  1268. {
  1269. public int id { get; set; }
  1270. public string localSave { get; set; }
  1271. public SpoitImage( int ID, string LocalSave)
  1272. {
  1273. this.id = ID;
  1274. this.localSave = LocalSave;
  1275. }
  1276. }
  1277. public class ObjectTData
  1278. {
  1279. public Vector3 pos;
  1280. public Vector3 rot;
  1281. public Vector3 scale;
  1282. }
  1283. public class ScenesPage
  1284. {
  1285. public string name { get; set; }
  1286. public int id { get; set; }
  1287. }
  1288. public class MapPos
  1289. {
  1290. public double X { get; set; }
  1291. public double Y { get; set; }
  1292. public double Z { get; set; }
  1293. public double T { get; set; }
  1294. }
  1295. class ValueObjs
  1296. {
  1297. public Transform all;
  1298. public List<Transform> showObj;
  1299. public ValueObjs(Transform allObj)
  1300. {
  1301. showObj = new List<Transform>();
  1302. all = allObj;
  1303. for (int i = 0; i < allObj.childCount; i++)
  1304. {
  1305. showObj.Add(allObj.GetChild(i));
  1306. }
  1307. }
  1308. }
  1309. public class SendInit
  1310. {
  1311. public string sn {get;set;}
  1312. public int projectId { get; set; }
  1313. }
  1314. public class SendLogin
  1315. {
  1316. public string email { get; set; }
  1317. public string password { get; set; }
  1318. }
  1319. public class SendMaterials
  1320. {
  1321. public string url { get; set; }
  1322. }
  1323. public class SendEditorData
  1324. {
  1325. public int id { get; set; }
  1326. public List<CompositeMaterialValue> material { get; set; }
  1327. public ObjectTransform spoittf { get; set; }
  1328. // public int visitcout { get; set; }
  1329. }
  1330. // 电量
  1331. public class SendNetConnectElectricity
  1332. {
  1333. public string sn { get; set; }
  1334. public int projectId { get; set; }
  1335. public int electricity { get; set; }
  1336. public string status { get; set; }
  1337. }
  1338. //触发
  1339. public class SendNetConnectPointTrigger
  1340. {
  1341. //projectId:"<uuid>",
  1342. //sn:"<string>",
  1343. //cmdType:"increasePointTrigger",
  1344. //viewpointId:"<uuid>",
  1345. //triggerTs:<int64>
  1346. //
  1347. public string name { get; set; }
  1348. public int projectId { get; set; }
  1349. public string sn { get; set; }
  1350. }
  1351. //位置
  1352. public class SendNetConnectPointCloud
  1353. {
  1354. public int projectId { get; set; }
  1355. public string sn { get; set; }
  1356. public string positionType { get; set; }
  1357. public Position position;
  1358. public SendNetConnectPointCloud()
  1359. {
  1360. this.position = new Position();
  1361. }
  1362. }
  1363. public class Position
  1364. {
  1365. public float x { get; set; }
  1366. public float y { get; set; }
  1367. public float z { get; set; }
  1368. }
  1369. public class AppConfigConst
  1370. {
  1371. public static string IMAGE_TARGET_FILE_PATH = ""; //http url http://29.193.45.32:8080/U3dFileToServer/upLoad/AssetBundle/ 存放目录
  1372. public static string IMAGE_TARGET_FILE_NAME = "YCYL3_3Test";
  1373. }
  1374. //public class JsonSceneValue
  1375. //{
  1376. // //场景名称
  1377. // public string name { get; set; }
  1378. // //人气
  1379. // public string sentiment { get; set; }
  1380. // //识别图XML文件
  1381. // public string vuforiaXML { get; set; }
  1382. // //识别图DAT文件
  1383. // public string vuforiaDat { get; set; }
  1384. // public long updateTime { get; set; }
  1385. // //状态 0停用 1请用
  1386. // public int status { get; set; }
  1387. // //描述
  1388. // public string describe { get; set; }
  1389. // //场景照片
  1390. // public string image { get; set; }
  1391. // //场景内所有景点信息
  1392. // public List<JsonSpoitValue> listSpoit { get; set; }
  1393. //}
  1394. //public class JsonSpoitValue
  1395. //{
  1396. // //场景id
  1397. // public int projectId { get; set; }
  1398. // //景点名称
  1399. // public String name { get; set; }
  1400. // //更新时间
  1401. // public long updateTime { get; set; }
  1402. // //当前景点所有素材
  1403. // public List<JsonMaterialValue> listMaterial { get; set; }
  1404. // //坐标 旋转 尺寸 如果没有数据的话默认为NULL
  1405. // public ObjectTransform spoitTransform { get; set; }
  1406. //}
  1407. //public class JsonMaterialValue
  1408. //{
  1409. // public string Name { get; set; }
  1410. // public String textContent { get; set; } //文字内容
  1411. // public long updateTime { get; set; } // 更新时间
  1412. // public string template { get; set; } // 排列样式
  1413. // public string describe { get; set; } // 简介
  1414. // public MaterialType type { get; set; } // 图片/视频/模型/
  1415. // public int textStyle { get; set; } // 文本框的背景
  1416. // public string icon { get; set; } // 缩略图下载地址
  1417. // public List<string> listDownloadPath { get; set; } // 下载地址组
  1418. // public List<string> localSavePath { get; set; } // 保存在本地的地址组 默认为NULL
  1419. // public ObjectTransform textTransform { get; set; }
  1420. // public ObjectTransform materialTransform { get; set; } // 坐标 旋转 尺寸
  1421. //}