freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

從服務(wù)器端獲取資源動態(tài)加載到場景-資料下載頁

2025-07-26 13:42本頁面
  

【正文】 存位置和默認(rèn)文件名// 78. savePath = (Save, @E:\, , unity3d)。 79. Export(go, savePath)。 80. } 81.82. private void Export(GameObject go, string filePath) 83. { 84. // IsPersistent 判斷傳入的對象是磁盤文件還是場景文件(即是否是Project視圖下的文件,是返回true)// 85. if(!(go)) 86. { 87. GameObject tmp = (go) as GameObject。 88. go = GetPrefab(tmp, ) as GameObject。 89. } 90. //Texture2D本身就是磁盤文件了,這里就沒必要再轉(zhuǎn)化了// 91. Object[] asset = optionalTexture。 92. if((filePath)) (filePath)。 93. /* 94. ():該方法是將提供的對象導(dǎo)出成Unity能識別的二進(jìn)制文件 95. 第一個參數(shù)是提供一個要導(dǎo)出的對象,第二個參數(shù)是一個Object[]類型,它可以將數(shù)據(jù)附加到第一個 96. ,所以上面的if語句判斷 97. 是否是磁盤文件類型,如果不是,先將其轉(zhuǎn)化為prefab,在Assets下臨時保存一下。這個轉(zhuǎn)化就是要 98. 用到 PrefabUtility 類里的方法。 99. */ 100. (go, asset, filePath, , )。 101. // 將暫時生成的prefab文件使用完后刪除 // 102. ((go))。 103. } 104.105. /// summary 106. /// 該方法來產(chǎn)生臨時prefab文件 107. /// /param 108. private Object GetPrefab(GameObject go, string name) 109. { 110. Object result = (Assets/ + name + .prefab)。 111. result = (go, result)。 112. (go)。 113. return result。 114. } 115.116. /// summary 117. /// 數(shù)據(jù)驗證,如果導(dǎo)出信息填寫有誤,將給用戶錯誤提示 118. /// /summary 119. private bool Validate() 120. { 121. bool b1 = (exportObject == null)。 122. bool b2 = false。 123.124. foreach(Texture2D t in optionalTexture) 125. { 126. b2 = b2 || (t == null)。 127. } 128.129. return !(b1 || b2)。 130. } 131.132. /// summary 133. /// 所有數(shù)據(jù)正確導(dǎo)出后,清除填寫的導(dǎo)出信息,以便導(dǎo)出下一條數(shù)據(jù) 134. /// /summary 135. private void Clear() 136. { 137. exportObject = null。 138. optionalCount = 0。 139. } 140. } 下載實現(xiàn)代碼:[csharp] view plaincopy 1. using UnityEngine。 2. using 。 3. /// summary 4. /// author : qyxls 5. /// /summary 6. public class Downloader : MonoBehaviour 7. { 8. private string url = ,B,Uamp。expires=8hamp。rt=pramp。r=709102273amp。logid=1896966947amp。fn=。 9. private WWW 。 10. private bool isCompleted = false。 11.12. private GameObject dice。 13. private Texture2D tex。 14.15. void Start () 16. { 17. = new WWW()。 18. } 19.20. void Update () 21. { 22. if( == null) return。 23. if(!isCompleted amp。amp。 ) 24. { 25. dice = () as GameObject。 26. isCompleted = true。 27.28. /* 29. // 取回打包在資源內(nèi)部的數(shù)據(jù) 由于我們當(dāng)初放進(jìn)去的全是Texture2D類型的,所以使用LoadAll的// 30. // 帶類型的重載方法,將Texture2D類型傳入進(jìn)去,表示我只取出Texture2D類型的數(shù)據(jù)// 31. Object[] opticals = (typeof(Texture2D))。 32. foreach(Object o in opticals) 33. { 34. Texture2D tmp = o as Texture2D。 35. print(name : + )。 36. } 37. */ 38. AssetBundleRequest abr = (blackdots, typeof(Texture2D))。 39. tex = as Texture2D。 40. } 41. } 42.43. void OnGUI() 44. { 45. if((new Rect(20, 20, 100, 40), CHANGE)) 46. { 47. // 如果還沒下載完,這時候是不能執(zhí)行替換功能的 // 48. if(dice == null || tex == null) return。 49. = tex。 50. } 51. } 52.53. /* 54. private void WWWWithParameter(string url, string parameter) 55. { 56. WWWForm form = new WWWForm()。 57. (Content, parameter)。 58. WWW = new WWW(url, form)。 59. } 60. */ 61. } 附上項目下載地址:自己測試的代碼:從服務(wù)器上獲取模型資源動態(tài)加載查看文本copy to clipboard打印?1. using UnityEngine。 2. using 。 3.4. public class NewBehaviourScript : MonoBehaviour { 5.6. private WWW 。 7. private string url = @,B,T,tamp。expires=8hamp。rt=shamp。r=631015269amp。logid=1425903517amp。sh=1amp。fn= 8. 。 9. private GameObject dice。 10. // Use this for initialization 11. void Start () { 12. = new WWW()。 13. } 14.15. private bool isCompleted = false。 16. // Update is called once per frame 17. void Update () { 18. if ( == null) return。 19. if (!isCompleted amp。amp。 ) 20. { 21. print(Download pleted)。 22. isCompleted = true。 23. dice =() as GameObject。 24. = new Vector3(0, 1, 20)。 25. //Instantiate()。 26. // print(dice)。 27. } 28. } 29. } using UnityEngine。using 。public class NewBehaviourScript : MonoBehaviour { private WWW 。 private string url = @,B,T,tamp。expires=8hamp。rt=shamp。r=631015269amp。logid=1425903517amp。sh=1amp。fn=。 private GameObject dice。 // Use this for initialization void Start () { = new WWW()。 } private bool isCompleted = false。 // Update is called once per frame void Update () { if ( == null) return。 if (!isCompleted amp。amp。 ) { print(Download pleted)。 isCompleted = true。 dice =() as GameObject。 = new Vector3(0, 1, 20)。 //Instantiate()。 // print(dice)。 } }}
點擊復(fù)制文檔內(nèi)容
規(guī)章制度相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1