clean project

This commit is contained in:
Helar Jaadla
2022-03-07 17:52:41 +02:00
parent a174b45bd2
commit cbeb10ec35
5100 changed files with 837159 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2d2baf202180c254fa9bdc8b9f29e51e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: e955972de48c3524db27b7ee6812107d
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 51b66b75957473a4f8594d6b4a58888f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,26 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ae5a46bda3295124c99b0e6537ac7252, type: 3}
m_Name: Shapes Demo - WitConfiguration
m_EditorClassIdentifier:
application:
witConfiguration: {fileID: 0}
name:
id:
lang:
isPrivate: 0
createdAt:
configId: 4e21a24e472ab684e84db753427d5687
clientAccessToken:
entities: []
intents: []
traits: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b3d5ad89f091a0a4785d8fbbfdd39448
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,26 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ae5a46bda3295124c99b0e6537ac7252, type: 3}
m_Name: Timer Builtins - WitConfiguration
m_EditorClassIdentifier:
application:
witConfiguration: {fileID: 0}
name: Built-in Models
id: voiceSDK_en
lang: en
isPrivate: 0
createdAt:
configId: 74f17110584875d438c76cba2242da14
clientAccessToken: HOKEABS7HPIQVSRSVWRPTTV75TQJ5QBP
entities: []
intents: []
traits: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8ca721df475c92e4ca9167b74de4b2f6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c8f449cba03430f45b629ec30e9f86a3
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7ecd492229a42c243a6013ad1bada8e0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,77 @@
%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: Shapes
m_Shader: {fileID: 46, 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:
- _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:
- _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}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bc0300e976173994a92b5e91881aeaad
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View 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}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fea35dc83d97e2b438e3baebaf6ead34
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 75eb0b55e037c534b8d0b28dc57b53d3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,218 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1110266669
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1110266671}
- component: {fileID: 1110266670}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1110266671
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1110266669}
m_LocalRotation: {x: -0.3892604, y: 0.3656803, z: -0.72808844, w: 0.42969945}
m_LocalPosition: {x: 0.17430386, y: 3.2850657, z: -10.452414}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8853415545987821512}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 11.418, y: 64.012, z: -111.753006}
--- !u!108 &1110266670
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1110266669}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!1 &8853415545987821519
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8853415545987821512}
m_Layer: 0
m_Name: Environment
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8853415545987821512
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8853415545987821519}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.17430386, y: -0.28506565, z: 10.452414}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 8853415547494044119}
- {fileID: 1110266671}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8853415547494044118
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8853415547494044119}
- component: {fileID: 8853415547494044112}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8853415547494044119
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8853415547494044118}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0.17430386, y: 3.2850657, z: -10.452414}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8853415545987821512}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!108 &8853415547494044112
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8853415547494044118}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.802082
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 1
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0381539164984dc4ca193f001869c526
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9e2c99d589c9fcb4b8254df996a55503
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8e367e1dd90bb894d88708e7548eae48
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0b4eecbae5fd7be46896db34734286a0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cef010296d8fc744e9abe187269ea0b5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 820d90595e7544215bde6c6f43664cb1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,244 @@
/**************************************************************************************************
* Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
*
* Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Utilities 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 UnityEngine;
using UnityEngine.UI;
namespace Oculus.Voice.Demo.BuiltInDemo
{
/// <summary>
/// Represents a countdown timer.
/// </summary>
public class TimerController : MonoBehaviour
{
private float _time = 0; // [sec] current time of the countdown timer.
private bool _timerExist = false;
private bool _timerRunning = false;
[Tooltip("The UI text element to show app messages.")]
public Text logText;
[Tooltip("The timer ring sound.")] public AudioClip buzzSound;
// Update is called once per frame
void Update()
{
if (_timerExist && _timerRunning)
{
_time -= Time.deltaTime;
if (_time < 0)
{
// Raise a ring.
OnElapsedTime();
}
}
}
private void Log(string msg)
{
Debug.Log(msg);
logText.text = msg;
}
/// <summary>
/// Buzzes and resets the timer.
/// </summary>
private void OnElapsedTime()
{
_time = 0;
_timerRunning = false;
_timerExist = false;
Log("Buzz!");
AudioSource.PlayClipAtPoint(buzzSound, Vector3.zero);
}
/// <summary>
/// Deletes the timer. It corresponds to the wit intent "wit$delete_timer"
/// </summary>
public void DeleteTimer()
{
if (!_timerExist)
{
Log("Error: There is no timer to delete.");
return;
}
_timerExist = false;
_time = 0;
_timerRunning = false;
Log("Timer deleted.");
}
/// <summary>
/// Creates a timer. It corresponds to the wit intent "wit$create_timer"
/// </summary>
/// <param name="entityValues">countdown in minutes.</param>
public void CreateTimer(string[] entityValues)
{
if (_timerExist)
{
Log("A timer already exist.");
return;
}
if (ParseTime(entityValues, out _time))
{
_timerExist = true;
_timerRunning = true;
Log($"Countdown Timer is set for {entityValues[0]} {entityValues[1]}(s).");
}
else
{
Log("Error in CreateTimer(): Could not parse wit reply.");
}
}
/// <summary>
/// Displays current timer value. It corresponds to "wit$get_timer".
/// </summary>
public void GetTimerIntent()
{
// Show the remaining time of the countdown timer.
var msg = GetFormattedTimeFromSeconds();
Log(msg);
}
/// <summary>
/// Pauses the timer. It corresponds to the wit intent "wit$pause_timer"
/// </summary>
public void PauseTimer()
{
_timerRunning = false;
Log("Timer paused.");
}
/// <summary>
/// It corresponds to the wit intent "wit$resume_timer"
/// </summary>
public void ResumeTimer()
{
_timerRunning = true;
Log("Timer resumed.");
}
/// <summary>
/// Subtracts time from the timer. It corresponds to the wit intent "wit$subtract_time_timer".
/// </summary>
/// <param name="entityValues"></param>
public void SubtractTimeTimer(string[] entityValues)
{
if (!_timerExist)
{
Log("Error: No Timer is created.");
return;
}
if (ParseTime(entityValues, out var time))
{
var msg = $"{entityValues[0]} {entityValues[1]}(s) were subtracted from the timer.";
_time -= time;
if (_time < 0)
{
_time = 0;
Log(msg);
return;
}
Log(msg);
}
else
{
Log("Error in Subtract_time_timer(): Could not parse the wit reply.");
}
}
/// <summary>
/// Adds time to the timer. It corresponds to the wit intent "wit$add_time_timer".
/// </summary>
/// <param name="entityValues"></param>
public void AddTimeToTimer(string[] entityValues)
{
if (!_timerExist)
{
Log("Error: No Timer is created.");
return;
}
if (ParseTime(entityValues, out var time))
{
_time += time;
var msg = $"{entityValues[0]} {entityValues[1]}(s) were added to the timer.";
Log(msg);
}
else
{
Log("Error in AddTimeToTimer(): Could not parse with reply.");
}
}
/// <summary>
/// Returns the remaining time (in sec) of the countdown timer.
/// </summary>
/// <returns></returns>
public float GetRemainingTime()
{
return _time;
}
/// <summary>
/// Returns time in the format of min:sec.
/// </summary>
/// <returns></returns>
public string GetFormattedTimeFromSeconds()
{
return TimeSpan.FromSeconds(_time).ToString();
}
/// <summary>
/// Parses entity values to get a resulting time value in seconds
/// </summary>
/// <param name="entityValues">The entity value results from a Response Handler</param>
/// <param name="time">The parsed time</param>
/// <returns>The parsed time in seconds or the current value of _time</returns>
/// <exception cref="ArgumentException"></exception>
private bool ParseTime(string[] entityValues, out float time)
{
time = _time;
if (entityValues.Length > 0 && float.TryParse(entityValues[0], out time))
{
if (entityValues.Length < 2)
{
throw new ArgumentException("Entities being parsed must include time value and unit.");
}
// If entity was not included in the result it will be empty, but the array will still be size 2
if (!string.IsNullOrEmpty(entityValues[1]))
{
switch (entityValues[1])
{
case "minute":
time *= 60;
break;
case "hour":
time *= 60 * 60;
break;
}
}
return true;
}
return false;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: eb4fe076c92383b438b557433015250e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,37 @@
/**************************************************************************************************
* Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
*
* Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Utilities 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 UnityEngine;
using UnityEngine.UI;
namespace Oculus.Voice.Demo.BuiltInDemo
{
public class TimerDisplay : MonoBehaviour
{
public TimerController timer;
private Text _uiText;
// Start is called before the first frame update
void Start()
{
_uiText = GetComponent<Text>();
}
// Update is called once per frame
void Update()
{
// Note: This is not optimized and you should avoid updating time each frame.
_uiText.text = timer.GetFormattedTimeFromSeconds();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dacc4d06eebcecb4a846759a3ac9f6e9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,49 @@
/**************************************************************************************************
* Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
*
* Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Utilities 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 UnityEngine;
namespace Oculus.Voice.Demo.BuiltInDemo
{
public class WitActivation : MonoBehaviour
{
[SerializeField] private AppVoiceExperience voiceExperience;
private void OnValidate()
{
if (!voiceExperience) voiceExperience = GetComponent<AppVoiceExperience>();
}
private void Start()
{
voiceExperience = GetComponent<AppVoiceExperience>();
}
private void Update()
{
// Make it possible to activate wit in the Unity Editor without the need to deploy to the headset.
if (Input.GetKeyDown(KeyCode.Space))
{
print("*** Pressed Space bar ***");
ActivateWit();
}
}
/// <summary>
/// Activates Wit i.e. start listening to the user.
/// </summary>
public void ActivateWit()
{
voiceExperience.Activate();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3699a21444dc7164289344371a620e0d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,86 @@
/**************************************************************************************************
* Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
*
* Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Utilities 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 Facebook.WitAi;
using Facebook.WitAi.Lib;
using UnityEngine;
using UnityEngine.UI;
namespace Oculus.Voice.Demo.UIShapesDemo
{
public class InteractionHandler : MonoBehaviour
{
[Header("Default States"), Multiline]
[SerializeField] private string freshStateText = "Try pressing the Activate button and saying \"Make the cube red\"";
[Header("UI")]
[SerializeField] private Text textArea;
[SerializeField] private bool showJson;
[Header("Voice")]
[SerializeField] private AppVoiceExperience appVoiceExperience;
private string pendingText;
private void OnEnable()
{
appVoiceExperience.events.OnRequestCreated.AddListener(OnRequestStarted);
}
private void OnDisable()
{
appVoiceExperience.events.OnRequestCreated.RemoveListener(OnRequestStarted);
}
private void OnRequestStarted(WitRequest r)
{
// The raw response comes back on a different thread. We store the
// message received for display on the next frame.
if (showJson) r.onRawResponse = (response) => pendingText = response;
}
private void Update()
{
if (null != pendingText)
{
textArea.text = pendingText;
pendingText = null;
}
}
public void OnResponse(WitResponseNode response)
{
if (!string.IsNullOrEmpty(response["text"]))
{
textArea.text = "I heard: " + response["text"];
}
else
{
textArea.text = freshStateText;
}
}
public void OnError(string error, string message)
{
textArea.text = $"<color=\"red\">Error: {error}\n\n{message}</color>";
}
public void ToggleActivation()
{
if (appVoiceExperience.Active) appVoiceExperience.Deactivate();
else
{
appVoiceExperience.Activate();
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: abf7a75ccc7b2ef43bde5b4c73de6e65
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 12df1a1211c7e46b3bed480404376c50
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,86 @@
/**************************************************************************************************
* Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
*
* Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
* https://developer.oculus.com/licenses/oculussdk/
*
* Unless required by applicable law or agreed to in writing, the Utilities 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 Facebook.WitAi;
using Facebook.WitAi.Lib;
using UnityEngine;
namespace Oculus.Voice.Demo.UIShapesDemo
{
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 colorName = commandResult.GetFirstEntityValue("color:color");
string shape = commandResult.GetFirstEntityValue("shape:shape");
UpdateColor(colorName, shape);
}
/// <summary>
/// Processes the values of a result handler with a color and shape filter.
/// </summary>
/// <param name="results">Results from result handler [0] color name, [1] shape</param>
public void UpdateColor(string[] results)
{
var colorName = results[0];
var shape = results[1];
UpdateColor(colorName, shape);
}
/// <summary>
/// Updates the color of a shape or all shapes
/// </summary>
/// <param name="colorName">The name of a color to be processed</param>
/// <param name="shape">The shape name or if empty all shapes</param>
public void UpdateColor(string colorName, string shape)
{
if (!ColorUtility.TryParseHtmlString(colorName, out var color)) return;
if (string.IsNullOrEmpty(shape) || shape == "color")
{
for (int i = 0; i < transform.childCount; i++)
{
SetColor(transform.GetChild(i), color);
}
}
else
{
for (int i = 0; i < transform.childCount; i++)
{
Transform child = transform.GetChild(i);
if (String.Equals(shape, child.name,
StringComparison.CurrentCultureIgnoreCase))
{
SetColor(child, color);
break;
}
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d86bf3f91fb7d4d41855107fcab470d2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,182 @@
using Facebook.WitAi;
using Facebook.WitAi.Data.Configuration;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace Oculus.Voice.Demo.UIShapesDemo
{
[ExecuteAlways]
public class Instructions : 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
.clientAccessToken))
{
currentStep = Step.MissingClientToken;
}
else
{
currentStep = Step.Ready;
}
instructionText.text = steps[(int) currentStep];
#endif
}
}
#if UNITY_EDITOR
[CustomEditor(typeof(Instructions))]
public class InstructionManagerEditor : Editor
{
public override void OnInspectorGUI()
{
var instructions = (Instructions) target;
if (instructions.CurrentStep == Instructions.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 Instructions.Step.SetupWit:
SetupWitResources();
break;
case Instructions.Step.MissingServerToken:
MissingServerTokenResources();
break;
case Instructions.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
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d7123fd6df18ed94c8e232bfe699014a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: