Initial Commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1636aeb0ab496fc4c853b40fd8f128d4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c7e27799672ce2458de435c31300019
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b5c12aa38189a145b2a57baf2a7bf4f
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e6f8accd4b079d40b3603449f318633
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,451 @@
|
||||
%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: BuiltIns Timer - WitConfiguration
|
||||
m_EditorClassIdentifier:
|
||||
_clientAccessToken: HOKEABS7HPIQVSRSVWRPTTV75TQJ5QBP
|
||||
_appInfo:
|
||||
name: Built-in Models
|
||||
id: voiceSDK_en
|
||||
lang: en
|
||||
isPrivate: 0
|
||||
createdAt:
|
||||
trainingStatus: 0
|
||||
lastTrainDuration: 0
|
||||
lastTrainedAt:
|
||||
nextTrainAt:
|
||||
intents:
|
||||
- id: 897504424223811
|
||||
name: wit$add_time_timer
|
||||
entities: []
|
||||
- id: 541438527164499
|
||||
name: wit$add_to_playlist
|
||||
entities: []
|
||||
- id: 887283025240109
|
||||
name: wit$cancel
|
||||
entities: []
|
||||
- id: 829935924385746
|
||||
name: wit$check_weather_condition
|
||||
entities: []
|
||||
- id: 306952631193690
|
||||
name: wit$confirmation
|
||||
entities: []
|
||||
- id: 377154377139380
|
||||
name: wit$create_alarm
|
||||
entities: []
|
||||
- id: 418752679692656
|
||||
name: wit$create_playlist
|
||||
entities: []
|
||||
- id: 365611011710102
|
||||
name: wit$create_timer
|
||||
entities: []
|
||||
- id: 1033582527390432
|
||||
name: wit$decrease_volume
|
||||
entities: []
|
||||
- id: 883987129203457
|
||||
name: wit$delete_alarm
|
||||
entities: []
|
||||
- id: 247929240550715
|
||||
name: wit$delete_playlist
|
||||
entities: []
|
||||
- id: 557555652118025
|
||||
name: wit$delete_timer
|
||||
entities: []
|
||||
- id: 421700242885150
|
||||
name: wit$dislike_music
|
||||
entities: []
|
||||
- id: 270102601621744
|
||||
name: wit$fast_forward_track
|
||||
entities: []
|
||||
- id: 387498056115658
|
||||
name: wit$get_alarms
|
||||
entities: []
|
||||
- id: 415840899887272
|
||||
name: wit$get_date
|
||||
entities: []
|
||||
- id: 438703477461413
|
||||
name: wit$get_sunrise
|
||||
entities: []
|
||||
- id: 375415767405106
|
||||
name: wit$get_sunset
|
||||
entities: []
|
||||
- id: 4289162121138059
|
||||
name: wit$get_temperature
|
||||
entities: []
|
||||
- id: 232518205474455
|
||||
name: wit$get_time
|
||||
entities: []
|
||||
- id: 893990681247881
|
||||
name: wit$get_time_until_date
|
||||
entities: []
|
||||
- id: 393845445654783
|
||||
name: wit$get_timer
|
||||
entities: []
|
||||
- id: 549084829680351
|
||||
name: wit$get_track_info
|
||||
entities: []
|
||||
- id: 3011049075798095
|
||||
name: wit$get_weather
|
||||
entities: []
|
||||
- id: 1014318852665058
|
||||
name: wit$go_back
|
||||
entities: []
|
||||
- id: 1031968647622673
|
||||
name: wit$go_forward
|
||||
entities: []
|
||||
- id: 284911926808943
|
||||
name: wit$increase_volume
|
||||
entities: []
|
||||
- id: 547658879873191
|
||||
name: wit$like_music
|
||||
entities: []
|
||||
- id: 236590765151252
|
||||
name: wit$loop_music
|
||||
entities: []
|
||||
- id: 4404756796280183
|
||||
name: wit$negation
|
||||
entities: []
|
||||
- id: 4432284356859008
|
||||
name: wit$nevermind
|
||||
entities: []
|
||||
- id: 831865090860258
|
||||
name: wit$open_resource
|
||||
entities: []
|
||||
- id: 3014340998807022
|
||||
name: wit$pause
|
||||
entities: []
|
||||
- id: 162448539383689
|
||||
name: wit$pause_music
|
||||
entities: []
|
||||
- id: 629110521422335
|
||||
name: wit$pause_timer
|
||||
entities: []
|
||||
- id: 1749588415235689
|
||||
name: wit$play
|
||||
entities: []
|
||||
- id: 866056607377214
|
||||
name: wit$play_music
|
||||
entities: []
|
||||
- id: 258248752970902
|
||||
name: wit$play_podcast
|
||||
entities: []
|
||||
- id: 1030753921087273
|
||||
name: wit$previous_track
|
||||
entities: []
|
||||
- id: 3112795525710499
|
||||
name: wit$remove_from_playlist
|
||||
entities: []
|
||||
- id: 1641652012695476
|
||||
name: wit$repeat_response
|
||||
entities: []
|
||||
- id: 391429655722707
|
||||
name: wit$replay_track
|
||||
entities: []
|
||||
- id: 407662237413103
|
||||
name: wit$resume
|
||||
entities: []
|
||||
- id: 658111892259804
|
||||
name: wit$resume_music
|
||||
entities: []
|
||||
- id: 229892845779856
|
||||
name: wit$resume_timer
|
||||
entities: []
|
||||
- id: 252614883454919
|
||||
name: wit$rewind_track
|
||||
entities: []
|
||||
- id: 4540198562705611
|
||||
name: wit$select_item
|
||||
entities: []
|
||||
- id: 2081412638678468
|
||||
name: wit$share
|
||||
entities: []
|
||||
- id: 588748799212186
|
||||
name: wit$shuffle_playlist
|
||||
entities: []
|
||||
- id: 917880522495837
|
||||
name: wit$silence_alarm
|
||||
entities: []
|
||||
- id: 329368558953931
|
||||
name: wit$skip_track
|
||||
entities: []
|
||||
- id: 2842638329380270
|
||||
name: wit$snooze_alarm
|
||||
entities: []
|
||||
- id: 411892023684057
|
||||
name: wit$stop
|
||||
entities: []
|
||||
- id: 238496474960073
|
||||
name: wit$stop_music
|
||||
entities: []
|
||||
- id: 151481930517141
|
||||
name: wit$subtract_time_timer
|
||||
entities: []
|
||||
- id: 620928052622542
|
||||
name: wit$unloop_music
|
||||
entities: []
|
||||
- id: 1315332902220652
|
||||
name: wit$unshuffle_playlist
|
||||
entities: []
|
||||
entities:
|
||||
- name: wit$amount_of_money
|
||||
id: 535a8110-2ea7-414f-a024-cf928b076d17
|
||||
lookups: []
|
||||
roles:
|
||||
- name: amount_of_money
|
||||
id: 388070769579971
|
||||
keywords: []
|
||||
- name: wit$datetime
|
||||
id: 535a810f-8911-4bfe-976a-6e3c193f1251
|
||||
lookups: []
|
||||
roles:
|
||||
- name: datetime
|
||||
id: 457759871937748
|
||||
keywords: []
|
||||
- name: wit$distance
|
||||
id: 535a80ff-e693-40c1-b67e-6f3e8e7144b8
|
||||
lookups: []
|
||||
roles:
|
||||
- name: distance
|
||||
id: 376395644039832
|
||||
keywords: []
|
||||
- name: wit$duration
|
||||
id: 535a80fb-4be9-4991-a48e-8b2ca4ef6e54
|
||||
lookups: []
|
||||
roles:
|
||||
- name: duration
|
||||
id: 4245444588888025
|
||||
keywords: []
|
||||
- name: wit$email
|
||||
id: 535a8107-7041-417d-b500-670b30d5267e
|
||||
lookups: []
|
||||
roles:
|
||||
- name: email
|
||||
id: 990197371827121
|
||||
keywords: []
|
||||
- name: wit$location
|
||||
id: 535a80ff-6399-4653-8b2a-c770dd014965
|
||||
lookups: []
|
||||
roles:
|
||||
- name: location
|
||||
id: 699151467676773
|
||||
keywords: []
|
||||
- name: wit$phone_number
|
||||
id: 535a810c-3885-41fe-a36f-3adfff96d72c
|
||||
lookups: []
|
||||
roles:
|
||||
- name: phone_number
|
||||
id: 535400004231868
|
||||
keywords: []
|
||||
- name: wit$quantity
|
||||
id: 53d850ab-b009-4da5-9201-180aa916c5d4
|
||||
lookups: []
|
||||
roles:
|
||||
- name: quantity
|
||||
id: 390632932585329
|
||||
keywords: []
|
||||
- name: wit$temperature
|
||||
id: 535a80f3-766b-49e7-bfb9-f4dedafc10aa
|
||||
lookups: []
|
||||
roles:
|
||||
- name: temperature
|
||||
id: 603855104116898
|
||||
keywords: []
|
||||
- name: wit$url
|
||||
id: 535a80e6-23ec-43de-9c60-ed1d7f450157
|
||||
lookups: []
|
||||
roles:
|
||||
- name: url
|
||||
id: 2978877842431482
|
||||
keywords: []
|
||||
- name: wit$volume
|
||||
id: 5a0cd7ec-754d-4ad5-abfa-413275a5f674
|
||||
lookups: []
|
||||
roles:
|
||||
- name: volume
|
||||
id: 358779385927032
|
||||
keywords: []
|
||||
traits:
|
||||
- name: wit$bye
|
||||
id: 5900cc2e-09ed-4764-800c-11e7566acfac
|
||||
values:
|
||||
- id: 955a38ae-f188-46ba-ab6d-4988c5a4bea6
|
||||
value: true
|
||||
- name: wit$greetings
|
||||
id: 5900cc2d-41b7-45b2-b21f-b950d3ae3c5c
|
||||
values:
|
||||
- id: 547401529279585
|
||||
value: true
|
||||
- name: wit$sentiment
|
||||
id: 5ac2b50a-44e4-466e-9d49-bad6bd40092c
|
||||
values:
|
||||
- id: 561371444570330
|
||||
value: negative
|
||||
- id: 1621429681354257
|
||||
value: neutral
|
||||
- id: 2522989351346070
|
||||
value: positive
|
||||
- name: wit$thanks
|
||||
id: 5900cc2d-867c-4bf0-beb6-ef6e6bf45ca5
|
||||
values:
|
||||
- id: e5cce196-9948-420c-a9fb-9c2fd201adaf
|
||||
value: true
|
||||
voices:
|
||||
- name: Cael
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Cam
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Carl
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Charlie
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- fast
|
||||
- projected
|
||||
- name: Cody
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Connor
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Cooper
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Prospector
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- name: Railey
|
||||
locale: en_US
|
||||
gender: female
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Rebecca
|
||||
locale: en_US
|
||||
gender: female
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Remi
|
||||
locale: en_US
|
||||
gender: female
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Rubie
|
||||
locale: en_US
|
||||
gender: female
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Vampire
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Colin
|
||||
locale: en_CA
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Rosie
|
||||
locale: en_CA
|
||||
gender: female
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
composer:
|
||||
canvases: []
|
||||
_configurationId: 74f17110584875d438c76cba2242da14
|
||||
timeoutMS: 10000
|
||||
endpointConfiguration:
|
||||
_uriScheme:
|
||||
_authority:
|
||||
_port: 0
|
||||
_witApiVersion:
|
||||
_message:
|
||||
_speech:
|
||||
_dictation:
|
||||
_synthesize:
|
||||
_event:
|
||||
_converse:
|
||||
isDemoOnly: 1
|
||||
useConduit: 0
|
||||
_manifestLocalPath:
|
||||
excludedAssemblies: []
|
||||
relaxedResolution: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b48b6ce9fd2c0eb448b29ab66a197ef8
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef1b718734ecc3f44a54c97b4827292c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: b68ed34b82d7ad243968eee45e798c6c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 480a73091186d9c4f8d9588adca7e45e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "Meta.Voice.Samples.BuiltInTimer",
|
||||
"references": [
|
||||
"GUID:4504b1a6e0fdcc3498c30b266e4a63bf",
|
||||
"GUID:1c28d8b71ced07540b7c271537363cc6"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b409cfa88b1012c48b47bf2ac9340e6d
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
* 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 UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Meta.WitAi;
|
||||
|
||||
namespace Meta.Voice.Samples.BuiltInTimer
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a countdown timer.
|
||||
/// </summary>
|
||||
public class TimerController : MonoBehaviour
|
||||
{
|
||||
private double _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[] timesUpSounds;
|
||||
|
||||
// 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("Your timer is complete.");
|
||||
AudioClip timesUpSfx = timesUpSounds[UnityEngine.Random.Range(0, timesUpSounds.Length)];
|
||||
AudioSource.PlayClipAtPoint(timesUpSfx, 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)
|
||||
{
|
||||
VLog.W("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).");
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 double GetRemainingTime()
|
||||
{
|
||||
return _time;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns time in the format of min:sec.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetFormattedTimeFromSeconds()
|
||||
{
|
||||
if (_time >= TimeSpan.MaxValue.TotalSeconds)
|
||||
{
|
||||
_time = TimeSpan.MaxValue.TotalSeconds - 1;
|
||||
Log("Error: Hit max time");
|
||||
}
|
||||
TimeSpan span = TimeSpan.FromSeconds(_time);
|
||||
return $"{Math.Floor(span.TotalHours)}:{span.Minutes:00}:{span.Seconds:00}.{Math.Floor(span.Milliseconds/100f)}";
|
||||
}
|
||||
|
||||
/// <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 double time)
|
||||
{
|
||||
time = _time;
|
||||
if (entityValues.Length > 0 && double.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf89088f719e0164b9e096a3394188b4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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 UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Meta.Voice.Samples.BuiltInTimer
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5cbeedeedc01b2419d881ef197ef2d7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da5e3dfd616a4ef4694099fcf0a28f5a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e8c3d9b51144e04a8fc14e65cc677d3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,142 @@
|
||||
%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: Chess With Conduit - WitConfiguration
|
||||
m_EditorClassIdentifier:
|
||||
_clientAccessToken: GV4WSCFK2RIVVTWSPWQDYZGJILZROSTO
|
||||
_appInfo:
|
||||
name: chessboard
|
||||
id: 463950519194166
|
||||
lang: en
|
||||
isPrivate: 0
|
||||
createdAt: 2023-03-06T09:54:33-0800
|
||||
trainingStatus: 1
|
||||
lastTrainDuration: 26
|
||||
lastTrainedAt: 2023-03-06T10:31:11-0800
|
||||
nextTrainAt: 2023-03-06T10:30:45-0800
|
||||
intents:
|
||||
- id: 148519308100093
|
||||
name: MoveChessPiece
|
||||
entities:
|
||||
- name: letter:letter
|
||||
id: 2773029599516990
|
||||
- name: number:number
|
||||
id: 892768801945847
|
||||
entities:
|
||||
- name: letter
|
||||
id: 974441083986802
|
||||
lookups:
|
||||
- free-text
|
||||
- keywords
|
||||
roles:
|
||||
- name: letter
|
||||
id: 2773029599516990
|
||||
keywords:
|
||||
- keyword: A
|
||||
synonyms:
|
||||
- a
|
||||
- keyword: B
|
||||
synonyms:
|
||||
- b
|
||||
- name: number
|
||||
id: 588032953204094
|
||||
lookups:
|
||||
- free-text
|
||||
- keywords
|
||||
roles:
|
||||
- name: number
|
||||
id: 892768801945847
|
||||
keywords:
|
||||
- keyword: Eight
|
||||
synonyms:
|
||||
- 8
|
||||
- eight
|
||||
- keyword: One
|
||||
synonyms:
|
||||
- 1
|
||||
- One
|
||||
- keyword: Three
|
||||
synonyms:
|
||||
- 3
|
||||
- Three
|
||||
- three
|
||||
- keyword: Two
|
||||
synonyms:
|
||||
- 2
|
||||
- Two
|
||||
- keyword: Zero
|
||||
synonyms:
|
||||
- 4
|
||||
- four
|
||||
traits: []
|
||||
voices:
|
||||
- name: Charlie
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- fast
|
||||
- projected
|
||||
- name: Cooper
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Prospector
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- name: Rebecca
|
||||
locale: en_US
|
||||
gender: female
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Vampire
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
composer:
|
||||
canvases: []
|
||||
_configurationId: 4e21a24e472ab684e84db753427d5687
|
||||
timeoutMS: 10000
|
||||
endpointConfiguration:
|
||||
_uriScheme:
|
||||
_authority:
|
||||
_port: 0
|
||||
_witApiVersion:
|
||||
_message:
|
||||
_speech:
|
||||
_dictation:
|
||||
_synthesize:
|
||||
_event:
|
||||
_converse:
|
||||
isDemoOnly: 1
|
||||
useConduit: 1
|
||||
_manifestLocalPath: ConduitManifest-63301a14-cdfe-465a-91c0-0d8db67feb7f.json
|
||||
excludedAssemblies:
|
||||
- Meta.WitAi.Samples, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
relaxedResolution: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a0bfe41fa00a484b82cb39a8fd9fb8b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc6c1dc4788d56e40bd6ed2286344a1b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b4bfaa5f7cf75a46bf603ef60aac7a9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: CheckerBoard
|
||||
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: 4, y: 4}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 2800000, guid: fc1c94a75e9abf7469bf12e851016078, type: 3}
|
||||
m_Scale: {x: 4, y: 4}
|
||||
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: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55e5d3ed5e2d85a40ac9a8107da7125a
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: CheckerPiece
|
||||
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: 4, y: 4}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 4, y: 4}
|
||||
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}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d566704f50ec39439e7a2ee5f518b44
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: ChessSkybox
|
||||
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: 3d39282ced021cb4c9a7a4e4250201a9
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
# Restoring Wit.ai app from zip file
|
||||
|
||||
To get the chessboard demo app working, you need to train wit.ai with proper intents. The easiest way is to use the backup zip file provided in the demo folder.
|
||||
|
||||
- Navigate to https://wit.ai/apps
|
||||
|
||||
- Click on New App
|
||||
|
||||
- From the openned dialogue, click on Browse and pick "Chess Demo - Wit.ai Config.zip" from the Demo/Data folder.
|
||||
|
||||
- Now navigate to the Management -> Settings and copy the server token and paste it inside "Chess Demo with Conduit- WitConfiguration" in Unity Editor.
|
||||
|
||||
- You can now play the scene and move the chess piece using your voice.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e1c7ba90f09a004ca37c528183f2bc8
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee09502e87e8dc14a9d7eb7a408fc541
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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.Conduit;
|
||||
|
||||
[assembly:ConduitAssembly]
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b01e71cd2c3accd48a3a3b6c3a4c5609
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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.Conduit;
|
||||
using Meta.WitAi;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Meta.Voice.Samples.Chess
|
||||
{
|
||||
public class ChessBoardController : MonoBehaviour
|
||||
{
|
||||
public GameObject letters;
|
||||
public GameObject numbers;
|
||||
public GameObject chessPiece;
|
||||
public UnityEngine.UI.Text errorText;
|
||||
private Vector3 _targetPosition;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_targetPosition = chessPiece.transform.position;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
chessPiece.transform.position = Vector3.Lerp(chessPiece.transform.position, _targetPosition, Time.deltaTime);
|
||||
}
|
||||
|
||||
public enum ChessBoardLetter
|
||||
{
|
||||
A,
|
||||
B,
|
||||
C,
|
||||
D,
|
||||
E,
|
||||
F,
|
||||
G,
|
||||
H
|
||||
}
|
||||
[MatchIntent("MoveChessPiece")]
|
||||
public void MoveChessPiece(ChessBoardLetter letter, int number)
|
||||
{
|
||||
Debug.Log("Move chess piece to " + letter + number);
|
||||
|
||||
_targetPosition = new Vector3(letters.transform.GetChild((int)letter).position.x, _targetPosition.y,
|
||||
numbers.transform.GetChild(number - 1).position.z);
|
||||
|
||||
}
|
||||
|
||||
[HandleEntityResolutionFailure]
|
||||
public void OnHandleEntityResolutionFailure(string intent , Exception ex)
|
||||
{
|
||||
Debug.Log("Failed to resolve parameter for intent " + intent + " with error " + ex.Message);
|
||||
errorText.text = ex.Message;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86bf99f3b962bc4438f170a19ff653fd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "Meta.Voice.Samples.Chess",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:4504b1a6e0fdcc3498c30b266e4a63bf",
|
||||
"GUID:e545cc0678493234a9368f4e470c29e8",
|
||||
"GUID:f02292e638368584080af0193f81ff5c",
|
||||
"GUID:1c28d8b71ced07540b7c271537363cc6"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5dee22db95ad4c6499562cbedf95705c
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57e12d0de18f60f43929bff1d0221e0b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 315 B |
@@ -0,0 +1,92 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc1c94a75e9abf7469bf12e851016078
|
||||
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: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
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,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41762f995bc43fd4c9fbd54f8afcf881
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,174 @@
|
||||
%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: Light Traits - WitConfiguration
|
||||
m_EditorClassIdentifier:
|
||||
_clientAccessToken: UNAWXMYICVVMMZWJL2RHKEXPXL6J6HRX
|
||||
_appInfo:
|
||||
name: traits_demo
|
||||
id: 378845660994729
|
||||
lang: en
|
||||
isPrivate: 0
|
||||
createdAt: 2022-08-15T15:39:23-0700
|
||||
trainingStatus: 1
|
||||
lastTrainDuration: 1129
|
||||
lastTrainedAt: 2022-08-26T00:53:27-0700
|
||||
nextTrainAt: 2022-08-26T00:34:38-0700
|
||||
intents:
|
||||
- id: 3313618735625337
|
||||
name: wit_change_state
|
||||
entities:
|
||||
- name: wit_object:wit_object
|
||||
id: 858948758418423
|
||||
entities:
|
||||
- name: Color
|
||||
id: 1234442204087163
|
||||
lookups:
|
||||
- free-text
|
||||
- keywords
|
||||
roles:
|
||||
- name: Color
|
||||
id: 1873569336336818
|
||||
keywords:
|
||||
- keyword: Black
|
||||
synonyms: []
|
||||
- keyword: Blue
|
||||
synonyms: []
|
||||
- keyword: Brown
|
||||
synonyms: []
|
||||
- keyword: Gray
|
||||
synonyms: []
|
||||
- keyword: Green
|
||||
synonyms: []
|
||||
- keyword: Orange
|
||||
synonyms: []
|
||||
- keyword: Pink
|
||||
synonyms: []
|
||||
- keyword: Purple
|
||||
synonyms: []
|
||||
- keyword: Red
|
||||
synonyms: []
|
||||
- keyword: White
|
||||
synonyms: []
|
||||
- keyword: Yellow
|
||||
synonyms: []
|
||||
- name: LightState
|
||||
id: 5938964576180357
|
||||
lookups:
|
||||
- free-text
|
||||
- keywords
|
||||
roles:
|
||||
- name: LightState
|
||||
id: 849333606300667
|
||||
keywords:
|
||||
- keyword: Off
|
||||
synonyms: []
|
||||
- keyword: On
|
||||
synonyms: []
|
||||
- name: Shape
|
||||
id: 847477343210682
|
||||
lookups:
|
||||
- free-text
|
||||
- keywords
|
||||
roles:
|
||||
- name: Shape
|
||||
id: 1202784640666618
|
||||
keywords:
|
||||
- keyword: Capsule
|
||||
synonyms: []
|
||||
- keyword: Cube
|
||||
synonyms: []
|
||||
- keyword: Cylinder
|
||||
synonyms: []
|
||||
- keyword: Sphere
|
||||
synonyms: []
|
||||
- name: wit_object
|
||||
id: 584680556610702
|
||||
lookups:
|
||||
- free-text
|
||||
- keywords
|
||||
roles:
|
||||
- name: wit_object
|
||||
id: 858948758418423
|
||||
keywords:
|
||||
- keyword: light
|
||||
synonyms:
|
||||
- light
|
||||
traits:
|
||||
- name: wit$on_off
|
||||
id: 535a80f0-6922-4680-b678-0576f248cdcc
|
||||
values:
|
||||
- id: 2701187510165547
|
||||
value: off
|
||||
- id: 882247432292479
|
||||
value: on
|
||||
voices:
|
||||
- name: Charlie
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- fast
|
||||
- projected
|
||||
- name: Cooper
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Prospector
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- name: Rebecca
|
||||
locale: en_US
|
||||
gender: female
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Vampire
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
composer:
|
||||
canvases: []
|
||||
_configurationId: 4d0b4b78-ad03-4294-8500-3054d1acfeb0
|
||||
timeoutMS: 10000
|
||||
endpointConfiguration:
|
||||
_uriScheme:
|
||||
_authority:
|
||||
_port: 0
|
||||
_witApiVersion:
|
||||
_message:
|
||||
_speech:
|
||||
_dictation:
|
||||
_synthesize:
|
||||
_event:
|
||||
_converse:
|
||||
isDemoOnly: 1
|
||||
useConduit: 0
|
||||
_manifestLocalPath: ConduitManifest-565ac746-634c-4383-80a1-c35291949d85.json
|
||||
excludedAssemblies: []
|
||||
relaxedResolution: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8ed8d273aaa2224fb3b686d748e6133
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6550828a620ba34aba5738d783f1006
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1cf8a4e28ca69c44b91ac1333aca570
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,83 @@
|
||||
%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: LightOff
|
||||
m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
stringTagMap:
|
||||
RenderType: Transparent
|
||||
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}
|
||||
- _SpecGlossMap:
|
||||
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: 10
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 3
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.3529412}
|
||||
- _EmissionColor: {r: 0.24313726, g: 2, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4f46a0758bdd324b8f3a941cd6e0038
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,83 @@
|
||||
%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: LightOn
|
||||
m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION
|
||||
m_LightmapFlags: 1
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3000
|
||||
stringTagMap:
|
||||
RenderType: Transparent
|
||||
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}
|
||||
- _SpecGlossMap:
|
||||
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: 10
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 3
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.72156864}
|
||||
- _EmissionColor: {r: 1.3193302, g: 1.5595481, b: 0.1691963, a: 1}
|
||||
- _SpecColor: {r: 0.6603774, g: 0.6603774, b: 0.6603774, a: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef2fb0acd0979394e9c74e0f2dc8adb1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: 9065205a99a831f459fb0d94f2fd57f7
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14a006f521b57cb499c6ab57623caaee
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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 Meta.WitAi.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Meta.Voice.Samples.LightTraits
|
||||
{
|
||||
public class LightSwitch : MonoBehaviour
|
||||
{
|
||||
[Tooltip("Renderers to apply materials to")]
|
||||
[SerializeField] private Renderer[] _renderers;
|
||||
|
||||
[Tooltip("Materials to be applied when the light is off")]
|
||||
[SerializeField] private Material[] _offMaterials;
|
||||
[Tooltip("Materials to be applied when the light is on")]
|
||||
[SerializeField] private Material[] _onMaterials;
|
||||
|
||||
// Whether currently on or not
|
||||
public bool IsOn { get; private set; }
|
||||
|
||||
// Trait data
|
||||
public const string TRAIT_ID = "wit$on_off";
|
||||
public const string TRAIT_ON_VALUE = "on";
|
||||
|
||||
// Disable light on start
|
||||
private void OnEnable()
|
||||
{
|
||||
SetLight(false);
|
||||
}
|
||||
|
||||
// On response callback
|
||||
public void OnResponse(WitResponseNode commandResult)
|
||||
{
|
||||
// Check for trait value
|
||||
var traitValue = commandResult.GetTraitValue(TRAIT_ID);
|
||||
if (string.IsNullOrEmpty(traitValue))
|
||||
{
|
||||
Debug.LogWarning($"No value found for trait: {TRAIT_ID}");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get value
|
||||
bool isOn = string.Equals(traitValue, TRAIT_ON_VALUE);
|
||||
if (isOn != IsOn)
|
||||
{
|
||||
SetLight(isOn);
|
||||
}
|
||||
}
|
||||
|
||||
// Set light
|
||||
public void SetLight(bool toOn)
|
||||
{
|
||||
IsOn = toOn;
|
||||
foreach (var renderer in _renderers)
|
||||
{
|
||||
renderer.materials = toOn ? _onMaterials : _offMaterials;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92b7b397f9559ef4cbd478d760912873
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "Meta.Voice.Samples.LightTraits",
|
||||
"references": [
|
||||
"GUID:4504b1a6e0fdcc3498c30b266e4a63bf",
|
||||
"GUID:1c28d8b71ced07540b7c271537363cc6"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac951830c89a0234c9b864f11aa2ae73
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f474c827bf0fc44db51a4b349dc195b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa5b1e45038614147909d00d7914e82b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
%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: Live Understanding - WitConfiguration
|
||||
m_EditorClassIdentifier:
|
||||
_clientAccessToken: JYSZFUVTNXFZ4N3LAHJMDS6JOET2IBVP
|
||||
_appInfo:
|
||||
name: voicesdk_samples_shapes
|
||||
id: 04b6d9fc-60b7-4d9e-8473-9290b9d1243f
|
||||
lang: en
|
||||
isPrivate: 0
|
||||
createdAt: 2023-04-04T10:35:19-0700
|
||||
trainingStatus: 1
|
||||
lastTrainDuration: 36
|
||||
lastTrainedAt: 2023-04-04T10:36:17-0700
|
||||
nextTrainAt: 2023-04-04T10:35:41-0700
|
||||
intents:
|
||||
- id: 196347333139222
|
||||
name: change_color
|
||||
entities:
|
||||
- name: color:color
|
||||
id: 629054192387147
|
||||
- name: shape:shape
|
||||
id: 239839848416213
|
||||
entities:
|
||||
- name: color
|
||||
id: 183423817885903
|
||||
lookups:
|
||||
- free-text
|
||||
- keywords
|
||||
roles:
|
||||
- name: color
|
||||
id: 629054192387147
|
||||
keywords:
|
||||
- keyword: black
|
||||
synonyms:
|
||||
- black
|
||||
- keyword: blue
|
||||
synonyms:
|
||||
- blue
|
||||
- keyword: brown
|
||||
synonyms:
|
||||
- brown
|
||||
- keyword: gold
|
||||
synonyms:
|
||||
- gold
|
||||
- keyword: green
|
||||
synonyms:
|
||||
- green
|
||||
- keyword: magenta
|
||||
synonyms:
|
||||
- magenta
|
||||
- keyword: maroon
|
||||
synonyms:
|
||||
- maroon
|
||||
- red
|
||||
- keyword: orange
|
||||
synonyms:
|
||||
- orange
|
||||
- keyword: pink
|
||||
synonyms:
|
||||
- pink
|
||||
- keyword: purple
|
||||
synonyms:
|
||||
- purple
|
||||
- keyword: red
|
||||
synonyms:
|
||||
- red
|
||||
- keyword: violet
|
||||
synonyms:
|
||||
- violet
|
||||
- keyword: white
|
||||
synonyms:
|
||||
- white
|
||||
- keyword: yellow
|
||||
synonyms:
|
||||
- yellow
|
||||
- name: shape
|
||||
id: 2277400329106527
|
||||
lookups:
|
||||
- keywords
|
||||
roles:
|
||||
- name: shape
|
||||
id: 239839848416213
|
||||
keywords:
|
||||
- keyword: capsule
|
||||
synonyms:
|
||||
- capsule
|
||||
- keyword: cube
|
||||
synonyms:
|
||||
- cube
|
||||
- square
|
||||
- keyword: cylinder
|
||||
synonyms:
|
||||
- cylinder
|
||||
- tube
|
||||
- keyword: sphere
|
||||
synonyms:
|
||||
- ball
|
||||
- sphere
|
||||
traits: []
|
||||
voices:
|
||||
- name: Charlie
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- fast
|
||||
- projected
|
||||
- name: Cooper
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Prospector
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- name: Rebecca
|
||||
locale: en_US
|
||||
gender: female
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Vampire
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
composer:
|
||||
canvases: []
|
||||
_configurationId: 4e21a24e472ab684e84db753427d5687
|
||||
timeoutMS: 10000
|
||||
endpointConfiguration:
|
||||
_uriScheme:
|
||||
_authority:
|
||||
_port: 0
|
||||
_witApiVersion:
|
||||
_message:
|
||||
_speech:
|
||||
_dictation:
|
||||
_synthesize:
|
||||
_event:
|
||||
_converse:
|
||||
isDemoOnly: 1
|
||||
useConduit: 0
|
||||
_manifestLocalPath:
|
||||
excludedAssemblies:
|
||||
- Oculus.Voice.Demo, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
- Meta.WitAi.Samples, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
relaxedResolution: 0
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0e2e0312d2a4094e8ec9d778f08e326
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39670f1c7d5f53949b4cbbd6ae757ba8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: feb647f55272ed243b403e8d49d2b78d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: c308d59ea4c8e9b40a439c30d47d6089
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: cb59a6597e9b4674c91427326a27be17
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec6d4a3244d6e6d4488431c42f74acd6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* 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 Meta.WitAi.Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Meta.Voice.Samples.LiveUnderstanding
|
||||
{
|
||||
public class LiveUnderstandingColorChanger : MonoBehaviour
|
||||
{
|
||||
[Tooltip("Changes the color of all renderers inside this container")]
|
||||
[SerializeField] private Transform _container;
|
||||
|
||||
// Constants
|
||||
private const string COLOR_SET_INTENT_ID = "change_color";
|
||||
private const string COLOR_ENTITY_ID = "color:color";
|
||||
|
||||
// On validate callback
|
||||
public void OnValidatePartialResponse(VoiceSession sessionData)
|
||||
{
|
||||
string intentName = sessionData.response.GetIntentName();
|
||||
if (string.Equals(intentName, COLOR_SET_INTENT_ID))
|
||||
{
|
||||
string[] colorNames = sessionData.response.GetAllEntityValues(COLOR_ENTITY_ID);
|
||||
if (colorNames != null && colorNames.Length > 0)
|
||||
{
|
||||
OnValidateColorSet(sessionData, colorNames[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Validate & set color
|
||||
public void OnValidateColorSet(VoiceSession sessionData, string color)
|
||||
{
|
||||
Color c;
|
||||
if (TryGetColor(color, out c))
|
||||
{
|
||||
SetColor(c);
|
||||
sessionData.validResponse = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Try to get a color
|
||||
private bool TryGetColor(string colorName, out Color color)
|
||||
{
|
||||
// Check default
|
||||
if (ColorUtility.TryParseHtmlString(colorName, out color))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Failed
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set color
|
||||
public void SetColor(Color newColor)
|
||||
{
|
||||
Renderer[] renderers = _container.GetComponentsInChildren<Renderer>(true);
|
||||
foreach (var r in renderers)
|
||||
{
|
||||
r.material.color = newColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 225433a0c6686a24e85a3ab0e1d0630e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "Meta.Voice.Samples.LiveUnderstanding",
|
||||
"references": [
|
||||
"GUID:4504b1a6e0fdcc3498c30b266e4a63bf",
|
||||
"GUID:1c28d8b71ced07540b7c271537363cc6"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: baaa3b50d57e56447bac374c0e7aa2f2
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77fe7d1f9e04f6a4d83dd93fd46c042c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ecc866ba3439a74a84f9c5b4ac031a3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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:
|
||||
@@ -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:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e486573126110904f800cea70d58af68
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41f218692e78f7a4eb1d7f60d6bb8c03
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,173 @@
|
||||
%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 - WitConfiguration
|
||||
m_EditorClassIdentifier:
|
||||
_clientAccessToken: JYSZFUVTNXFZ4N3LAHJMDS6JOET2IBVP
|
||||
_appInfo:
|
||||
name: voicesdk_samples_shapes
|
||||
id: 04b6d9fc-60b7-4d9e-8473-9290b9d1243f
|
||||
lang: en
|
||||
isPrivate: 0
|
||||
createdAt: 2023-04-04T10:35:19-0700
|
||||
trainingStatus: 1
|
||||
lastTrainDuration: 36
|
||||
lastTrainedAt: 2023-04-04T10:36:17-0700
|
||||
nextTrainAt: 2023-04-04T10:35:41-0700
|
||||
intents:
|
||||
- id: 196347333139222
|
||||
name: change_color
|
||||
entities:
|
||||
- name: color:color
|
||||
id: 629054192387147
|
||||
- name: shape:shape
|
||||
id: 239839848416213
|
||||
entities:
|
||||
- name: color
|
||||
id: 183423817885903
|
||||
lookups:
|
||||
- free-text
|
||||
- keywords
|
||||
roles:
|
||||
- name: color
|
||||
id: 629054192387147
|
||||
keywords:
|
||||
- keyword: black
|
||||
synonyms:
|
||||
- black
|
||||
- keyword: blue
|
||||
synonyms:
|
||||
- blue
|
||||
- keyword: brown
|
||||
synonyms:
|
||||
- brown
|
||||
- keyword: gold
|
||||
synonyms:
|
||||
- gold
|
||||
- keyword: green
|
||||
synonyms:
|
||||
- green
|
||||
- keyword: magenta
|
||||
synonyms:
|
||||
- magenta
|
||||
- keyword: maroon
|
||||
synonyms:
|
||||
- maroon
|
||||
- red
|
||||
- keyword: orange
|
||||
synonyms:
|
||||
- orange
|
||||
- keyword: pink
|
||||
synonyms:
|
||||
- pink
|
||||
- keyword: purple
|
||||
synonyms:
|
||||
- purple
|
||||
- keyword: red
|
||||
synonyms:
|
||||
- red
|
||||
- keyword: violet
|
||||
synonyms:
|
||||
- violet
|
||||
- keyword: white
|
||||
synonyms:
|
||||
- white
|
||||
- keyword: yellow
|
||||
synonyms:
|
||||
- yellow
|
||||
- name: shape
|
||||
id: 2277400329106527
|
||||
lookups:
|
||||
- keywords
|
||||
roles:
|
||||
- name: shape
|
||||
id: 239839848416213
|
||||
keywords:
|
||||
- keyword: capsule
|
||||
synonyms:
|
||||
- capsule
|
||||
- keyword: cube
|
||||
synonyms:
|
||||
- cube
|
||||
- square
|
||||
- keyword: cylinder
|
||||
synonyms:
|
||||
- cylinder
|
||||
- tube
|
||||
- keyword: sphere
|
||||
synonyms:
|
||||
- ball
|
||||
- sphere
|
||||
traits: []
|
||||
voices:
|
||||
- name: Charlie
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- fast
|
||||
- projected
|
||||
- name: Cooper
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Prospector
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- name: Rebecca
|
||||
locale: en_US
|
||||
gender: female
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
- name: Vampire
|
||||
locale: en_US
|
||||
gender: male
|
||||
styles:
|
||||
- default
|
||||
- soft
|
||||
- formal
|
||||
- fast
|
||||
- projected
|
||||
composer:
|
||||
canvases: []
|
||||
_configurationId: 4e21a24e472ab684e84db753427d5687
|
||||
timeoutMS: 10000
|
||||
endpointConfiguration:
|
||||
_uriScheme:
|
||||
_authority:
|
||||
_port: 0
|
||||
_witApiVersion:
|
||||
_message:
|
||||
_speech:
|
||||
_dictation:
|
||||
_synthesize:
|
||||
_event:
|
||||
_converse:
|
||||
isDemoOnly: 1
|
||||
useConduit: 0
|
||||
_manifestLocalPath: ConduitManifest-63301a14-cdfe-465a-91c0-0d8db67feb7f.json
|
||||
excludedAssemblies:
|
||||
- Oculus.Voice.Demo, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
- Meta.WitAi.Samples, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
relaxedResolution: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8e387d02c2ef0c4e8778528ce21524b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2afa732d18be6e43943396fdcda205d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 474d162ab9c9beb47803d68e1e4718ef
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user