Merge branch 'programming'

This commit is contained in:
Nadine Ganz 2025-07-15 14:48:27 +02:00
commit 779180cac4
84 changed files with 4055 additions and 422491 deletions

View File

@ -0,0 +1,342 @@
Tree("Root") {
Composite(Sequence) {
BTC.InitializeSpeechManager()
Composite(Race) {
Composite(Sequence) {
// Error in Speech Service: Cancel BTC Trees
BTC.SpeechErrorOccured()
BTC.SetBool("error")
}
Composite(Sequence) {
BTC.SetVoiceName("de-DE-SeraphinaMultilingualNeural")
BTC.FadeIn("FadeScene.XRInteractionHandsSetup.Black")
RunTree("05_Tutorial")
}
}
Composite(Sequence) {
BTC.CompareBool("error")
// Error Handling
BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
BTC.Show("GO.HANDMENU.SpeechButton")
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Restart")
BTC.Show("GO.HANDMENU.Option1Button")
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.SpeechButton")
BTC.Hide("GO.HANDMENU.SpeechOptions")
}
}
}
Tree("05_Tutorial") {
// --- Zugabteil - Tutorial ---
Composite(Sequence) {
BTC.SynthesizeText("Willkommen auf unserer Reise in die italienischsprachige Schweiz! Bevor wir loslegen, lass uns ein paar Dinge ausprobieren.")
BTC.SpeechOutputEnded()
BTC.SynthesizeText("Falls dir zu irgendeinem Zeitpunkt unwohl wird, schliesse die Augen und setze die VR-Brille ab.")
BTC.SpeechOutputEnded()
BTC.SynthesizeText("Vergewissere dich, dass Du sicher und bequem sitzt. Es wird Teile in der App geben, wo Du auch stehst. Für den Anfang kannst Du sitzen.")
BTC.SpeechOutputEnded()
BTC.SynthesizeText("Schau dich um. Beweg deinen Kopf, um die Umgebung zu entdecken.")
BTC.SpeechOutputEnded()
BTC.DetectRotationAtLeast("GO.XRInteractionHandsSetup.MainCamera", 30.0)
BTC.Wait(3)
BTC.SynthesizeText("Super! Lehne dich nun nach vorne, dann wieder zurück, lehne dich dann auf eine und dann auf die andere Seite. Dann wieder zurück.")
BTC.SpeechOutputEnded()
BTC.DetectPositionAtLeast("GO.XRInteractionHandsSetup.MainCamera", 0.2)
BTC.SynthesizeText("Gut so!")
BTC.SpeechOutputEnded()
BTC.Wait(2)
BTC.SynthesizeText("Du steuerst alles per Sprache.")
BTC.SpeechOutputEnded()
BTC.SynthesizeText("Gut, jetzt testen wir aber mal dein Mikrofon. Wie heisst du eigentlich?")
BTC.SpeechOutputEnded()
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-8")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Sequence) {
BTC.UserStartedSpeechInput()
Composite(Selector) {
// -- Selector 1: Intent erkannt
Composite(Sequence) {
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// -- Selector 2: Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
BTC.SynthesizeText("Schön dich kennenzulernen!")
BTC.SpeechOutputEnded()
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(10)
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition()
BTC.SynthesizeText("Ich habe dich nicht verstanden. Sprich bitte deutlicher.")
BTC.SpeechOutputEnded()
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Sequence) {
BTC.UserStartedSpeechInput()
Composite(Selector) {
// -- Selector 1: Intent erkannt
Composite(Sequence) {
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// -- Selector 2: Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
BTC.SynthesizeText("Schön dich kennenzulernen!")
BTC.SpeechOutputEnded()
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(10)
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
BTC.SynthesizeText("Schön dich kennenzulernen!")
BTC.SpeechOutputEnded()
}
}
}
}
BTC.SynthesizeText("Ab jetzt werden wir dir Fragen nur noch auf Italienisch stellen und Du musst auch auf Italienisch antworten. Aber keine Sorge, Du wirst nicht bewertet. Du darfst einfach ausprobieren ohne Angst vor Fehlern.")
BTC.SpeechOutputEnded()
BTC.SynthesizeText("Zusätzlich hast Du in deiner Hand ein Smartphone. Siehst Du es? Es kann dir bei Antworten helfen, wenn Du nicht weiter weisst. Und Du kannst damit auch die Übungen wechseln (und das Programm beenden).")
BTC.SpeechOutputEnded()
BTC.SynthesizeText("Also jetzt geht es los. Bereit?")
BTC.SpeechOutputEnded()
BTC.SetSpeechRecognitionLanguage("it-IT")
BTC.SetVoiceName("it-IT-FabiolaNeural")
BTC.SynthesizeText("Cosa ti piace di più? Spaghetti, pizza o risotto?")
BTC.SpeechOutputEnded()
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-15")
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-16")
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-17")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Sequence) {
BTC.UserStartedSpeechInput()
Composite(Selector) {
// -- Selector 1: Intent erkannt
Composite(Sequence) {
BTC.SpeechIntentRecognized()
// Intent erkannt
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Zugabteil-Tutorial-U-15")
BTC.ClearPossbileSpeechIntents()
BTC.SynthesizeText("Ah, Spaghetti mag ich auch!")
BTC.SpeechOutputEnded()
}
Composite(Sequence) {
BTC.CompareIntentID("Zugabteil-Tutorial-U-16")
BTC.ClearPossbileSpeechIntents()
BTC.SynthesizeText("Ah, Pizza mag ich auch!")
BTC.SpeechOutputEnded()
}
Composite(Sequence) {
BTC.CompareIntentID("Zugabteil-Tutorial-U-17")
BTC.ClearPossbileSpeechIntents()
BTC.SynthesizeText("Ah, Risotto mag ich auch!")
BTC.SpeechOutputEnded()
}
}
}
// Selector 2: Fallback Button
Composite(Sequence) {
Composite(Marathon) {
BTC.Show("GO.HANDMENU.SpeechButton")
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Spaghetti")
BTC.Show("GO.HANDMENU.Option1Button")
BTC.Set("TextMeshPro.HANDMENU.Option2Button", "text", "Pizza")
BTC.Show("GO.HANDMENU.Option2Button")
BTC.Set("TextMeshPro.HANDMENU.Option3Button", "text", "Risotto")
BTC.Show("GO.HANDMENU.Option3Button")
}
Composite(Race) {
Composite(Sequence) {
// Spaghetti
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option3Button")
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
BTC.Hide("GO.HANDMENU.Option3Button")
BTC.Hide("GO.HANDMENU.SpeechButton")
BTC.Hide("GO.HANDMENU.SpeechOptions")
BTC.SynthesizeText("Ah, Spaghetti mag ich auch!")
BTC.SpeechOutputEnded()
}
Composite(Sequence) {
// Pizza
BTC.Run("NamedEventTrigger.HANDMENU.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option3Button")
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
BTC.Hide("GO.HANDMENU.Option3Button")
BTC.Hide("GO.HANDMENU.SpeechButton")
BTC.Hide("GO.HANDMENU.SpeechOptions")
BTC.SynthesizeText("Ah, Pizza mag ich auch!")
BTC.SpeechOutputEnded()
}
Composite(Sequence) {
// Risotto
BTC.Run("NamedEventTrigger.HANDMENU.Option3Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button")
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
BTC.Hide("GO.HANDMENU.Option3Button")
BTC.Hide("GO.HANDMENU.SpeechButton")
BTC.Hide("GO.HANDMENU.SpeechOptions")
BTC.SynthesizeText("Ah, Risotto mag ich auch!")
BTC.SpeechOutputEnded()
}
}
BTC.ClearPossbileSpeechIntents()
}
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(10)
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
Composite(Sequence) {
Composite(Marathon) {
BTC.Show("GO.HANDMENU.SpeechButton")
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Spaghetti")
BTC.Show("GO.HANDMENU.Option1Button")
BTC.Set("TextMeshPro.HANDMENU.Option2Button", "text", "Pizza")
BTC.Show("GO.HANDMENU.Option2Button")
BTC.Set("TextMeshPro.HANDMENU.Option3Button", "text", "Risotto")
BTC.Show("GO.HANDMENU.Option3Button")
}
Composite(Race) {
Composite(Sequence) {
// Spaghetti
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option3Button")
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
BTC.Hide("GO.HANDMENU.Option3Button")
BTC.Hide("GO.HANDMENU.SpeechButton")
BTC.Hide("GO.HANDMENU.SpeechOptions")
BTC.SynthesizeText("Ah, Spaghetti mag ich auch!")
BTC.SpeechOutputEnded()
}
Composite(Sequence) {
// Pizza
BTC.Run("NamedEventTrigger.HANDMENU.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option3Button")
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
BTC.Hide("GO.HANDMENU.Option3Button")
BTC.Hide("GO.HANDMENU.SpeechButton")
BTC.Hide("GO.HANDMENU.SpeechOptions")
BTC.SynthesizeText("Ah, Pizza mag ich auch!")
BTC.SpeechOutputEnded()
}
Composite(Sequence) {
// Risotto
BTC.Run("NamedEventTrigger.HANDMENU.Option3Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button")
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
BTC.Hide("GO.HANDMENU.Option3Button")
BTC.Hide("GO.HANDMENU.SpeechButton")
BTC.Hide("GO.HANDMENU.SpeechOptions")
BTC.SynthesizeText("Ah, Risotto mag ich auch!")
BTC.SpeechOutputEnded()
}
}
BTC.ClearPossbileSpeechIntents()
}
}
}
BTC.SynthesizeText("Okay. Versuche, deinen Rucksack vom Tisch hochzuheben. Strecke dazu deine Hand aus und greife nach dem Rucksack, wie Du es auch sonst tun würdest.")
BTC.SpeechOutputEnded()
// Rucksack greifen
BTC.Run("NamedGrabEvent.INTERACTABLES.Rucksack")
BTC.SynthesizeText("Stelle den Rucksack nun auf die markierte Stelle auf den Sitz rechts von Dir.")
BTC.SpeechOutputEnded()
// Rucksack ins Socket
BTC.Show("GO/NamedSocketEvent.SOCKETS.RucksackUser")
BTC.Run("GO/NamedSocketEvent.SOCKETS.RucksackUser")
BTC.Wait(1)
BTC.Hide("GO/NamedSocketEvent.SOCKETS.RucksackUser")
BTC.SynthesizeText("Perfekt! Du hast gelernt dich zu bewegen, zu sprechen und mit Objekten zu interagieren. Dann geht es jetzt los!")
BTC.SpeechOutputEnded()
BTC.SynthesizeText("Francesca ist deine Begleiterin. Sie kommt gleich. Gute Reise!")
BTC.SpeechOutputEnded()
BTC.FadeOut("FadeScene.XRInteractionHandsSetup.Black")
BTC.Run("LoadScene.NEXT.10SBB")
}
}

View File

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

0
Viagg-io/Assets/Materials.meta Normal file → Executable file
View File

View File

@ -0,0 +1,193 @@
%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: AVProVideo 1
m_Shader: {fileID: 4800000, guid: 0ed1fb9218ad96f49acfdb428d5b5aab, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- ALPHAPACK_TOP_BOTTOM
- APPLY_GAMMA
- MONOSCOPIC
- STEREO_TOP_BOTTOM
m_InvalidKeywords:
- FORCEEYE_NONE
- LAYOUT_NONE
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AfterTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ChromaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ChromaTex_R:
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}
- _FromTex:
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}
- _MainTex_R:
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}
- _SrcTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- AlphaPack: 1
- ForceEye: 0
- Layout: 0
- Stereo: 1
- _Alpha: 1
- _AlphaClip: 0
- _AlphaToMask: 0
- _ApplyGamma: 1
- _Aspect: 1
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _Brightness: 0.5
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _ColorMask: 15
- _Contrast: 0.5
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EdgeFeather: 0.02
- _EnvironmentReflections: 1
- _Exposure: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _HighQuality: 0
- _Hue: 0
- _InvGamma: 1
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Rotation: 0
- _Saturation: 0.5
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _StereoDebug: 0
- _Surface: 0
- _UseHSBC: 0
- _UseYpCbCr: 0
- _VertScale: 1
- _WorkflowMode: 1
- _ZWrite: 1
- _t: 0.5
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _CustomScale: {r: 0, g: 0, b: 0, a: 0}
- _DrawOffset: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
m_BuildTextureStacks: []
--- !u!114 &6336574236004663190
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7

View File

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

View File

@ -0,0 +1,193 @@
%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: AVProVideo
m_Shader: {fileID: 4800000, guid: 0ed1fb9218ad96f49acfdb428d5b5aab, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- ALPHAPACK_TOP_BOTTOM
- APPLY_GAMMA
- MONOSCOPIC
- STEREO_TOP_BOTTOM
m_InvalidKeywords:
- FORCEEYE_NONE
- LAYOUT_NONE
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AfterTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ChromaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ChromaTex_R:
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}
- _FromTex:
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}
- _MainTex_R:
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}
- _SrcTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- AlphaPack: 1
- ForceEye: 0
- Layout: 0
- Stereo: 1
- _Alpha: 1
- _AlphaClip: 0
- _AlphaToMask: 0
- _ApplyGamma: 1
- _Aspect: 1
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _Brightness: 0.5
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _ColorMask: 15
- _Contrast: 0.5
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EdgeFeather: 0.02
- _EnvironmentReflections: 1
- _Exposure: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _HighQuality: 0
- _Hue: 0
- _InvGamma: 1
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Rotation: 0
- _Saturation: 0.5
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _StereoDebug: 0
- _Surface: 0
- _UseHSBC: 0
- _UseYpCbCr: 0
- _VertScale: 1
- _WorkflowMode: 1
- _ZWrite: 1
- _t: 0.5
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _CustomScale: {r: 0, g: 0, b: 0, a: 0}
- _DrawOffset: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
m_BuildTextureStacks: []
--- !u!114 &6336574236004663190
MonoBehaviour:
m_ObjectHideFlags: 11
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: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7

View File

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

View File

@ -303,6 +303,30 @@ public class BTC : MonoBehaviour {
} }
} }
[Task]
public void DetectRotationAtLeast(string objectName, float minRotation)
{
List<ComponentHandler> handlers = GetHandlers(objectName);
handlers.ForEach(handler => handler.DetectRotationAtLeast(Task.getState, minRotation));
if (handlers.Count == 0)
{
Debug.LogWarning($"BTC.DetectRotationAtLeast: no components under the name '{objectName}'");
Task.SetSucceeded();
}
}
[Task]
public void DetectPositionAtLeast(string objectName, float minDistance)
{
List<ComponentHandler> handlers = GetHandlers(objectName);
handlers.ForEach(handler => handler.DetectPositionAtLeast(Task.getState, minDistance));
if (handlers.Count == 0)
{
Debug.LogWarning($"BTC.DetectPositionAtLeast: no components under the name '{objectName}'");
Task.SetSucceeded();
}
}
[Task] [Task]
public void AbortEventListener(string objectName) public void AbortEventListener(string objectName)
{ {

View File

@ -221,6 +221,22 @@ public class ComponentHandler : MonoBehaviour {
} }
} }
public virtual void DetectRotationAtLeast(MyBT.NodeState nodeState, float minRotation)
{
if (Task.isDebugging)
{
Debug.LogWarning($"ComponentHandler.DetectRotationAtLeast: not implemented for {this.GetType()}");
}
}
public virtual void DetectPositionAtLeast(MyBT.NodeState nodeState, float minDistance)
{
if (Task.isDebugging)
{
Debug.LogWarning($"ComponentHandler.DetectPositionAtLeast not implemented for {this.GetType()}");
}
}
public virtual void AbortEventListener(MyBT.NodeState nodeState) public virtual void AbortEventListener(MyBT.NodeState nodeState)
{ {
if (Task.isDebugging) if (Task.isDebugging)

View File

@ -0,0 +1,147 @@
//============= Copyright (c) Ludic GmbH, All rights reserved. ==============
//
// Purpose: Part of the My Behaviour Tree Controller Code
//
//=============================================================================
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
using MyBT;
using RenderHeads.Media.AVProVideo;
#if UNITY_EDITOR
using UnityEditor;
[CustomEditor(typeof(NamedAVProMediaPlayer))]
public class NamedAVProMediaPlayerInspector : ComponentHandlerInspector
{
}
#endif
[System.Serializable]
public class NamedAVProMediaPlayer : ComponentHandler
{
public override string TypeLabel()
{
return "MediaPlayer";
}
public override string ContentLabel()
{
UpdateComponent();
return videoName;
}
public override void UpdateComponent()
{
base.UpdateComponent();
_mediaPlayer = GetComponent<MediaPlayer>();
if (_mediaPlayer == null)
{
Debug.Log($"NamedAVProMediaPlayer.UpdateComponent mediaPlayer is null");
}
}
//public Depthkit.Clip depthkitClip;
public string videoPath;
public string videoName = "Video";
MediaPlayer _mediaPlayer;
public override string titleText
{
get
{
return "Show/Hide, Run AVPro Video";
}
}
public override string[][] helpText
{
get
{
return new string[][] {
new string[] {"Show", null, $"BTC.Show(\"{roomId}\", \"{gameObject.name}\")"},
new string[] {"Hide", null, $"BTC.Hide(\"{roomId}\", \"{gameObject.name}\")"},
new string[] {"Run", null, $"BTC.Run(\"{roomId}\", \"{gameObject.name}\")"}
};
}
}
public override void Run(MyBT.NodeState nodeState)
{
if (_mediaPlayer == null)
{
Debug.Log("NamedAVProMediaPlayer.Running: MediaPlayer is null.");
return;
}
switch (nodeState)
{
case NodeState.FirstRun:
_mediaPlayer.OpenMedia(new MediaPath(videoPath, MediaPathType.RelativeToPersistentDataFolder));
break;
case NodeState.Running:
if (_mediaPlayer.Loop && _mediaPlayer.Control.IsPlaying())
{
Task.SetSucceeded();
return;
}
if (_mediaPlayer.Control.IsFinished())
{
_mediaPlayer.CloseMedia();
_mediaPlayer.ForceDispose();
Task.SetSucceeded();
return;
}
break;
}
}
public override void Show(MyBT.NodeState nodeState)
{
switch (nodeState)
{
case NodeState.FirstRun:
gameObject.SetActive(true);
if (_mediaPlayer != null)
{
_mediaPlayer.OpenMedia(new MediaPath(videoPath, MediaPathType.RelativeToPersistentDataFolder), autoPlay: false);
}
goto case NodeState.Running;
case NodeState.Running:
Task.SetSucceeded();
break;
case NodeState.Aborting:
break;
}
}
public override void Hide(MyBT.NodeState nodeState)
{
switch (nodeState)
{
case NodeState.FirstRun:
if (_mediaPlayer != null)
{
if (_mediaPlayer.Control.IsPlaying())
{
_mediaPlayer.Stop();
_mediaPlayer.CloseMedia();
}
_mediaPlayer.ForceDispose();
}
Task.SetSucceeded();
break;
case NodeState.Aborting:
break;
case NodeState.NotRunning:
break;
}
}
}

View File

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

View File

@ -101,6 +101,40 @@ public class NamedGameObject : ComponentHandler {
} }
} }
public override void DetectRotationAtLeast(NodeState nodeState, float minRotation)
{
if (nodeState == NodeState.FirstRun)
{
_startQuaternion = gameObject.transform.rotation;
}
else if (nodeState == NodeState.Running)
{
float angleOffset = Quaternion.Angle(_startQuaternion, gameObject.transform.rotation);
if (angleOffset > minRotation)
{
Task.SetSucceeded();
}
}
}
public override void DetectPositionAtLeast(NodeState nodeState, float minDistance)
{
if (nodeState == NodeState.FirstRun)
{
_initialPosition = gameObject.transform.position;
}
else if (nodeState == NodeState.Running)
{
float movedDistance = Vector3.Distance(_initialPosition, gameObject.transform.position);
if (movedDistance > minDistance)
{
Task.SetSucceeded();
}
}
}
public GameObject go; public GameObject go;
public string objName = "GoXY"; public string objName = "GoXY";
Quaternion _startQuaternion;
Vector3 _initialPosition;
} }

0
Viagg-io/Assets/Prefabs.meta Normal file → Executable file
View File

View File

@ -422,10 +422,18 @@ PrefabInstance:
propertyPath: m_RotationAction.m_Reference propertyPath: m_RotationAction.m_Reference
value: value:
objectReference: {fileID: 7384354444432909072, guid: c348712bda248c246b8c49b3db54643f, type: 3} objectReference: {fileID: 7384354444432909072, guid: c348712bda248c246b8c49b3db54643f, type: 3}
- target: {fileID: 8574486981646720036, guid: d6878e1999eb4b44a9f5a263af86c185, type: 3}
propertyPath: m_InteractionLayers.m_Bits
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 8775677614826887028, guid: d6878e1999eb4b44a9f5a263af86c185, type: 3} - target: {fileID: 8775677614826887028, guid: d6878e1999eb4b44a9f5a263af86c185, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9034274667510444962, guid: d6878e1999eb4b44a9f5a263af86c185, type: 3}
propertyPath: m_InteractionLayers.m_Bits
value: 4294967295
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: m_RemovedGameObjects:
- {fileID: 927309121262695183, guid: d6878e1999eb4b44a9f5a263af86c185, type: 3} - {fileID: 927309121262695183, guid: d6878e1999eb4b44a9f5a263af86c185, type: 3}

View File

@ -0,0 +1,393 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &5678524622008621035
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6950261997647933274}
- component: {fileID: 5089720956894615630}
- component: {fileID: 3167518112041466795}
- component: {fileID: 1963415286702983693}
m_Layer: 0
m_Name: video-actor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6950261997647933274
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5678524622008621035}
serializedVersion: 2
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.34, y: 0.34, z: 0.20263314}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 45992302152454030}
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!33 &5089720956894615630
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5678524622008621035}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &3167518112041466795
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5678524622008621035}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 2251b73870fed5b4fb653bb444096303, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!114 &1963415286702983693
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5678524622008621035}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f6d1977a52888584496b1acc7e998011, type: 3}
m_Name:
m_EditorClassIdentifier:
_media: {fileID: 6597935333783015301}
_automaticStereoPacking: 1
_overrideStereoPacking: 0
_stereoRedGreenTint: 0
_defaultTexture: {fileID: 0}
_renderer: {fileID: 3167518112041466795}
_materialIndex: -1
_texturePropertyName: _MainTex
_offset: {x: 0, y: 0}
_scale: {x: 1, y: 1}
--- !u!1 &6234806968843249386
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 45992302152454030}
- component: {fileID: 3859337681287528449}
m_Layer: 0
m_Name: video-container
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &45992302152454030
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6234806968843249386}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 2.67}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8630740983880984451}
- {fileID: 6950261997647933274}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3859337681287528449
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6234806968843249386}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 96a2d527c1352854b98e30bfd2a38812, type: 3}
m_Name:
m_EditorClassIdentifier:
target: {fileID: 0}
lookAxis: 2
allowedRotationAxis: 1
--- !u!1 &8285125232897659694
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8630740983880984451}
- component: {fileID: 6597935333783015301}
m_Layer: 0
m_Name: MediaPlayer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8630740983880984451
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8285125232897659694}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 45992302152454030}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6597935333783015301
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8285125232897659694}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 638c870cac4da414fba921606d504407, type: 3}
m_Name:
m_EditorClassIdentifier:
_mediaSource: 1
_mediaReference: {fileID: 0}
_mediaPath:
_pathType: 2
_path: C0066-ap-tb.mp4
_fallbackMediaHints:
transparency: 1
alphaPacking: 1
stereoPacking: 0
_autoOpen: 1
_autoPlayOnStart: 1
_loop: 1
_audioVolume: 1
_audioBalance: 0
_audioMuted: 0
_playbackRate: 1
_useResampler: 0
_resampleMode: 0
_resampleBufferSize: 5
_videoMapping: 0
_textureFilterMode: 1
_textureWrapMode: 1
_textureAnisoLevel: 0
_sideloadSubtitles: 0
_subtitlePath:
_pathType: 2
_path:
_audioHeadTransform: {fileID: 0}
_audioFocusEnabled: 0
_audioFocusTransform: {fileID: 0}
_audioFocusWidthDegrees: 90
_audioFocusOffLevelDB: 0
_httpHeaders:
httpHeaders: []
_keyAuth:
keyServerToken:
overrideDecryptionKeyBase64:
_events:
m_PersistentCalls:
m_Calls: []
_eventMask: -1
_pauseMediaOnAppPause: 1
_playMediaOnAppUnpause: 1
_persistent: 0
_forceFileFormat: 0
_optionsWindows:
httpHeaders:
httpHeaders: []
keyAuth:
keyServerToken:
overrideDecryptionKeyBase64:
videoApi: 0
useHardwareDecoding: 1
useRendererSync: 1
useTextureMips: 0
use10BitTextures: 0
hintAlphaChannel: 0
useLowLatency: 0
useCustomMovParser: 0
useHapNotchLC: 0
useStereoDetection: 1
useTextTrackSupport: 1
useFacebookAudio360Support: 1
useAudioDelay: 0
forceAudioOutputDeviceName:
preferredFilters: []
_audioMode: 0
audio360ChannelMode: 0
startWithHighestBitrate: 0
useLowLiveLatency: 0
parallelFrameCount: 3
prerollFrameCount: 4
useUnityAudio: 0
enableAudio360: 0
_options_macOS:
httpHeaders:
httpHeaders: []
keyAuth:
keyServerToken:
overrideDecryptionKeyBase64:
textureFormat: 0
_audioMode: 0
_flags: 0
maximumPlaybackRate: 2
_preferredPeakBitRate: 0
_preferredPeakBitRateUnits: 1
_preferredForwardBufferDuration: 0
_preferredMaximumResolution: 0
_customPreferredMaximumResolution: {x: 0, y: 0}
_options_iOS:
httpHeaders:
httpHeaders: []
keyAuth:
keyServerToken:
overrideDecryptionKeyBase64:
textureFormat: 0
_audioMode: 0
_flags: 0
maximumPlaybackRate: 2
_preferredPeakBitRate: 0
_preferredPeakBitRateUnits: 1
_preferredForwardBufferDuration: 0
_preferredMaximumResolution: 0
_customPreferredMaximumResolution: {x: 0, y: 0}
_options_tvOS:
httpHeaders:
httpHeaders: []
keyAuth:
keyServerToken:
overrideDecryptionKeyBase64:
textureFormat: 0
_audioMode: 0
_flags: 0
maximumPlaybackRate: 2
_preferredPeakBitRate: 0
_preferredPeakBitRateUnits: 1
_preferredForwardBufferDuration: 0
_preferredMaximumResolution: 0
_customPreferredMaximumResolution: {x: 0, y: 0}
_options_visionOS:
httpHeaders:
httpHeaders: []
keyAuth:
keyServerToken:
overrideDecryptionKeyBase64:
textureFormat: 0
_audioMode: 0
_flags: 0
maximumPlaybackRate: 2
_preferredPeakBitRate: 0
_preferredPeakBitRateUnits: 1
_preferredForwardBufferDuration: 0
_preferredMaximumResolution: 0
_customPreferredMaximumResolution: {x: 0, y: 0}
_optionsAndroid:
httpHeaders:
httpHeaders: []
keyAuth:
keyServerToken:
overrideDecryptionKeyBase64:
textureFormat: 0
_generateMipmaps: 0
_audioMode: 0
_preferredMaximumResolution: 0
_customPreferredMaximumResolution: {x: 0, y: 0}
_preferredPeakBitRate: 0
_preferredPeakBitRateUnits: 1
videoApi: 2
showPosterFrame: 0
audio360ChannelMode: 0
audio360LatencyMS: 0
preferSoftwareDecoder: 0
forceRtpTCP: 0
forceEnableMediaCodecAsynchronousQueueing: 0
fileOffset: 0
startWithHighestBitrate: 0
minBufferMs: 50000
maxBufferMs: 50000
bufferForPlaybackMs: 2500
bufferForPlaybackAfterRebufferMs: 5000
useFastOesPath: 0
audioOutput: 0
blitTextureFiltering: 0
forceEnableMediaCodecAsyncQueueing: 0
enableAudio360: 0
_optionsWindowsUWP:
httpHeaders:
httpHeaders: []
keyAuth:
keyServerToken:
overrideDecryptionKeyBase64:
useHardwareDecoding: 1
useRendererSync: 1
useTextureMips: 0
use10BitTextures: 0
hintOutput10Bit: 0
useLowLatency: 0
videoApi: 1
_audioMode: 0
audio360ChannelMode: 0
startWithHighestBitrate: 0
useLowLiveLatency: 0
_optionsWebGL:
httpHeaders:
httpHeaders: []
keyAuth:
keyServerToken:
overrideDecryptionKeyBase64:
externalLibrary: 0
useTextureMips: 0
m_VideoPath:
m_VideoLocation: 2

View File

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

0
Viagg-io/Assets/Scenes.meta Normal file → Executable file
View File

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

4249
Viagg-io/Assets/Scenes/Test-Scene-Nick2.unity Normal file → Executable file

File diff suppressed because it is too large Load Diff

0
Viagg-io/Assets/Scenes/Test-Scene-Nick2.unity.meta Normal file → Executable file
View File

0
Viagg-io/Assets/Scripts.meta Normal file → Executable file
View File

View File

@ -0,0 +1,67 @@
using UnityEngine;
public class AxisConstrainedLookAt : MonoBehaviour
{
public Transform target;
public enum LocalAxis { X, Y, Z }
public enum RotationAxis { X, Y, Z }
[Header("Which local axis should point at the target?")]
public LocalAxis lookAxis = LocalAxis.Z;
[Header("Allow rotation only around this world axis")]
public RotationAxis allowedRotationAxis = RotationAxis.Y;
void Update()
{
if (target == null) return;
Vector3 toTarget = target.position - transform.position;
if (toTarget.sqrMagnitude < 0.0001f) return;
// Project direction onto the allowed rotation plane
Vector3 projectedDirection = ProjectDirection(toTarget.normalized, allowedRotationAxis);
if (projectedDirection.sqrMagnitude < 0.0001f) return;
// Get the desired rotation to look at the projected target direction
Quaternion targetRotation = Quaternion.LookRotation(projectedDirection, Vector3.up);
// Adjust rotation so the selected local axis is pointing in that direction
Quaternion localAxisRotation = GetLocalAxisRotation(lookAxis);
// Apply final rotation
transform.rotation = targetRotation * Quaternion.Inverse(localAxisRotation);
}
private Vector3 ProjectDirection(Vector3 direction, RotationAxis axis)
{
switch (axis)
{
case RotationAxis.X:
return Vector3.ProjectOnPlane(direction, Vector3.right);
case RotationAxis.Y:
return Vector3.ProjectOnPlane(direction, Vector3.up);
case RotationAxis.Z:
return Vector3.ProjectOnPlane(direction, Vector3.forward);
default:
return direction;
}
}
private Quaternion GetLocalAxisRotation(LocalAxis axis)
{
switch (axis)
{
case LocalAxis.X:
return Quaternion.LookRotation(Vector3.right, Vector3.up);
case LocalAxis.Y:
return Quaternion.LookRotation(Vector3.up, Vector3.forward); // alternative up
case LocalAxis.Z:
return Quaternion.LookRotation(Vector3.forward, Vector3.up);
default:
return Quaternion.identity;
}
}
}

View File

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

View File

@ -0,0 +1,292 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.Networking;
public class InternetVolumeLogger : MonoBehaviour
{
[Header("Logging Settings")]
public float logInterval = 5f; // Intervall in Sekunden
public string logFileName = "internet_volume_log.txt";
public bool enableLogging = true;
[Header("Display Settings")]
public bool showInConsole = true;
private long lastBytesReceived = 0;
private long lastBytesSent = 0;
private long totalBytesReceived = 0;
private long totalBytesSent = 0;
private float sessionStartTime;
private string logFilePath;
private void Start()
{
sessionStartTime = Time.time;
// Android-spezifischer Pfad für externe Speicherung
if (Application.platform == RuntimePlatform.Android)
{
logFilePath = Path.Combine(Application.persistentDataPath, logFileName);
}
else
{
logFilePath = Path.Combine(Application.persistentDataPath, logFileName);
}
Debug.Log($"Log-Datei wird gespeichert unter: {logFilePath}");
// Initialisiere die Baseline-Werte
InitializeBaseline();
// Starte das Logging
if (enableLogging)
{
StartCoroutine(LogInternetVolume());
}
// Schreibe Header in die Log-Datei
WriteLogHeader();
}
private void InitializeBaseline()
{
// Setze die Startwerte für die Messung
lastBytesReceived = GetTotalBytesReceived();
lastBytesSent = GetTotalBytesSent();
totalBytesReceived = 0;
totalBytesSent = 0;
}
private long GetTotalBytesReceived()
{
// Android-optimierte Netzwerk-Statistiken
if (Application.platform == RuntimePlatform.Android)
{
try
{
using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
using (AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
using (AndroidJavaClass trafficStats = new AndroidJavaClass("android.net.TrafficStats"))
{
// Verwende Android TrafficStats für präzise Netzwerk-Messung
long totalRx = trafficStats.CallStatic<long>("getTotalRxBytes");
return totalRx;
}
}
catch (Exception e)
{
Debug.LogWarning($"Android TrafficStats nicht verfügbar: {e.Message}");
return 0;
}
}
return GC.GetTotalMemory(false);
}
private long GetTotalBytesSent()
{
// Android-optimierte Netzwerk-Statistiken
if (Application.platform == RuntimePlatform.Android)
{
try
{
using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
using (AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
using (AndroidJavaClass trafficStats = new AndroidJavaClass("android.net.TrafficStats"))
{
// Verwende Android TrafficStats für präzise Netzwerk-Messung
long totalTx = trafficStats.CallStatic<long>("getTotalTxBytes");
return totalTx;
}
}
catch (Exception e)
{
Debug.LogWarning($"Android TrafficStats nicht verfügbar: {e.Message}");
return 0;
}
}
return GC.GetTotalMemory(false);
}
private IEnumerator LogInternetVolume()
{
while (enableLogging)
{
yield return new WaitForSeconds(logInterval);
// Aktuelle Netzwerk-Statistiken abrufen
long currentBytesReceived = GetTotalBytesReceived();
long currentBytesSent = GetTotalBytesSent();
// Berechne die Differenz seit der letzten Messung
long deltaReceived = currentBytesReceived - lastBytesReceived;
long deltaSent = currentBytesSent - lastBytesSent;
// Addiere zur Gesamtsumme
totalBytesReceived += deltaReceived;
totalBytesSent += deltaSent;
// Aktualisiere die letzten Werte
lastBytesReceived = currentBytesReceived;
lastBytesSent = currentBytesSent;
// Erstelle Log-Eintrag
LogEntry logEntry = new LogEntry
{
timestamp = DateTime.Now,
sessionTime = Time.time - sessionStartTime,
bytesReceivedDelta = deltaReceived,
bytesSentDelta = deltaSent,
totalBytesReceived = totalBytesReceived,
totalBytesSent = totalBytesSent,
totalBytes = totalBytesReceived + totalBytesSent
};
// Logge die Daten
LogData(logEntry);
}
}
private void LogData(LogEntry entry)
{
string logLine = FormatLogEntry(entry);
// Console Log
if (showInConsole)
{
Debug.Log($"[Internet Volume] {logLine}");
}
// Datei Log
WriteToFile(logLine);
}
private string FormatLogEntry(LogEntry entry)
{
return $"{entry.timestamp:yyyy-MM-dd HH:mm:ss} | " +
$"Session: {entry.sessionTime:F1}s | " +
$"Δ↓: {FormatBytes(entry.bytesReceivedDelta)} | " +
$"Δ↑: {FormatBytes(entry.bytesSentDelta)} | " +
$"Total↓: {FormatBytes(entry.totalBytesReceived)} | " +
$"Total↑: {FormatBytes(entry.totalBytesSent)} | " +
$"Total: {FormatBytes(entry.totalBytes)}";
}
private string FormatBytes(double bytes)
{
string[] suffixes = { "B", "KB", "MB", "GB", "TB" };
int suffixIndex = 0;
while (bytes >= 1024 && suffixIndex < suffixes.Length - 1)
{
bytes /= 1024;
suffixIndex++;
}
return $"{bytes:F2} {suffixes[suffixIndex]}";
}
private void WriteLogHeader()
{
string header = $"=== Internet Volume Log gestartet am {DateTime.Now:yyyy-MM-dd HH:mm:ss} ===\n" +
$"App: {Application.productName} v{Application.version}\n" +
$"Platform: {Application.platform}\n" +
$"Log Intervall: {logInterval}s\n" +
$"{'=',-80}\n";
WriteToFile(header);
}
private void WriteToFile(string content)
{
try
{
// Stelle sicher, dass das Verzeichnis existiert
string directory = Path.GetDirectoryName(logFilePath);
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
using (StreamWriter writer = new StreamWriter(logFilePath, true))
{
writer.WriteLine(content);
}
}
catch (Exception e)
{
Debug.LogError($"Fehler beim Schreiben in Log-Datei: {e.Message}");
}
}
private void OnApplicationPause(bool pauseStatus)
{
if (pauseStatus)
{
WriteToFile($"App pausiert um {DateTime.Now:HH:mm:ss}");
}
else
{
WriteToFile($"App fortgesetzt um {DateTime.Now:HH:mm:ss}");
}
}
private void OnApplicationQuit()
{
WriteToFile($"=== Session beendet um {DateTime.Now:yyyy-MM-dd HH:mm:ss} ===");
WriteToFile($"Gesamte Session-Dauer: {(Time.time - sessionStartTime):F1}s");
WriteToFile($"Gesamt empfangen: {FormatBytes(totalBytesReceived)}");
WriteToFile($"Gesamt gesendet: {FormatBytes(totalBytesSent)}");
WriteToFile($"Gesamt-Volumen: {FormatBytes(totalBytesReceived + totalBytesSent)}");
}
// Öffentliche Methoden für externe Aufrufe
public void StartLogging()
{
if (!enableLogging)
{
enableLogging = true;
StartCoroutine(LogInternetVolume());
}
}
public void StopLogging()
{
enableLogging = false;
}
public void ResetStats()
{
totalBytesReceived = 0;
totalBytesSent = 0;
InitializeBaseline();
WriteToFile($"Statistiken zurückgesetzt um {DateTime.Now:HH:mm:ss}");
}
public long GetTotalVolume()
{
return totalBytesReceived + totalBytesSent;
}
public string GetLogFilePath()
{
return logFilePath;
}
}
[System.Serializable]
public class LogEntry
{
public DateTime timestamp;
public float sessionTime;
public long bytesReceivedDelta;
public long bytesSentDelta;
public long totalBytesReceived;
public long totalBytesSent;
public long totalBytes;
}

View File

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

View File

@ -1,5 +1,34 @@
{ {
"intents": [ "intents": [
{
"intentID": "Zugabteil-Tutorial-U-8",
"intentSentences": [
"Ich heisse xy.",
"Mein Name ist xy.",
"Ich bin xy."
]
},
{
"intentID": "Zugabteil-Tutorial-U-15",
"intentSentences": [
"Mi piace di pi\u00f9 gli spaghetti.",
"Spaghetti."
]
},
{
"intentID": "Zugabteil-Tutorial-U-16",
"intentSentences": [
"Mi piace di pi\u00f9 una pizza.",
"Pizza."
]
},
{
"intentID": "Zugabteil-Tutorial-U-17",
"intentSentences": [
"Mi piace di pi\u00f9 il risotto.",
"Risotto."
]
},
{ {
"intentID": "Zugabteil.Szenenwahl.3", "intentID": "Zugabteil.Szenenwahl.3",
"intentSentences": [ "intentSentences": [

0
Viagg-io/Assets/StreamingAssets.meta Normal file → Executable file
View File

Binary file not shown.

View File

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

Binary file not shown.

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Videos/Slideshow/1-9099.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Videos/Slideshow/2-9119.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 MiB

BIN
Videos/Slideshow/3-8927.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Videos/Slideshow/4-8975.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Videos/Slideshow/5-9003.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 MiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Videos/Slideshow/6-8595.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 MiB

BIN
Videos/Slideshow/7-8623.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 MiB

BIN
Videos/Slideshow/8-8511.JPG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 MiB