Add ViaggioAI Package and BTC Tasks for Speech Handling

dev
Nadine Ganz 2024-09-16 20:37:29 +02:00
parent 4b686c057a
commit 25116cb8ff
219 changed files with 207681 additions and 9 deletions

View File

@ -3,7 +3,19 @@
//RunTree("32_Grotto_Kueche_Intro")
//RunTree("32_Grotto_Kueche_Zwiebeln_schneiden")
// RunTree("32_Grotto_Kueche_alles_gefunden")
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
//RunTree("32_Grotto_Kueche_Zusammen_Kochen")
RunTree("32_Grotto_Chatbot_Test")
}
}
Tree("32_Grotto_Chatbot_Test") {
Composite(Sequence) {
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Nachfrage_Nonna_Grotto.2", "Ich helfe in der Küche.")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Nachfrage_Nonna_Grotto.4", "Ich warte im Garten auf sie.")
BTC.StartSpeechIntentRecognition()
BTC.SpeechIntentRecognized()
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
BTC.GetKeyDown("Return")
}
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,35 @@
fileFormatVersion: 2
guid: 793d31653752c3f459437e2019654e61
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

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

View File

@ -0,0 +1,35 @@
fileFormatVersion: 2
guid: 584bd1bb0e6303749833eec0f6b9fa42
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

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

View File

@ -0,0 +1,35 @@
fileFormatVersion: 2
guid: 09cdbcc422ef8a742a0f004bbb66e939
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@ -609,8 +609,148 @@ public class BTC : MonoBehaviour {
#endif
#endregion
#region SpeechRecognicer
private ViaggioAIManager _speechMng { get { return ViaggioAIManager.Instance; } }
private RequestDataModel _requestDataModel = new RequestDataModel();
private string _recognizedIntentID = "";
private bool _onIntentRecognitionInitiatedEventTriggered = false;
private bool _onIntentRecognitionSucceededEventTriggered = false;
private bool _onUserSpeechInputStartedEventTriggered = false;
private bool _onIntentRecognitionFailedEventTriggered = false;
private void OnEnable()
{
_speechMng.OnIntentRecognitionInitiatedEvent += IntentRecognitionInitiatedEventHandler;
_speechMng.OnIntentRecognitionSucceededEvent += IntentRecognitionSucceededEventHandler;
_speechMng.OnUserSpeechInputStartedEvent += UserSpeechInputStartedEventHandler;
_speechMng.OnIntentRecognitionFailedEvent += IntentRecognitionFailedEventHandler;
}
private void IntentRecognitionInitiatedEventHandler(object sender, bool e)
{
_onIntentRecognitionInitiatedEventTriggered = true;
}
private void IntentRecognitionSucceededEventHandler(object sender, string intentID)
{
_onIntentRecognitionSucceededEventTriggered = true;
_recognizedIntentID = intentID;
}
private void UserSpeechInputStartedEventHandler(object sender, object e)
{
_onUserSpeechInputStartedEventTriggered = true;
}
private void IntentRecognitionFailedEventHandler(object sender, bool e)
{
_onIntentRecognitionFailedEventTriggered = true;
}
[Task]
public void AddPossbileSpeechIntent(string intentID, string intentText)
{
switch (Task.getState)
{
case NodeState.FirstRun:
_requestDataModel.PossibleIntents.Add(intentID, intentText);
foreach(var r in _requestDataModel.PossibleIntents)
{
Debug.Log($"Possible Intent: {r.Key}, {r.Value}");
}
Task.SetSucceeded();
break;
case NodeState.Aborting:
break;
}
}
[Task]
public void StartSpeechIntentRecognition()
{
if (Task.getState == NodeState.FirstRun)
{
_onUserSpeechInputStartedEventTriggered = false;
_speechMng.StartIntentRecognition(_requestDataModel.PossibleIntents);
}
if (_onUserSpeechInputStartedEventTriggered)
{
Task.SetSucceeded();
return;
}
}
[Task]
public void SpeechIntentRecognized()
{
if (Task.getState == NodeState.FirstRun)
{
_onIntentRecognitionSucceededEventTriggered = false;
_onIntentRecognitionFailedEventTriggered = false;
}
if (_onIntentRecognitionSucceededEventTriggered)
{
Task.SetSucceeded();
Debug.Log("SpeechIntentRecognized successfull");
return;
}
if (_onIntentRecognitionFailedEventTriggered)
{
Task.SetFailed();
Debug.Log("SpeechIntentRecognized failed");
return;
}
}
[Task]
public void CompareIntentID(string intentID)
{
if ((Task.getState == NodeState.FirstRun))
{
if (_recognizedIntentID == intentID)
{
Debug.Log($"CompareIntentID {_recognizedIntentID} with {intentID} = equal");
Task.SetSucceeded();
return;
}
else
{
Debug.Log($"CompareIntentID {_recognizedIntentID} with {intentID} = not equal");
Task.SetFailed();
return;
}
}
}
[Task]
public void ClearPossbileSpeechIntents()
{
if (Task.getState == NodeState.FirstRun)
{
_requestDataModel.PossibleIntents.Clear();
Task.SetSucceeded();
return;
}
}
[Task]
public void StopSpeechIntentRecognition()
{
if (Task.getState == NodeState.FirstRun)
{
_speechMng.StopIntentRecognition();
Task.SetSucceeded();
return;
}
}
#endregion
#region Oculus Input
#if OCULUSVR_AVAILABLE
#if OCULUSVR_AVAILABLE
[Task]
public void OVRInputGetDown (string buttonName) {
if (System.Enum.TryParse(buttonName, out OVRInput.Button button)) {

View File

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

View File

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

View File

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

View File

@ -0,0 +1,35 @@
fileFormatVersion: 2
guid: bf170c216e3c106498c37e86f177f24a
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

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

View File

@ -0,0 +1,35 @@
fileFormatVersion: 2
guid: e6f53e3c23978b24d8dbdca8ead8863f
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

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

View File

@ -0,0 +1,35 @@
fileFormatVersion: 2
guid: d76fd1466b336fa4199b25cb4604770a
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

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

View File

@ -0,0 +1,35 @@
fileFormatVersion: 2
guid: bbd1cfe829188dc4ea7618390a5b898e
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

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

View File

@ -0,0 +1,35 @@
fileFormatVersion: 2
guid: f9635e4bd591f424399120539dfb9e2d
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

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

View File

@ -0,0 +1,35 @@
fileFormatVersion: 2
guid: 27e61e2024defba49b7788a42b0ed593
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1 +1 @@
2024-09-05T14:35:06.9813830Z
2024-09-13T12:37:02.1555720Z

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@ -0,0 +1,78 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Microsoft.CognitiveServices.Speech.Intent;
using UnityEngine;
public class AIServicesEvents : MonoBehaviour
{
public delegate void IntentRecognizedAction(IntentRecognitionResult intent);
public static event IntentRecognizedAction OnIntentRecognized;
public static void SendIntentRecognized(IntentRecognitionResult intent)
{
if (OnIntentRecognized != null)
OnIntentRecognized(intent);
}
public delegate void TextToAIAction(string textToSend);
public static event TextToAIAction OnTextToAI;
public static void SendTextToAI(string textToSend)
{
if (OnTextToAI != null)
OnTextToAI(textToSend);
}
public delegate void ReadTextAction(string text);
public static event ReadTextAction OnReadText;
public static void SendReadText(string text)
{
if (OnReadText != null)
OnReadText(text);
}
public delegate void StartReadAction();
public static event StartReadAction OnStartRead;
public static void SendStartRead()
{
if (OnStartRead != null)
OnStartRead();
}
public delegate void EndReadAction();
public static event EndReadAction OnEndRead;
public static void SendEndRead()
{
if (OnEndRead != null)
OnEndRead();
}
public delegate void AudioClipGeneratedAction(AudioClip clip);
public static event AudioClipGeneratedAction OnAudioClipGenerated;
public static void SendAudioClipGenerated(AudioClip clip)
{
if (OnAudioClipGenerated != null)
OnAudioClipGenerated(clip);
}
public delegate void SpeechEndedAction();
public static event SpeechEndedAction OnSpeechEnded;
public static void SendSpeechEnded()
{
if (OnSpeechEnded != null)
OnSpeechEnded();
}
public delegate void ToggleSpeechRecognitionAction(bool isOn);
public static event ToggleSpeechRecognitionAction OnToggleSpeechRecognition;
public static void SendToggleSpeechRecognition(bool isOn)
{
if (OnToggleSpeechRecognition != null)
OnToggleSpeechRecognition(isOn);
}
internal static void SendReadText(object welcomeText)
{
throw new NotImplementedException();
}
}

View File

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

View File

@ -0,0 +1,11 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[Serializable]
public struct LanguageVoice
{
public string LanguageCode;
public string VoiceName;
}

View File

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

View File

@ -0,0 +1,364 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Azure.AI.OpenAI.Assistants;
using Azure;
using System;
using System.Threading.Tasks;
using System.Linq;
#region Enums
public enum EOpenAIServiceState
{
StartingUp = 0,
WaitingForInstructionsReply = 10,
Ready = 20,
WaitingForReply = 30,
}
#endregion
public class OpenAIServices : MonoBehaviour
{
#region Inspector Properties
[Header("Config Values")]
[SerializeField]
private bool debugModeIsActive;
[SerializeField]
private bool ignoreReplyToStartInstructions;
[SerializeField]
private float clientInitDelay;
[SerializeField]
private float responsePollingInterval;
[SerializeField]
private string azureResourceUrl;
[SerializeField]
private string azureApiKey;
[SerializeField]
private string assistantModel;
[SerializeField]
private string assistantName;
[SerializeField]
private string assistantInstructions;
[SerializeField]
private string assistantStartInstructions;
#endregion
#region Public Properties
#region OpenAIServiceState
private EOpenAIServiceState? pendingStateToChangeToInMainThread = null;
private EOpenAIServiceState _openAIServiceState = EOpenAIServiceState.StartingUp;
public EOpenAIServiceState OpenAIServiceState
{
get { return this._openAIServiceState; }
set
{
if (value != this._openAIServiceState)
{
Debug.Log($"OpenAIServiceState changed, new value= {value}");
this._openAIServiceState = value;
this.OnOpenAIServiceStateChangedEvent?.Invoke(this, value);
}
}
}
public event EventHandler<EOpenAIServiceState> OnOpenAIServiceStateChangedEvent;
#endregion
#region LastBotReply
private string _lastBotReply = null;
public string LastBotReply
{
get { return this._lastBotReply; }
set
{
if (value != this._lastBotReply)
{
this.logIfInDebugMode($"LastBotReply changed, new value= {value}");
this._lastBotReply = value;
if (value != null)
{
this.OnLastBotReplyChangedEvent?.Invoke(this, value);
}
}
}
}
public event EventHandler<string> OnLastBotReplyChangedEvent;
#endregion
#region LastBotError
private string _lastBotError = null;
public string LastBotError
{
get { return this._lastBotError; }
set
{
if (value != this._lastBotError)
{
this.logIfInDebugMode($"LastBotError changed, new value= {value}");
this._lastBotError = value;
this.OnLastBotErrorChangedEvent?.Invoke(this, value);
}
}
}
public event EventHandler<string> OnLastBotErrorChangedEvent;
#endregion
#endregion
#region Private Properties
private AssistantsClient client;
private Assistant assistant;
private Response<ThreadRun> runResponse;
private AssistantThread thread;
private string lastMessageReceived = "";
private string lastTextReceived;
private string lastError;
private bool ignoreIncomingReplies = false;
#endregion
#region Framework Functions
void OnEnable()
{
this.init();
}
void Update()
{
this.doMainThreadTasks();
}
async void OnDisable()
{
await this.client.DeleteThreadAsync(this.thread.Id);
}
#endregion
#region Events
#endregion
#region Public Functions
public async void SendTextToBot(string textToSend)
{
this.logIfInDebugMode($"OpenAIServices SendTextToBot: {textToSend}");
this.LastBotReply = null;
this.LastBotError = null;
await this.send(textToSend);
}
public void Stop()
{
this.ignoreIncomingReplies = true;
}
#endregion
#region Private Functions
private async void init()
{
this.logIfInDebugMode("Init started");
this.OpenAIServiceState = EOpenAIServiceState.StartingUp;
this.client = new AssistantsClient(new Uri(this.azureResourceUrl), new AzureKeyCredential(this.azureApiKey));
await Task.Delay(TimeSpan.FromSeconds(this.clientInitDelay));
Response<Assistant> assistantResponse = await this.client.CreateAssistantAsync(
new AssistantCreationOptions(assistantModel)
{
Name = assistantName,
Instructions = assistantInstructions,
});
this.assistant = assistantResponse.Value;
Response<AssistantThread> threadResponse = await this.client.CreateThreadAsync();
this.thread = threadResponse.Value;
this.runResponse = await client.CreateRunAsync(
this.thread.Id,
new CreateRunOptions(assistant.Id)
{
AdditionalInstructions = assistantStartInstructions,
});
ThreadRun run = runResponse.Value;
this.logIfInDebugMode($"Init completed, ignoreReplyToStartInstructions={this.ignoreReplyToStartInstructions}");
this.ignoreIncomingReplies = this.ignoreReplyToStartInstructions;
this.OpenAIServiceState = EOpenAIServiceState.WaitingForInstructionsReply;
await this.listen();
}
private async Task send(string text)
{
this.logIfInDebugMode($"OpenAIServices Sending: {text} to Bot");
Response<ThreadMessage> messageResponse = await client.CreateMessageAsync(this.thread.Id, MessageRole.User, text);
ThreadMessage message = messageResponse.Value;
this.runResponse = await client.CreateRunAsync(this.thread.Id, new CreateRunOptions(assistant.Id));
ThreadRun run = this.runResponse.Value;
this.ignoreIncomingReplies = false;
this.logIfInDebugMode($"OpenAIServices {text} sent to Bot");
this.OpenAIServiceState = EOpenAIServiceState.WaitingForReply;
await this.listen();
}
private async Task<bool> listen()
{
Response<ThreadRun> run;
do
{
await Task.Delay(TimeSpan.FromSeconds(this.responsePollingInterval));
run = await this.client.GetRunAsync(this.thread.Id, this.runResponse.Value.Id);
}
while (Application.isPlaying && (run.Value.Status == RunStatus.Queued || run.Value.Status == RunStatus.InProgress));
if (run.Value.Status != RunStatus.Completed)
{
this.lastError = $"Status: {run.Value.Status}, Grund: {run.Value.LastError.Message}";
this.logIfInDebugMode($"Status: {run.Value.Status}, Code: {run.Value.LastError.Code}, Message: {run.Value.LastError.Message}");
return false;
}
else
{
Response<PageableList<ThreadMessage>> afterRunMessagesResponse = await client.GetMessagesAsync(this.thread.Id);
var messages = afterRunMessagesResponse.Value;
// Note: messages iterate from newest to oldest, with the messages[0] being the most recent
if (messages.FirstId != this.lastMessageReceived)
{
var threadMessage = messages.First();
foreach (MessageContent contentItem in threadMessage.ContentItems)
{
if (contentItem is MessageTextContent textItem)
{
if (this.ignoreIncomingReplies)
{
// Service has been stopped -> ignore reply
this.logIfInDebugMode($"Ignoring text reply from Bot: {textItem.Text}");
}
else
{
this.logIfInDebugMode($"Got text reply from Bot: {textItem.Text}");
this.lastTextReceived = textItem.Text;
}
}
else if (contentItem is MessageImageFileContent imageFileItem)
{
this.logIfInDebugMode($"Got image reply from Bot, FileId: {imageFileItem.FileId}");
}
}
if (this.OpenAIServiceState == EOpenAIServiceState.WaitingForInstructionsReply)
{
this.pendingStateToChangeToInMainThread = EOpenAIServiceState.Ready;
}
else if (this.OpenAIServiceState == EOpenAIServiceState.WaitingForReply)
{
this.pendingStateToChangeToInMainThread = EOpenAIServiceState.Ready;
}
this.lastMessageReceived = threadMessage.Id;
}
return true;
}
}
private void doMainThreadTasks()
{
if (this.pendingStateToChangeToInMainThread != null)
{
this.OpenAIServiceState = (EOpenAIServiceState)this.pendingStateToChangeToInMainThread;
this.pendingStateToChangeToInMainThread = null;
}
if (this.lastTextReceived != null)
{
this.LastBotReply = this.lastTextReceived;
this.lastTextReceived = null;
}
if (this.lastError != null)
{
this.LastBotError = this.lastError;
this.lastError = null;
}
}
private void logIfInDebugMode(string message)
{
if (!this.debugModeIsActive)
{
return;
}
Debug.Log($"(OpenAIServices) => {message}");
}
#endregion
}

View File

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

View File

@ -0,0 +1,279 @@
using System;
using Microsoft.CognitiveServices.Speech;
using Microsoft.CognitiveServices.Speech.Audio;
using UnityEngine;
#region Enums
public enum ESpeechRecognitionState
{
StartingUp = 0,
Ready = 10,
Listening = 20,
Disabled = 90,
}
#endregion
public class SpeechRecognitionService : MonoBehaviour
{
#region Inspector Properties
[Header("Config Values")]
[SerializeField]
private bool debugModeIsActive;
[SerializeField]
private string speechKey;
[SerializeField]
private string speechRegion;
[SerializeField]
private string initialRecognitionLanguageCode; // Format: "de-CH"
#endregion
#region Public Properties
#region SpeechRecognitionState
private ESpeechRecognitionState _speechRecognitionState = ESpeechRecognitionState.StartingUp;
public ESpeechRecognitionState SpeechRecognitionState
{
get { return this._speechRecognitionState; }
set
{
if (value != this._speechRecognitionState)
{
this.logIfInDebugMode($"SpeechRecognitionState changed, new value= {value}");
this._speechRecognitionState = value;
this.OnSpeechRecognitionStateChangedEvent?.Invoke(this, value);
}
}
}
public event EventHandler<ESpeechRecognitionState> OnSpeechRecognitionStateChangedEvent;
#endregion
#endregion
#region Private Properties
private object threadLocker = new object();
private SpeechConfig speechConfig;
private bool listeningRestartIsPending;
private bool invokeUserSpeechInputStartedEventIsPending;
private string pendingPartialTranscription;
private string pendingFullTranscription;
private string invokeUserSpeechInputEndedEventIsPending;
#endregion
#region Framework Functions
void OnEnable()
{
this.initialize(this.initialRecognitionLanguageCode);
}
void Update()
{
this.doMainThreadTasks();
}
void OnDisable()
{
this.SpeechRecognitionState = ESpeechRecognitionState.Disabled;
}
#endregion
#region Private Events
private void speechRecognizer_SpeechStartDetected(object sender, RecognitionEventArgs e)
{
if (this == null || this.SpeechRecognitionState != ESpeechRecognitionState.Listening)
{
// Listener was stopped before speech start was detected
return;
}
// Set invoke pending flag (to later invoke on main thread)
this.invokeUserSpeechInputStartedEventIsPending = true;
}
private void speechRecognizer_Recognizing(object sender, SpeechRecognitionEventArgs e)
{
if (this == null || this.SpeechRecognitionState != ESpeechRecognitionState.Listening)
{
// Listener was stopped before this
return;
}
// Save pending partial transcription (to later invoke on main thread)
this.pendingPartialTranscription = e?.Result?.Text;
}
#endregion
#region Public Events
public event EventHandler<bool> OnUserSpeechInputStartedEvent;
public event EventHandler<string> OnPartialTranscriptionChangedEvent;
public event EventHandler<string> OnFullTranscriptionChangedEvent;
public event EventHandler<string> OnUserSpeechInputEndedEvent;
#endregion
#region Public Functions
public async void StartListeningOnceAsync()
{
if (this.speechConfig == null)
{
Debug.LogError("Speech recognizer is not ready yet. Wait for initialize before calling StartListeningOnceAsync");
return;
}
AudioConfig audioConfigInput = AudioConfig.FromDefaultMicrophoneInput();
using (SpeechRecognizer recognizer = new SpeechRecognizer(speechConfig))
{
lock (threadLocker)
{
this.SpeechRecognitionState = ESpeechRecognitionState.Listening;
}
recognizer.SpeechStartDetected += this.speechRecognizer_SpeechStartDetected;
recognizer.Recognizing += this.speechRecognizer_Recognizing;
SpeechRecognitionResult result = await recognizer.RecognizeOnceAsync().ConfigureAwait(false);
if (this.SpeechRecognitionState != ESpeechRecognitionState.Listening)
{
// Listener was stopped before recognition finished -> unsubscribe and return
recognizer.SpeechStartDetected -= this.speechRecognizer_SpeechStartDetected;
recognizer.Recognizing -= this.speechRecognizer_Recognizing;
return;
}
// Check result
string fullTranscription = null;
if (result.Reason == ResultReason.RecognizedSpeech && !string.IsNullOrEmpty(result.Text))
{
fullTranscription = result.Text;
this.invokeUserSpeechInputEndedEventIsPending = fullTranscription;
}
else if (result.Reason == ResultReason.NoMatch)
{
this.logIfInDebugMode("SpeechIntentService NoMatch: Speech could not be recognized.");
listeningRestartIsPending = true;
}
else if (result.Reason == ResultReason.Canceled)
{
var cancellation = CancellationDetails.FromResult(result);
this.logIfInDebugMode($"SpeechIntentService Canceled: Reason={cancellation.Reason} ErrorDetails={cancellation.ErrorDetails}");
}
lock (threadLocker)
{
this.SpeechRecognitionState = ESpeechRecognitionState.Ready;
this.pendingFullTranscription = fullTranscription;
}
recognizer.SpeechStartDetected -= this.speechRecognizer_SpeechStartDetected;
recognizer.Recognizing -= this.speechRecognizer_Recognizing;
}
}
public void StopListening()
{
this.SpeechRecognitionState = ESpeechRecognitionState.Ready;
}
public void SetRecognitionLanguage(string languageCode)
{
this.initialize(languageCode);
}
#endregion
#region Private Functions
private void initialize(string languageCode)
{
this.SpeechRecognitionState = ESpeechRecognitionState.StartingUp;
this.speechConfig = SpeechConfig.FromSubscription(this.speechKey, this.speechRegion);
this.speechConfig.SpeechRecognitionLanguage = languageCode;
// Is this hack still necessary?
var audioClip = Microphone.Start(Microphone.devices[0], true, 200, 16000);
this.logIfInDebugMode($"SpeechRecognitionService initialized using microphone: {Microphone.devices[0]}");
this.SpeechRecognitionState = ESpeechRecognitionState.Ready;
}
private void doMainThreadTasks()
{
if (this.listeningRestartIsPending)
{
this.StartListeningOnceAsync();
listeningRestartIsPending = false;
}
if (this.invokeUserSpeechInputStartedEventIsPending)
{
this.OnUserSpeechInputStartedEvent?.Invoke(this, true);
this.invokeUserSpeechInputStartedEventIsPending = false;
}
if (this.pendingPartialTranscription != null)
{
this.OnPartialTranscriptionChangedEvent?.Invoke(this, this.pendingPartialTranscription);
this.pendingPartialTranscription = null;
}
if (this.pendingFullTranscription != null)
{
this.OnFullTranscriptionChangedEvent?.Invoke(this, this.pendingFullTranscription);
this.pendingFullTranscription = null;
}
if (this.invokeUserSpeechInputEndedEventIsPending != null)
{
this.OnUserSpeechInputEndedEvent?.Invoke(this, invokeUserSpeechInputEndedEventIsPending);
this.invokeUserSpeechInputEndedEventIsPending = null;
}
}
private void logIfInDebugMode(string message)
{
if (!this.debugModeIsActive)
{
return;
}
Debug.Log($"(SpeechRecognitionService) => {message}");
}
#endregion
}

View File

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

View File

@ -0,0 +1,313 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.CognitiveServices.Speech;
using Microsoft.CognitiveServices.Speech.Audio;
using UnityEngine;
#region Enums
public enum ESpeechSynthesizerState
{
StartingUp = 0,
Ready = 10,
Speaking = 20,
GeneratingClip = 30,
Disabled = 90,
}
public enum ESpeechOutputType
{
PlayDirectly = 0,
GenerateAudioClip = 10,
}
#endregion
public class SpeechSynthesizerService : MonoBehaviour
{
#region Inspector Properties
[Header("Config Values")]
[SerializeField]
private bool debugModeIsActive;
[SerializeField]
private ESpeechOutputType speechOutputType;
[SerializeField]
private string speechKey;
[SerializeField]
private string speechRegion;
[SerializeField]
[Tooltip("Format: 'de-CH'")]
private string initialSynthesisLanguage;
[SerializeField]
[Tooltip("Voice gallery: https://speech.microsoft.com/portal/voicegallery")]
private List<LanguageVoice> defaultSynthesisVoices;
[SerializeField]
private string fallbackMultilingualSynthesisVoiceName;
#endregion
#region Public Properties
#region SpeechSynthesizerState
private ESpeechSynthesizerState _speechSynthesizerState = ESpeechSynthesizerState.StartingUp;
public ESpeechSynthesizerState SpeechSynthesizerState
{
get { return this._speechSynthesizerState; }
set
{
if (value != this._speechSynthesizerState)
{
this.logIfInDebugMode($"SpeechSynthesizerState changed, new value= {value}");
this._speechSynthesizerState = value;
this.OnSpeechSynthesizerStateChangedEvent?.Invoke(this, value);
}
}
}
public event EventHandler<ESpeechSynthesizerState> OnSpeechSynthesizerStateChangedEvent;
#endregion
#region GeneratedAudioClip
private AudioClip _generatedAudioClip = null;
public AudioClip GeneratedAudioClip
{
get { return this._generatedAudioClip; }
set
{
if (value != this._generatedAudioClip)
{
this.logIfInDebugMode($"GeneratedAudioClip changed, new value= {value}");
this._generatedAudioClip = value;
this.OnGeneratedAudioClipChangedEvent?.Invoke(this, value);
}
}
}
public event EventHandler<AudioClip> OnGeneratedAudioClipChangedEvent;
#endregion
#endregion
#region Private Properties
private SpeechSynthesizer speechSynthesizer;
private SpeechConfig speechConfig;
private string activeLanguage = null;
private string activeVoice = null;
#endregion
#region Framework Functions
async void OnDisable()
{
Debug.Log("SpeechSynthesizerService disposing speechSynthesizer from OnDisable");
await this.disposeSynthesizer();
}
#endregion
#region Private Events
#endregion
#region Public Events
public event EventHandler<bool> OnSpeechOutputStartedEvent;
public event EventHandler<bool> OnSpeechOutputEndedEvent;
#endregion
#region Public Functions
public async void Synthesize(string text, string languageCode, string voiceNameOverride = null)
{
if (this.SpeechSynthesizerState == ESpeechSynthesizerState.Speaking)
{
await this.speechSynthesizer.StopSpeakingAsync();
}
await this.reInitializeIfNecessary(languageCode, voiceNameOverride);
if (this.speechOutputType == ESpeechOutputType.GenerateAudioClip)
{
this.SpeechSynthesizerState = ESpeechSynthesizerState.GeneratingClip;
}
else if (this.speechOutputType == ESpeechOutputType.PlayDirectly)
{
this.SpeechSynthesizerState = ESpeechSynthesizerState.Speaking;
this.OnSpeechOutputStartedEvent?.Invoke(this, true);
}
SpeechSynthesisResult synthesisResult = await this.speechSynthesizer.SpeakTextAsync(text);
if (this.speechOutputType == ESpeechOutputType.GenerateAudioClip)
{
// Todo add WavUtility
// this.GeneratedAudioClip = WavUtility.ToAudioClip(synthesisResult.AudioData);
}
else if (this.speechOutputType == ESpeechOutputType.PlayDirectly)
{
// Set state to SpeakingEnded to allow On
this.OnSpeechOutputEndedEvent?.Invoke(this, true);
}
this.SpeechSynthesizerState = ESpeechSynthesizerState.Ready;
}
#endregion
#region Private Functions
private async Task initialize(string languageCode, string voiceName)
{
this.logIfInDebugMode($"SpeechSynthesizerService initializing using language={languageCode} and voice={voiceName}");
if (this.speechSynthesizer != null)
{
Debug.Log("SpeechSynthesizerService disposing speechSynthesizer from initialize");
await this.disposeSynthesizer();
}
this.SpeechSynthesizerState = ESpeechSynthesizerState.StartingUp;
this.speechConfig = SpeechConfig.FromSubscription(this.speechKey, this.speechRegion);
this.speechConfig.SpeechSynthesisLanguage = languageCode;
this.speechConfig.SpeechSynthesisVoiceName = voiceName;
if (this.speechOutputType == ESpeechOutputType.GenerateAudioClip)
{
this.speechConfig.SetSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm);
}
AudioConfig audioConfigOutput = AudioConfig.FromDefaultSpeakerOutput();
if (this.speechOutputType == ESpeechOutputType.PlayDirectly)
{
this.speechSynthesizer = new SpeechSynthesizer(speechConfig, audioConfigOutput);
}
else if (this.speechOutputType == ESpeechOutputType.GenerateAudioClip)
{
this.speechSynthesizer = new SpeechSynthesizer(speechConfig, null);
}
this.activeLanguage = languageCode;
this.activeVoice = voiceName;
this.logIfInDebugMode($"SpeechSynthesizerService initialized using language={languageCode} and voice={voiceName}");
this.SpeechSynthesizerState = ESpeechSynthesizerState.Ready;
}
private string getDefaultVoiceForLanguage(string language)
{
string retVoiceName = this.fallbackMultilingualSynthesisVoiceName;
LanguageVoice? languageSpecificVoice = this.defaultSynthesisVoices.FirstOrDefault(lv => lv.LanguageCode == language);
if (!string.IsNullOrEmpty(languageSpecificVoice?.VoiceName))
{
retVoiceName = ((LanguageVoice)languageSpecificVoice).VoiceName;
}
return retVoiceName;
}
private async Task reInitializeIfNecessary(string languageCode, string voiceNameOverride)
{
bool reInitNecessary = false;
if (languageCode != this.activeLanguage)
{
// Language changed
reInitNecessary = true;
}
else
{
// Language unchanged
if (voiceNameOverride != null && voiceNameOverride != this.activeLanguage)
{
// Voice changed
reInitNecessary = true;
}
}
if (reInitNecessary)
{
string voiceName;
if (voiceNameOverride == null)
{
// No specific voice defined -> get default voice for this language
voiceName = this.getDefaultVoiceForLanguage(languageCode);
}
else
{
voiceName = voiceNameOverride;
}
await this.initialize(languageCode, voiceName);
}
}
private void logIfInDebugMode(string message)
{
if (!this.debugModeIsActive)
{
return;
}
Debug.Log($"(SpeechSynthesizerService) => {message}");
}
private async Task disposeSynthesizer()
{
if (this.speechSynthesizer == null)
{
return;
}
// Make sure speaking isn't active anymore, otherwise dispose will throw exception
await this.speechSynthesizer.StopSpeakingAsync();
while (this.SpeechSynthesizerState == ESpeechSynthesizerState.Speaking)
{
await Task.Delay(10);
}
this.activeLanguage = null;
this.activeVoice = null;
this.speechSynthesizer.Dispose();
this.speechSynthesizer = null;
this.SpeechSynthesizerState = ESpeechSynthesizerState.Disabled;
}
#endregion
}

View File

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

View File

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

View File

@ -0,0 +1,326 @@
// 04.10.2021 11:00
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
public enum PivotAxis
{
Free = 10,
X = 20,
Y = 30,
Z = 40,
XY = 50,
XZ = 60,
YZ = 70,
}
public enum EEnablingBehaviour
{
Transition = 0,
Hold = 10,
Jump = 20,
}
public class ThresholdedBillboard : MonoBehaviour
{
#region Inspector Properties
[Header("Config Values")]
[Tooltip("Specifies the axis about which the object will rotate.")]
[SerializeField]
private PivotAxis pivotAxis = PivotAxis.XY;
[Tooltip("Specifies the desired OnEnable behaviour.")]
[SerializeField]
private EEnablingBehaviour enablingBehaviour;
[Tooltip("Specifies the delay in seconds before initializing.")]
[SerializeField]
private float initDelay = 0.03f;
[Tooltip("Specifies how fast the object will rotate.")]
[SerializeField]
private float rotationSpeed = 2f;
[Tooltip("Specifies the deviation at which the object will start rotating.")]
[SerializeField]
private float startBillboardingAngle = 20f;
[Tooltip("Specifies the deviation at which the object will stop rotating.")]
[SerializeField]
private float stopBillboardingAngle = 2f;
[Tooltip("Specifies if the rotation should happen after a delay.")]
[SerializeField]
private bool isDelayedModeActive = false;
[Tooltip("Only for delayed Mode: Specifies the delay before the rotation should happen.")]
[SerializeField]
private float delayedModeDelay = 0.3f;
[Header("Scene Objects")]
[Tooltip("Specifies the target we will orient to. If no target is specified, the main camera will be used.")]
[SerializeField]
private Transform targetTransform;
[Tooltip("Specifies transforms which will be set to the same rotation.")]
[SerializeField]
private List<Transform> linkedTransforms;
#endregion
#region Public Properties
public PivotAxis PivotAxis
{
get { return pivotAxis; }
set { pivotAxis = value; }
}
/// <summary>
/// The target we will orient to. If no target is specified, the main camera will be used.
/// </summary>
public Transform TargetTransform => targetTransform;
#endregion
#region Private Properties
private bool isInitialized = false;
private Camera cam;
private Quaternion rotationFrom;
private Quaternion rotationTo;
private bool delayedRotationIsPending = false;
private float lastRotationRequiredTime = 0;
#endregion
#region Framework Functions
void Awake()
{
this.cam = Camera.main;
}
void OnEnable()
{
this.initBillboardWithDelay();
}
void Update()
{
if (this.isInitialized)
{
this.rotateToTarget(false, false);
}
}
void OnDisable()
{
this.isInitialized = false;
}
#endregion
#region Events
#endregion
#region Public Functions
public void OverrideEnablingBehaviour(EEnablingBehaviour newBehaviour)
{
this.enablingBehaviour = newBehaviour;
}
public void OverrideRotationSpeed(float newRotationSpeed)
{
this.rotationSpeed = newRotationSpeed;
}
public void OverrideStartBillboardingAngle(float newStartBillboardingAngle)
{
this.startBillboardingAngle = newStartBillboardingAngle;
}
public void OverrideStopBillboardingAngle(float newStopBillboardingAngle)
{
this.stopBillboardingAngle = newStopBillboardingAngle;
}
public void JumpToDesiredRotation()
{
this.rotateToTarget(false, true);
}
#endregion
#region Private Functions
private async void initBillboardWithDelay()
{
await Task.Delay(TimeSpan.FromSeconds(this.initDelay));
if (this == null)
{
// Has been destroyed -> cancel
return;
}
this.rotationFrom = Quaternion.identity;
this.rotationTo = Quaternion.identity;
if (this.enablingBehaviour == EEnablingBehaviour.Transition)
{
this.rotateToTarget(true, false);
}
if (this.enablingBehaviour == EEnablingBehaviour.Jump)
{
this.rotateToTarget(false, true);
}
this.isInitialized = true;
}
private void rotateToTarget(bool forceRotation, bool jumpToDesiredRotation)
{
if (this.targetTransform == null)
{
this.targetTransform = this.cam.transform;
}
// Get a Vector that points from the target to the main camera.
Vector3 directionToTarget = targetTransform.position - transform.position;
bool useCameraAsUpVector = true;
// Adjust for the pivot axis.
switch (pivotAxis)
{
case PivotAxis.X:
directionToTarget.x = 0.0f;
useCameraAsUpVector = false;
break;
case PivotAxis.Y:
directionToTarget.y = 0.0f;
useCameraAsUpVector = false;
break;
case PivotAxis.Z:
directionToTarget.x = 0.0f;
directionToTarget.y = 0.0f;
break;
case PivotAxis.XY:
useCameraAsUpVector = false;
break;
case PivotAxis.XZ:
directionToTarget.x = 0.0f;
break;
case PivotAxis.YZ:
directionToTarget.y = 0.0f;
break;
case PivotAxis.Free:
default:
// No changes needed.
break;
}
// If we are right next to the camera the rotation is undefined.
if (directionToTarget.sqrMagnitude < 0.001f)
{
return;
}
Quaternion rotationCurrent = Quaternion.identity;
// Calculate and apply the rotation required to reorient the object
if (useCameraAsUpVector)
{
rotationCurrent = Quaternion.LookRotation(-directionToTarget, this.cam.transform.up);
}
else
{
rotationCurrent = Quaternion.LookRotation(-directionToTarget);
}
if (jumpToDesiredRotation)
{
this.transform.rotation = rotationCurrent;
return;
}
float deviationToDesiredRotation = Mathf.Abs(Quaternion.Angle(rotationCurrent, transform.rotation));
// Check if rotation target needs to be set
if (deviationToDesiredRotation > this.startBillboardingAngle || forceRotation)
{
if (this.isDelayedModeActive)
{
// Delayed mode
if (!this.delayedRotationIsPending)
{
// Start "timer"
this.delayedRotationIsPending = true;
this.lastRotationRequiredTime = Time.time;
}
else
{
// "Timer" running
if (Time.time > this.lastRotationRequiredTime + this.delayedModeDelay)
{
// Delaytime has passed -> start rotating
this.delayedRotationIsPending = false;
this.rotationFrom = transform.rotation;
this.rotationTo = rotationCurrent;
}
}
}
else
{
// Non delayed mode -> start rotating
this.rotationFrom = transform.rotation;
this.rotationTo = rotationCurrent;
}
}
// If delayed mode -> check if delayedRotationIsPending needs to be reset
if (deviationToDesiredRotation < this.startBillboardingAngle && this.isDelayedModeActive)
{
this.delayedRotationIsPending = false;
}
if (this.rotationTo != Quaternion.identity)
{
// Currently rotating
transform.rotation = Quaternion.Lerp(this.transform.rotation, this.rotationTo, Time.deltaTime * rotationSpeed);
for (int i = 0; i < this.linkedTransforms.Count; i++)
{
this.linkedTransforms[i].rotation = this.transform.rotation;
}
// Check if should stop
float deviationToTargetRotation = Mathf.Abs(Quaternion.Angle(this.transform.rotation, this.rotationTo));
if (deviationToTargetRotation < this.stopBillboardingAngle)
{
this.rotationFrom = Quaternion.identity;
this.rotationTo = Quaternion.identity;
}
}
}
#endregion
}

View File

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

View File

@ -0,0 +1,247 @@
// 04.10.2021 11:00
using System;
using System.Threading.Tasks;
using UnityEngine;
public class ThresholdedPositioner : MonoBehaviour
{
#region Inspector Properties
[Header("Config Values")]
[Tooltip("Sets the desired position relative to target.")]
[SerializeField]
private Vector3 offsetToTarget;
[Tooltip("Should the position be fixed on height of the camera?")]
[SerializeField]
private bool keepOnCamHeight;
[Tooltip("Specifies the desired OnEnable behaviour.")]
[SerializeField]
private EEnablingBehaviour enablingBehaviour = EEnablingBehaviour.Transition;
[Tooltip("Specifies the delay in seconds before initializing.")]
[SerializeField]
private float initDelay = 0.03f;
[Tooltip("Specifies how fast the object will move.")]
[SerializeField]
private float movingSpeed = 4f;
[Tooltip("Distance from desiredPos which will start movement.")]
[SerializeField]
private float startMovingDistance = 0.2f;
[Tooltip("Distance to desiredPos which will stop movement.")]
[SerializeField]
private float stopMovingDistance = 0.02f;
[Tooltip("If keepAwayFromTransform is set: Minimal distance to keepAwayFromTransform.")]
[SerializeField]
private float keepAwayDistance = 0.5f;
[Header("Scene Objects")]
[Tooltip("Uses camera if not set")]
[SerializeField]
private Transform target;
[Tooltip("Stays away from this transform")]
[SerializeField]
private Transform keepAwayTransform;
#endregion
#region Public Properties
#endregion
#region Private Properties
private Camera cam;
private bool isInitialized = false;
private bool isMoving = false;
#endregion
#region Framework Functions
void Awake()
{
this.cam = Camera.main;
}
void OnEnable()
{
this.initPositionerWithDelay();
}
void Update()
{
if (this.isInitialized)
{
this.updateIsMoving();
if (this.isMoving)
{
this.updatePosition();
}
if (this.keepAwayTransform != null)
{
this.ensureMinDistanceToKeepAwayTransform();
}
}
}
void OnDisable()
{
this.isInitialized = false;
}
#endregion
#region Events
#endregion
#region Public Functions
public void OverrideEnablingBehaviour(EEnablingBehaviour newBehaviour)
{
this.enablingBehaviour = newBehaviour;
}
public void OverrideStartMovingDistance(float newStartMovingDistance)
{
this.startMovingDistance = newStartMovingDistance;
}
public void OverrideStopMovingDistance(float newStopMovingDistance)
{
this.stopMovingDistance = newStopMovingDistance;
}
public void OverrideMovingSpeed(float newMovingSpeed)
{
this.movingSpeed = newMovingSpeed;
}
public void OverrideKeepAwayFromTransform(Transform _keepAwayTransform, float _keepAwayDistance)
{
this.keepAwayTransform = _keepAwayTransform;
this.keepAwayDistance = _keepAwayDistance;
}
public void JumpToDesiredPosition()
{
this.transform.position = this.getDesiredPosition();
}
#endregion
#region Private Functions
private async void initPositionerWithDelay()
{
await Task.Delay(TimeSpan.FromSeconds(this.initDelay));
if (this.enablingBehaviour == EEnablingBehaviour.Transition)
{
this.isMoving = true;
}
if (this.enablingBehaviour == EEnablingBehaviour.Hold)
{
this.isMoving = false;
}
if (this.enablingBehaviour == EEnablingBehaviour.Jump)
{
this.transform.position = this.getDesiredPosition();
}
this.isInitialized = true;
}
private Vector3 getDesiredPosition()
{
// Ensure that we always have a target (in case this gets called before init)
if (this.target == null)
{
this.target = this.cam.transform;
}
Vector3 desiredPos = this.target.position
+ this.target.right * this.offsetToTarget.x
+ this.target.up * this.offsetToTarget.y
+ this.target.forward * this.offsetToTarget.z;
if (this.keepOnCamHeight)
{
// Override y position to keep on Cam height
desiredPos.y = this.cam.transform.position.y;
// Check if distance is still sufficient after overriding y pos
float distance = Vector3.Distance(desiredPos, this.target.position);
if (distance < this.offsetToTarget.z)
{
desiredPos = (desiredPos - this.target.position).normalized * this.offsetToTarget.z + this.target.position;
//Vector3 newPos = (this.transform.position - this.keepAwayTransform.position).normalized * this.keepAwayDistance + this.keepAwayTransform.position;
}
}
return desiredPos;
}
private void updateIsMoving()
{
float distance = Vector3.Distance(this.transform.position, this.getDesiredPosition());
if (this.isMoving && distance < this.stopMovingDistance)
{
this.isMoving = false;
}
else if (!this.isMoving && distance > this.startMovingDistance)
{
this.isMoving = true;
}
}
private void updatePosition()
{
Vector3 newPosition = Vector3.Lerp(this.transform.position, this.getDesiredPosition(), this.movingSpeed * Time.deltaTime);
if (this.keepAwayTransform != null)
{
float distance = Vector3.Distance(newPosition, this.keepAwayTransform.position);
if (distance < this.keepAwayDistance)
{
// Getting too close to keep away from transform -> don't move
newPosition = this.transform.position;
}
}
this.transform.position = newPosition;
}
private void ensureMinDistanceToKeepAwayTransform()
{
float distance = Vector3.Distance(this.transform.position, this.keepAwayTransform.position);
if (distance < this.keepAwayDistance)
{
Vector3 newPos = (this.transform.position - this.keepAwayTransform.position).normalized * this.keepAwayDistance + this.keepAwayTransform.position;
this.transform.position = newPos;
}
}
#endregion
}

View File

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

View File

@ -0,0 +1,54 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UnityDevSetLocalPosition : MonoBehaviour
{
#region Inspector Properties
[Header("Config Values")]
[SerializeField]
private Vector3 unityDevLocalPosition;
#endregion
#region Public Properties
#endregion
#region Private Properties
#endregion
#region Framework Functions
void Awake()
{
this.setLocalPosition();
}
#endregion
#region Events
#endregion
#region Public Functions
#endregion
#region Private Functions
private void setLocalPosition()
{
if (Application.isEditor)
{
this.transform.localPosition = this.unityDevLocalPosition;
}
}
#endregion
}

View File

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

View File

@ -0,0 +1,75 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
[Serializable]
public struct KeyPressAction
{
[SerializeField]
private KeyCode keyCode;
[SerializeField]
private UnityEvent action;
public KeyCode KeyCode => keyCode;
public UnityEvent Action => action;
}
public class UnityKeyPressHandler : MonoBehaviour
{
#region Inspector Properties
[Header("Config Values")]
[SerializeField]
private List<KeyPressAction> keyPressActions;
#endregion
#region Public Properties
#endregion
#region Private Properties
#endregion
#region Framework Functions
void Update()
{
if (Application.isEditor)
{
this.checkForUnityKeyPress();
}
}
#endregion
#region Events
#endregion
#region Public Functions
#endregion
#region Private Functions
private void checkForUnityKeyPress()
{
foreach (KeyPressAction action in this.keyPressActions)
{
if (Input.GetKeyDown(action.KeyCode))
{
action.Action.Invoke();
}
}
}
#endregion
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,106 @@
fileFormatVersion: 2
guid: 4199ec4624f61d84981e1cdaa7a49811
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude WindowsStoreApps: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: false
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: AnyScriptingBackend
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 484165a16e0d52346ad4a53368e87b7b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude WindowsStoreApps: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARM64
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: false
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: AnyScriptingBackend
- first:
iPhone: iOS
second:
enabled: 0
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: b4f3dccdca31d3c43b684cd4824b4fc8
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude WindowsStoreApps: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARM64
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: false
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: AnyScriptingBackend
- first:
iPhone: iOS
second:
enabled: 0
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 3467eab78b8c0cd4c8d8b095ff51b5b2
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude WindowsStoreApps: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARM64
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: false
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: AnyScriptingBackend
- first:
iPhone: iOS
second:
enabled: 0
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,116 @@
fileFormatVersion: 2
guid: 870f72f7d543fd6478b2295aafe19d0e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude WindowsStoreApps: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARM64
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: false
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: AnyScriptingBackend
- first:
iPhone: iOS
second:
enabled: 0
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@ -0,0 +1,106 @@
fileFormatVersion: 2
guid: 21ca801d32aef0e48879d1983002c196
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude WindowsStoreApps: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: false
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: AnyScriptingBackend
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More