interaction complete
This commit is contained in:
parent
7a012d55a4
commit
9dcbb4e5b2
16 changed files with 2360 additions and 163 deletions
82
Game/Assets/Brushteeth.cs
Normal file
82
Game/Assets/Brushteeth.cs
Normal file
|
@ -0,0 +1,82 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
public class Brushteeth : MonoBehaviour
|
||||
{
|
||||
public Slider progressBar; // Reference to the Slider (progress bar)
|
||||
public float progressTime = 5f; // Time for the progress bar to complete
|
||||
private UnityEngine.XR.Interaction.Toolkit.Interactables.XRGrabInteractable grabInteractable;
|
||||
private float timer = 0f;
|
||||
private bool isGrabbing = false;
|
||||
|
||||
void Start()
|
||||
{
|
||||
grabInteractable = GetComponent<UnityEngine.XR.Interaction.Toolkit.Interactables.XRGrabInteractable>();
|
||||
|
||||
if (grabInteractable == null)
|
||||
{
|
||||
Debug.LogError("XRGrabInteractable component not found on the object!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure the progress bar is hidden initially
|
||||
progressBar.gameObject.SetActive(false);
|
||||
|
||||
// Subscribe to grab and release events
|
||||
grabInteractable.selectEntered.AddListener(OnGrab);
|
||||
grabInteractable.selectExited.AddListener(OnRelease);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (isGrabbing)
|
||||
{
|
||||
timer += Time.deltaTime;
|
||||
progressBar.value = timer / progressTime;
|
||||
|
||||
if (timer >= progressTime)
|
||||
{
|
||||
CompleteProgress();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGrab(SelectEnterEventArgs args)
|
||||
{
|
||||
// Show and reset the progress bar
|
||||
progressBar.gameObject.SetActive(true);
|
||||
progressBar.value = 0f;
|
||||
timer = 0f;
|
||||
isGrabbing = true;
|
||||
}
|
||||
|
||||
private void OnRelease(SelectExitEventArgs args)
|
||||
{
|
||||
// Hide the progress bar and stop the timer
|
||||
progressBar.gameObject.SetActive(false);
|
||||
isGrabbing = false;
|
||||
timer = 0f;
|
||||
}
|
||||
|
||||
private void CompleteProgress()
|
||||
{
|
||||
// Hide the progress bar and perform any additional actions when complete
|
||||
progressBar.gameObject.SetActive(false);
|
||||
isGrabbing = false;
|
||||
|
||||
Debug.Log("Progress completed!");
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
// Unsubscribe from events to avoid memory leaks
|
||||
if (grabInteractable != null)
|
||||
{
|
||||
grabInteractable.selectEntered.RemoveListener(OnGrab);
|
||||
grabInteractable.selectExited.RemoveListener(OnRelease);
|
||||
}
|
||||
}
|
||||
}
|
11
Game/Assets/Brushteeth.cs.meta
Normal file
11
Game/Assets/Brushteeth.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eb1413d55b2e86c418513f77e13870a2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -2,28 +2,29 @@ fileFormatVersion: 2
|
|||
guid: a366c71c93ae411ea1ece423e8b1538f
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.183
|
||||
- gvh_version-12.5.0
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
|
@ -32,6 +33,6 @@ PluginImporter:
|
|||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
@ -2,28 +2,29 @@ fileFormatVersion: 2
|
|||
guid: 9cab53159f0a43b68c16552c892bd579
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.183
|
||||
- gvh_version-12.5.0
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
|
@ -32,6 +33,6 @@ PluginImporter:
|
|||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
@ -2,28 +2,29 @@ fileFormatVersion: 2
|
|||
guid: 06f4aa8c065049e5970eedec5f52600f
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.183
|
||||
- gvh_version-12.5.0
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
|
@ -32,6 +33,6 @@ PluginImporter:
|
|||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
@ -2,28 +2,29 @@ fileFormatVersion: 2
|
|||
guid: ad4fd0d2f20345839aa31291c8c0c285
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.183
|
||||
- gvh_version-12.5.0
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
enabled: 1
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
|
@ -32,6 +33,6 @@ PluginImporter:
|
|||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
@ -2,12 +2,10 @@ fileFormatVersion: 2
|
|||
guid: 2b4957d4e158489ca7b410312d84e001
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.183
|
||||
- gvh_version-12.5.0
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/CHANGELOG.md
|
||||
timeCreated: 1584567712
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
@ -2,21 +2,22 @@ fileFormatVersion: 2
|
|||
guid: 164f2f671ce9410dadebde5826bc0b51
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.183
|
||||
- gvh_version-12.5.0
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/Google.VersionHandler.dll
|
||||
- gvhp_targets-editor
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
|
@ -32,6 +33,6 @@ PluginImporter:
|
|||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
@ -2,12 +2,10 @@ fileFormatVersion: 2
|
|||
guid: 805e2c2846dd44248246ef896b03c176
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.183
|
||||
- gvh_version-12.5.0
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/LICENSE
|
||||
timeCreated: 1584567712
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
@ -2,12 +2,10 @@ fileFormatVersion: 2
|
|||
guid: 48c105d983344236ba7fd1e7d7208fca
|
||||
labels:
|
||||
- gvh
|
||||
- gvh_version-1.2.183
|
||||
- gvh_version-12.5.0
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/README.md
|
||||
timeCreated: 1584567712
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
@ -4,13 +4,11 @@ labels:
|
|||
- gvh
|
||||
- gvh_manifest
|
||||
- gvh_version-1.2.183
|
||||
- gvh_version-12.5.0
|
||||
- gvhp_exportpath-ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt
|
||||
- gvhp_manifestname-0External Dependency Manager
|
||||
- gvhp_manifestname-play-services-resolver
|
||||
timeCreated: 1474401009
|
||||
licenseType: Pro
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
@ -5,78 +5,114 @@ labels:
|
|||
- gvh_targets-editor
|
||||
- gvh_version-12.5.0
|
||||
- gvhp_exportpath-Firebase/Editor/Firebase.Editor.dll
|
||||
timeCreated: 1480838400
|
||||
PluginImporter:
|
||||
serializedVersion: 1
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
Android:
|
||||
- first:
|
||||
: Linux
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
: LinuxUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
: OSXIntel
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
: OSXIntel64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
: Web
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
: WebStreamed
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
Any:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
Editor:
|
||||
enabled: 0
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
Linux:
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
Linux64:
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
LinuxUniversal:
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
OSXIntel:
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
OSXIntel64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
OSXUniversal:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
Web:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
WebStreamed:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
Win:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
Win64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
WindowsStoreApps:
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
iOS:
|
||||
- first:
|
||||
iPhone: iOS
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
tvOS:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
- first:
|
||||
tvOS: tvOS
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
19
Game/Assets/Followplayercam.cs
Normal file
19
Game/Assets/Followplayercam.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Followplayercam : MonoBehaviour
|
||||
{
|
||||
public Transform playerCamera; // Assign the Main Camera (VR/XR Camera)
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (playerCamera != null)
|
||||
{
|
||||
// Make the canvas face the player's camera
|
||||
transform.position = playerCamera.position + playerCamera.forward * 2f; // Adjust distance as needed
|
||||
transform.LookAt(playerCamera);
|
||||
transform.rotation = Quaternion.LookRotation(transform.position - playerCamera.position);
|
||||
}
|
||||
}
|
||||
}
|
11
Game/Assets/Followplayercam.cs.meta
Normal file
11
Game/Assets/Followplayercam.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3abe37e4351124346aa2369f40796ac8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because one or more lines are too long
|
@ -144,7 +144,7 @@
|
|||
{
|
||||
"type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "ShapeBuilder.LastPivotLocation",
|
||||
"value": "{\"m_Value\":0}"
|
||||
"value": "{\"m_Value\":1}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
|
@ -159,7 +159,7 @@
|
|||
{
|
||||
"type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.LastSize",
|
||||
"value": "{\"m_Value\":{\"x\":-0.6273956298828125,\"y\":0.9246293306350708,\"z\":2.01953125}}"
|
||||
"value": "{\"m_Value\":{\"x\":-1.553558349609375,\"y\":0.2402482032775879,\"z\":0.44415283203125}}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
|
@ -216,6 +216,11 @@
|
|||
"key": "ShapeBuilder.Pipe",
|
||||
"value": "{}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "ShapeBuilder.Plane",
|
||||
"value": "{}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.ProBuilder.ExtrudeMethod, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "editor.extrudeMethod",
|
||||
|
|
Loading…
Add table
Reference in a new issue