HoloLens 앱에서 OneDrive에서 파일 열기 # 애셋 Adkale
오늘은 Unity에서 만드는 HoloLens 앱에서 OneDrive에 저장된 파일을 열고 Runtime에서 처리하는 방법을 소개합니다.
Windows Store Native 1.19 (Dec 19, 2016)

다음은 OneDrive 호출 위치에서 new[] { ".png", ".jpg"} 부분에서 파일을 좁힐 수 있습니다. 선택 후에 result.ReadBytes()나 result.ReadText()로 파일의 데이터를 취할 수 있으므로 그것을 Texture에 돌진해 사용합니다.
ExampleSceneManagerController.cs
    public void ShowFileOpenPicker()
    {
        WSANativeFilePicker.PickSingleFile("Select", WSAPickerViewMode.Thumbnail, WSAPickerLocationId.PicturesLibrary, new[] { ".png", ".jpg" }, (result) =>
        {
            if (result != null)
            {
#pragma warning disable 0219
                byte[] fileBytes = result.ReadBytes();
                string fileString = result.ReadText();
#pragma warning restore 0219
            }
        });
    }
참고 Air-Tap에서 OneDrive 열기

AirTapAction.cs
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.VR.WSA.Input;
using HoloToolkit.Unity;
[RequireComponent(typeof(GazeManager))]
public class AirTapAction : MonoBehaviour
{
    GestureRecognizer recognizer;
    public UnityEvent myEvent;
    void Start()
    {
        recognizer = new GestureRecognizer();
        recognizer.SetRecognizableGestures(GestureSettings.Tap);
        recognizer.TappedEvent += Recognizer_TappedEvent;
        recognizer.StartCapturingGestures();
    }
    void OnDestroy()
    {
        recognizer.StopCapturingGestures();
        recognizer.TappedEvent -= Recognizer_TappedEvent;
    }
    private void Recognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        OnTap();
    }
    void LateUpdate()
    {
#if UNITY_EDITOR
        if (Input.GetMouseButtonDown(0))
        {
            OnTap();
        }
#endif
    }
    private void OnTap()
    {
        if (myEvent != null)
            myEvent.Invoke();
    }
}
그건 그렇고
OneDrive가 HoloLens에 설치되어 있지 않으면 설치하라는 안내가 표시됩니다. 잘 됐다.
                Reference
이 문제에 관하여(HoloLens 앱에서 OneDrive에서 파일 열기 # 애셋 Adkale), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/yuujii/items/d3023d4d97a94b832a9f텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)