Add XR sample assets and update settings
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98c63244d80671d49a23f703330f4619
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a451b52f40e21dc4d9697d025f41299d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfad0a8f5ca2ec942a0a9a6c6ff9dc5c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ed3f77cabee551f478d5073edc5ee535
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.unity.xr.compositorlayers;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.view.Surface;
|
||||
|
||||
/**
|
||||
* Provides functionality to render a Bitmap onto a Surface
|
||||
* received from Unity. Primarily used for handling and displaying
|
||||
* texture data passed from Unity to Android native code.
|
||||
*/
|
||||
public class TestSurface {
|
||||
|
||||
/**
|
||||
* Initializes and renders a Bitmap onto a specified Surface.
|
||||
*
|
||||
* @param surfaceObject An object that should be an instance of android.view.Surface.
|
||||
* @param bitmap The Bitmap image to be drawn on the surface.
|
||||
* @throws RuntimeException if surfaceObject is not an instance of Surface or if bitmap is null.
|
||||
*/
|
||||
public static void InitTestSurface(Object surfaceObject, Bitmap bitmap) {
|
||||
if (!(surfaceObject instanceof Surface)) {
|
||||
throw new RuntimeException("TestSurface.ctor: supplied object is not an android.view.Surface!");
|
||||
}
|
||||
|
||||
Surface surface = (Surface) surfaceObject;
|
||||
Canvas canvas = surface.lockCanvas(null);
|
||||
|
||||
if(bitmap != null)
|
||||
{
|
||||
canvas.drawBitmap(bitmap, new Matrix(), new Paint());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RuntimeException("Surface or Image is not initialized or is null.");
|
||||
}
|
||||
|
||||
surface.unlockCanvasAndPost(canvas);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fffb0d3ab42fe5146a4c2bea5c690c53
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user