(个人)AR电子书系统创新实训第四周(2)
2017-06-04 11:53
295 查看
当前进展
本周前几天我已经实现了如何把服务器上的资源进行下载解压,接下来还需要让app在解压路径下把图片和视频进行动态的绑定,可以参考第三周的那篇博客的做法:ImageTargetManager.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; using EasyAR; using System.IO; public class ImageTargetManager : MonoBehaviour { public GameObject videoPrefab; // Use this for initialization void Awake () { string sArrangement = File.ReadAllText(UnityEngine.Application.persistentDataPath + "/TempFiles/arrangement.txt"); AssetsArrangementInfo dstInfo = JsonUtility.FromJson<AssetsArrangementInfo>(sArrangement); for(int i = 0; i < dstInfo.targetList.Count; ++i) { GameObject videoPlayer = Instantiate(videoPrefab); var ITbehaviour = videoPlayer.GetComponent<ImageTargetBehaviour>(); ITbehaviour.Path = UnityEngine.Application.persistentDataPath + "/TempFiles/" + dstInfo.targetList[i]; ITbehaviour.Storage = StorageType.Absolute; ITbehaviour.Bind(GameObject.Find("ImageTracker").GetComponent<ImageTrackerBehaviour>()); var VPbehaviour = videoPlayer.transform.GetChild(0).GetComponent<VideoPlayerBehaviour>(); VPbehaviour.Path = UnityEngine.Application.persistentDataPath + "/TempFiles/" + dstInfo.srcList[i]; VPbehaviour.Storage = StorageType.Absolute; VPbehaviour.VideoScaleMode = EasyAR.VideoPlayerBaseBehaviour.ScaleMode.Fill; VPbehaviour.EnableAutoPlay = true; VPbehaviour.EnableLoop = true; VPbehaviour.OpenWhenStart = true; VPbehaviour.VideoScaleFactorBase = 0.1f; } } }
相关文章推荐
- (个人)AR电子书系统创新实训第四周(2)
- (个人)AR电子书系统创新实训第四周(1)
- (个人)AR电子书系统创新实训第四周(2)
- (个人)AR电子书创新系统实训第四周(1)
- (个人)AR电子书系统创新实训第四周(1)
- (个人)AR电子书创新系统实训第四周(2)
- (个人)AR电子书系统创新实训第一周(2)
- (个人)AR电子书系统创新实训第一周(2)
- (个人)AR电子书创新系统实训第六周(1)
- (个人)AR电子书系统创新实训第三周(2)
- (个人)AR电子书系统创新实训期中汇报
- (个人)AR电子书系统创新实训第五周(2)
- (个人)AR电子书系统创新实训第二周(1)
- (个人)AR电子书系统创新实训第二周(2)
- (个人)AR电子书系统创新实训第二周(2)
- (个人)AR电子书系统创新实训第二周(2)
- (个人)AR电子书系统创新实训第六周(2)
- (个人)AR电子书创新系统实训第六周(2)
- (项目)AR电子书系统创新实训第四周(2)
- (个人)AR电子书系统创新实训第一周(2)