Загрузка PICO Unity OpenXR Integration SDK
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28bbe9e36b38b43d8a0a007f60c3feb4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,55 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Sky
|
||||
m_Shader: {fileID: 104, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BackTex:
|
||||
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DownTex:
|
||||
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _FrontTex:
|
||||
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _LeftTex:
|
||||
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 2800000, guid: dd7b66dc618b0124fa442f6e6658768d, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _RightTex:
|
||||
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _UpTex:
|
||||
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _Exposure: 1
|
||||
- _Rotation: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5ef92f0b9b738d429be8f6537730b22
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Packages/PICO Unity OpenXR Integration SDK-1.3.0-20241011/Platform/Samples/Materials/skybox.tif
(Stored with Git LFS)
Normal file
BIN
Packages/PICO Unity OpenXR Integration SDK-1.3.0-20241011/Platform/Samples/Materials/skybox.tif
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,92 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d485f7a8b4cddcc469daf84f71b5a7f8
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Pico.Platform.Models;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Pico.Platform.Samples
|
||||
{
|
||||
public class SimpleDemo : MonoBehaviour
|
||||
{
|
||||
public bool useAsyncInit = true;
|
||||
|
||||
public RawImage headImage;
|
||||
public Text nameText;
|
||||
public Text logText;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
Log($"UseAsyncInit={useAsyncInit}");
|
||||
if (useAsyncInit)
|
||||
{
|
||||
try
|
||||
{
|
||||
CoreService.AsyncInitialize().OnComplete(m =>
|
||||
{
|
||||
if (m.IsError)
|
||||
{
|
||||
Log($"Async initialize failed: code={m.GetError().Code} message={m.GetError().Message}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (m.Data != PlatformInitializeResult.Success && m.Data != PlatformInitializeResult.AlreadyInitialized)
|
||||
{
|
||||
Log($"Async initialize failed: result={m.Data}");
|
||||
return;
|
||||
}
|
||||
|
||||
Log("AsyncInitialize Successfully");
|
||||
EnterDemo();
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log($"Async Initialize Failed:{e}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
CoreService.Initialize();
|
||||
}
|
||||
catch (UnityException e)
|
||||
{
|
||||
Log($"Init Platform SDK error:{e}");
|
||||
throw;
|
||||
}
|
||||
|
||||
EnterDemo();
|
||||
}
|
||||
}
|
||||
|
||||
void EnterDemo()
|
||||
{
|
||||
UserService.RequestUserPermissions(new[] {Permissions.UserInfo, Permissions.FriendRelation}).OnComplete(m =>
|
||||
{
|
||||
if (m.IsError)
|
||||
{
|
||||
Log($"Permission failed code={m.Error.Code} message={m.Error.Message}");
|
||||
return;
|
||||
}
|
||||
|
||||
Log($"RequestUserPermissions successfully:{String.Join(",", m.Data.AuthorizedPermissions)}");
|
||||
getUser();
|
||||
});
|
||||
}
|
||||
|
||||
void getUser()
|
||||
{
|
||||
UserService.GetLoggedInUser().OnComplete(m =>
|
||||
{
|
||||
if (m.IsError)
|
||||
{
|
||||
Debug.Log($"GetLoggedInUser failed:code={m.Error.Code} message={m.Error.Message}");
|
||||
return;
|
||||
}
|
||||
|
||||
StartCoroutine(DownloadImage(m.Data.ImageUrl, headImage));
|
||||
nameText.text = m.Data.DisplayName;
|
||||
Log($"DisplayName={m.Data.DisplayName} UserId={m.Data.ID}");
|
||||
});
|
||||
}
|
||||
|
||||
IEnumerator DownloadImage(string mediaUrl, RawImage rawImage)
|
||||
{
|
||||
UnityWebRequest request = UnityWebRequestTexture.GetTexture(mediaUrl);
|
||||
yield return request.SendWebRequest();
|
||||
if (request.responseCode != 200)
|
||||
{
|
||||
Log("Load image failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
rawImage.texture = ((DownloadHandlerTexture) request.downloadHandler).texture;
|
||||
rawImage.GetComponent<Renderer>().material.mainTexture = ((DownloadHandlerTexture) request.downloadHandler).texture;
|
||||
}
|
||||
}
|
||||
|
||||
void Log(string s)
|
||||
{
|
||||
logText.text = s;
|
||||
Debug.Log(s);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b732fc4d5a124b7a9926a3b408165c0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb50d682529fe4733a4f047bbf45f8a0
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user