Initialer Upload neues Unity-Projekt
This commit is contained in:
8
Assets/Oculus/Voice/Samples/Shapes/Materials.meta
Normal file
8
Assets/Oculus/Voice/Samples/Shapes/Materials.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ecc866ba3439a74a84f9c5b4ac031a3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
80
Assets/Oculus/Voice/Samples/Shapes/Materials/Shapes.mat
Normal file
80
Assets/Oculus/Voice/Samples/Shapes/Materials/Shapes.mat
Normal file
@ -0,0 +1,80 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Shapes
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d4f1cabe1d44f24fab3957c9afcb58b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
84
Assets/Oculus/Voice/Samples/Shapes/Materials/Skybox.mat
Normal file
84
Assets/Oculus/Voice/Samples/Shapes/Materials/Skybox.mat
Normal file
@ -0,0 +1,84 @@
|
||||
%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: Skybox
|
||||
m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: _SUNDISK_HIGH_QUALITY
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _AtmosphereThickness: 1.54
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _Exposure: 1
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SunDisk: 2
|
||||
- _SunSize: 0
|
||||
- _SunSizeConvergence: 5
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _GroundColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _SkyTint: {r: 0.3773585, g: 0.2076738, b: 0, a: 1}
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d49ff97a571f9ed4190359b6fda70b24
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Oculus/Voice/Samples/Shapes/Scripts.meta
Normal file
8
Assets/Oculus/Voice/Samples/Shapes/Scripts.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e486573126110904f800cea70d58af68
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
103
Assets/Oculus/Voice/Samples/Shapes/Scripts/ColorChanger.cs
Normal file
103
Assets/Oculus/Voice/Samples/Shapes/Scripts/ColorChanger.cs
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Oculus SDK License Agreement (the "License");
|
||||
* you may not use the Oculus SDK except in compliance with the License,
|
||||
* which is provided at the time of installation or download, or which
|
||||
* otherwise accompanies this software in either electronic or hard copy form.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://developer.oculus.com/licenses/oculussdk/
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, the Oculus SDK
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using Meta.WitAi;
|
||||
using Meta.WitAi.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Meta.Voice.Samples.Shapes
|
||||
{
|
||||
public class ColorChanger : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the color of the specified transform.
|
||||
/// </summary>
|
||||
/// <param name="trans"></param>
|
||||
/// <param name="color"></param>
|
||||
private void SetColor(Transform trans, Color color)
|
||||
{
|
||||
trans.GetComponent<Renderer>().material.color = color;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Directly processes a command result getting the slots with WitResult utilities
|
||||
/// </summary>
|
||||
/// <param name="commandResult">Result data from Wit.ai activation to be processed</param>
|
||||
public void UpdateColor(WitResponseNode commandResult)
|
||||
{
|
||||
string[] colorNames = commandResult.GetAllEntityValues("color:color");
|
||||
string[] shapes = commandResult.GetAllEntityValues("shape:shape");
|
||||
UpdateColor(colorNames, shapes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the colors of a set of shape, or all colors split across the shapes
|
||||
/// </summary>
|
||||
/// <param name="colorNames">The names of the colors to be processed</param>
|
||||
/// <param name="shapes">The shape names or if empty all shapes</param>
|
||||
public void UpdateColor(string[] colorNames, string[] shapes)
|
||||
{
|
||||
if (shapes.Length != 0 && colorNames.Length != shapes.Length)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (shapes.Length == 0 || shapes[0] == "color"){
|
||||
UpdateColorAllShapes(colorNames);
|
||||
return;
|
||||
}
|
||||
|
||||
for(var entity = 0; entity < colorNames.Length; entity++)
|
||||
{
|
||||
if (!ColorUtility.TryParseHtmlString(colorNames[entity], out var color)) return;
|
||||
|
||||
for (int i = 0; i < transform.childCount; i++)
|
||||
{
|
||||
Transform child = transform.GetChild(i);
|
||||
if (String.Equals(shapes[entity], child.name,
|
||||
StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
SetColor(child, color);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Updates the colors of the shapes, with colours split across the shapes
|
||||
/// </summary>
|
||||
/// <param name="colorNames">The names of the colors to be processed</param>
|
||||
public void UpdateColorAllShapes(string[] colorNames)
|
||||
{
|
||||
var unspecifiedShape = 0;
|
||||
for(var entity = 0; entity < colorNames.Length; entity++)
|
||||
{
|
||||
if (!ColorUtility.TryParseHtmlString(colorNames[entity], out var color)) return;
|
||||
|
||||
var splitLimit = (transform.childCount/colorNames.Length) * (entity+1);
|
||||
while (unspecifiedShape < splitLimit)
|
||||
{
|
||||
SetColor(transform.GetChild(unspecifiedShape), color);
|
||||
unspecifiedShape++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5749c1c94c5bd5b4b8c551c68c28b40b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "Meta.Voice.Samples.Shapes",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:4504b1a6e0fdcc3498c30b266e4a63bf",
|
||||
"GUID:1c28d8b71ced07540b7c271537363cc6",
|
||||
"GUID:e545cc0678493234a9368f4e470c29e8"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27caad3e4bdcbe6478324a9c4c83dd50
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Oculus SDK License Agreement (the "License");
|
||||
* you may not use the Oculus SDK except in compliance with the License,
|
||||
* which is provided at the time of installation or download, or which
|
||||
* otherwise accompanies this software in either electronic or hard copy form.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://developer.oculus.com/licenses/oculussdk/
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, the Oculus SDK
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using Meta.WitAi;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Meta.Voice.Samples.Shapes
|
||||
{
|
||||
public class ParallelTextActivator : MonoBehaviour
|
||||
{
|
||||
[Tooltip("The voice service to be used for all the requests")]
|
||||
[SerializeField] private VoiceService _voiceService;
|
||||
|
||||
[Tooltip("All the text requests to be called when 'Send' method is called")]
|
||||
[SerializeField] private string[] _requests;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// Reset
|
||||
private string[] _activates = new string[] { "Set the", "Make the" };
|
||||
private string[] _shapes = new string[] { "cube", "sphere", "capsule", "cylinder", "pentagon" };
|
||||
private string[] _colors = new string[] { "red", "blue", "yellow", "green", "orange", "purple", "magenta", "cyan", "brown", "white", "black" };
|
||||
private void Reset()
|
||||
{
|
||||
int index = 0;
|
||||
_requests = new string[_activates.Length * _shapes.Length * _colors.Length];
|
||||
for (int a = 0; a < _activates.Length; a++)
|
||||
{
|
||||
for (int c = 0; c < _colors.Length; c++)
|
||||
{
|
||||
for (int s = 0; s < _shapes.Length; s++)
|
||||
{
|
||||
_requests[index] = $"{_activates[a]} {_shapes[s]} {_colors[c]}";
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public void SendParallelRequests()
|
||||
{
|
||||
foreach (var request in _requests)
|
||||
{
|
||||
_voiceService.Activate(request);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 254ab30675344a84eb67b7ac93629847
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,203 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Oculus SDK License Agreement (the "License");
|
||||
* you may not use the Oculus SDK except in compliance with the License,
|
||||
* which is provided at the time of installation or download, or which
|
||||
* otherwise accompanies this software in either electronic or hard copy form.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://developer.oculus.com/licenses/oculussdk/
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, the Oculus SDK
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using Oculus.Voice;
|
||||
using Meta.WitAi;
|
||||
using Meta.WitAi.Data.Configuration;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace Meta.Voice.Samples.Shapes
|
||||
{
|
||||
[ExecuteAlways]
|
||||
public class ShapeSampleInstructions : MonoBehaviour
|
||||
{
|
||||
internal enum Step
|
||||
{
|
||||
SetupWit = 0,
|
||||
MissingServerToken,
|
||||
MissingClientToken,
|
||||
AddConfig,
|
||||
AddVoiceExperiences,
|
||||
SetConfig,
|
||||
Ready
|
||||
}
|
||||
|
||||
static readonly string[] steps = new string[]
|
||||
{
|
||||
"Create an application at https://wit.ai. You can import the \"shapes_demo - Wit.ai Config.zip\" in the Demo/Data directory to create it for you.\n\nConnect to the Wit.ai app by clicking Oculus>Voice SDK>Settings and copy the Server Access Token from the Wit.ai app's settings page.Next, create a new Wit configuration by clicking Create.",
|
||||
"Copy the Server Access Token from the Wit.ai app's settings page and paste it in field found in Oculus/Voice SDK/Settings.",
|
||||
"Wit configuration is missing a Client Access Token. Open the Wit configuration, expand Application Configuration, and click Refresh or paste a Client Access Token from your Wit.ai app settings page.",
|
||||
"Create a Wit configuration by clicking Assets/Create/Voice SDK/Configuration.",
|
||||
"The scene is missing the App Voice Experience component. Add it by clicking Assets/Create/Voice SDK/Add App Voice Experience to Scene.",
|
||||
"The App Voice Experience GameObject is missing its Wit configuration. Set the configuration to begin trying voice commands.",
|
||||
""
|
||||
};
|
||||
|
||||
[SerializeField] private Text instructionText;
|
||||
|
||||
private Step currentStep = Step.Ready;
|
||||
internal Step CurrentStep => currentStep;
|
||||
internal string CurrentStepText => steps[(int) currentStep];
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
UpdateStep();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
UpdateStep();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
UpdateStep();
|
||||
}
|
||||
|
||||
private void UpdateStep()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
var appVoiceExperience = FindObjectOfType<AppVoiceExperience>();
|
||||
string[] guids = AssetDatabase.FindAssets("t:WitConfiguration");
|
||||
if (guids.Length == 0)
|
||||
{
|
||||
currentStep = Step.SetupWit;
|
||||
}
|
||||
else if (!appVoiceExperience)
|
||||
{
|
||||
currentStep = Step.AddVoiceExperiences;
|
||||
}
|
||||
else if (!appVoiceExperience.RuntimeConfiguration.witConfiguration)
|
||||
{
|
||||
currentStep = Step.SetConfig;
|
||||
appVoiceExperience.RuntimeConfiguration.witConfiguration =
|
||||
AssetDatabase.LoadAssetAtPath<WitConfiguration>(
|
||||
AssetDatabase.GUIDToAssetPath(guids[0]));
|
||||
}
|
||||
else if (!WitAuthUtility.IsServerTokenValid())
|
||||
{
|
||||
currentStep = Step.MissingServerToken;
|
||||
}
|
||||
else if (string.IsNullOrEmpty(appVoiceExperience.RuntimeConfiguration?.witConfiguration?
|
||||
.GetClientAccessToken()))
|
||||
{
|
||||
currentStep = Step.MissingClientToken;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentStep = Step.Ready;
|
||||
}
|
||||
|
||||
|
||||
instructionText.text = steps[(int) currentStep];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[CustomEditor(typeof(ShapeSampleInstructions))]
|
||||
public class InstructionManagerEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
var instructions = (ShapeSampleInstructions) target;
|
||||
|
||||
if (instructions.CurrentStep == ShapeSampleInstructions.Step.Ready)
|
||||
{
|
||||
GUILayout.Label(
|
||||
"Everything is ready. Press play to test activation via the Activate button.");
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.TextArea(instructions.CurrentStepText);
|
||||
GUILayout.Space(32);
|
||||
|
||||
switch (instructions.CurrentStep)
|
||||
{
|
||||
case ShapeSampleInstructions.Step.SetupWit:
|
||||
SetupWitResources();
|
||||
break;
|
||||
case ShapeSampleInstructions.Step.MissingServerToken:
|
||||
MissingServerTokenResources();
|
||||
break;
|
||||
case ShapeSampleInstructions.Step.MissingClientToken:
|
||||
MissingClientTokenResources();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void MissingClientTokenResources()
|
||||
{
|
||||
GUILayout.Label("Resources", EditorStyles.boldLabel);
|
||||
|
||||
if (GUILayout.Button("Select Wit Config"))
|
||||
{
|
||||
Selection.activeObject = (FindObjectOfType<AppVoiceExperience>()
|
||||
.RuntimeConfiguration.witConfiguration);
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Open Wit.ai"))
|
||||
{
|
||||
Application.OpenURL("https://wit.ai/apps");
|
||||
}
|
||||
}
|
||||
|
||||
private void MissingServerTokenResources()
|
||||
{
|
||||
GUILayout.Label("Resources", EditorStyles.boldLabel);
|
||||
|
||||
if (GUILayout.Button("Open Wit.ai"))
|
||||
{
|
||||
Application.OpenURL("https://wit.ai/apps");
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupWitResources()
|
||||
{
|
||||
GUILayout.Label("Resources", EditorStyles.boldLabel);
|
||||
|
||||
if (GUILayout.Button("Open Wit.ai"))
|
||||
{
|
||||
Application.OpenURL("https://wit.ai/apps");
|
||||
}
|
||||
|
||||
GUILayout.Label("Wit.ai Sample Application File");
|
||||
GUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("Open In Explorer"))
|
||||
{
|
||||
EditorUtility.RevealInFinder("Assets/Oculus/Voice/Demo/Data/");
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Copy Path"))
|
||||
{
|
||||
GUIUtility.systemCopyBuffer = Application.dataPath + "/Oculus/Voice/Demo/Data";
|
||||
}
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63642574fdd5cde45a20839fbffc18df
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Oculus/Voice/Samples/Shapes/Shapes - Wit.ai Config.zip
Normal file
BIN
Assets/Oculus/Voice/Samples/Shapes/Shapes - Wit.ai Config.zip
Normal file
Binary file not shown.
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41f218692e78f7a4eb1d7f60d6bb8c03
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Oculus/Voice/Samples/Shapes/Shapes - WitConfiguration.asset
(Stored with Git LFS)
Normal file
BIN
Assets/Oculus/Voice/Samples/Shapes/Shapes - WitConfiguration.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8e387d02c2ef0c4e8778528ce21524b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Oculus/Voice/Samples/Shapes/Shapes.unity
(Stored with Git LFS)
Normal file
BIN
Assets/Oculus/Voice/Samples/Shapes/Shapes.unity
(Stored with Git LFS)
Normal file
Binary file not shown.
7
Assets/Oculus/Voice/Samples/Shapes/Shapes.unity.meta
Normal file
7
Assets/Oculus/Voice/Samples/Shapes/Shapes.unity.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2afa732d18be6e43943396fdcda205d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user