interaction complete

This commit is contained in:
yauwailam 2025-01-31 17:56:22 +08:00
parent 7a012d55a4
commit 9dcbb4e5b2
16 changed files with 2360 additions and 163 deletions

82
Game/Assets/Brushteeth.cs Normal file
View 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);
}
}
}

View file

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

View file

@ -2,28 +2,29 @@ fileFormatVersion: 2
guid: a366c71c93ae411ea1ece423e8b1538f guid: a366c71c93ae411ea1ece423e8b1538f
labels: labels:
- gvh - gvh
- gvh_version-1.2.183
- gvh_version-12.5.0 - gvh_version-12.5.0
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll - gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.IOSResolver.dll
- gvhp_targets-editor - gvhp_targets-editor
timeCreated: 1480838400
PluginImporter: PluginImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
iconMap: {} iconMap: {}
executionOrder: {} executionOrder: {}
defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData: platformData:
- first: - first:
Any: Any:
second: second:
enabled: 0 enabled: 0
settings: {} settings: {}
- first: - first:
Editor: Editor Editor: Editor
second: second:
enabled: 0 enabled: 1
settings: settings:
DefaultValueInitialized: true DefaultValueInitialized: true
- first: - first:
@ -32,6 +33,6 @@ PluginImporter:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View file

@ -2,28 +2,29 @@ fileFormatVersion: 2
guid: 9cab53159f0a43b68c16552c892bd579 guid: 9cab53159f0a43b68c16552c892bd579
labels: labels:
- gvh - gvh
- gvh_version-1.2.183
- gvh_version-12.5.0 - gvh_version-12.5.0
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll - gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.JarResolver.dll
- gvhp_targets-editor - gvhp_targets-editor
timeCreated: 1480838400
PluginImporter: PluginImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
iconMap: {} iconMap: {}
executionOrder: {} executionOrder: {}
defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData: platformData:
- first: - first:
Any: Any:
second: second:
enabled: 0 enabled: 0
settings: {} settings: {}
- first: - first:
Editor: Editor Editor: Editor
second: second:
enabled: 0 enabled: 1
settings: settings:
DefaultValueInitialized: true DefaultValueInitialized: true
- first: - first:
@ -32,6 +33,6 @@ PluginImporter:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View file

@ -2,28 +2,29 @@ fileFormatVersion: 2
guid: 06f4aa8c065049e5970eedec5f52600f guid: 06f4aa8c065049e5970eedec5f52600f
labels: labels:
- gvh - gvh
- gvh_version-1.2.183
- gvh_version-12.5.0 - gvh_version-12.5.0
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll - gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.PackageManagerResolver.dll
- gvhp_targets-editor - gvhp_targets-editor
timeCreated: 1480838400
PluginImporter: PluginImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
iconMap: {} iconMap: {}
executionOrder: {} executionOrder: {}
defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData: platformData:
- first: - first:
Any: Any:
second: second:
enabled: 0 enabled: 0
settings: {} settings: {}
- first: - first:
Editor: Editor Editor: Editor
second: second:
enabled: 0 enabled: 1
settings: settings:
DefaultValueInitialized: true DefaultValueInitialized: true
- first: - first:
@ -32,6 +33,6 @@ PluginImporter:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View file

@ -2,28 +2,29 @@ fileFormatVersion: 2
guid: ad4fd0d2f20345839aa31291c8c0c285 guid: ad4fd0d2f20345839aa31291c8c0c285
labels: labels:
- gvh - gvh
- gvh_version-1.2.183
- gvh_version-12.5.0 - gvh_version-12.5.0
- gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll - gvhp_exportpath-ExternalDependencyManager/Editor/1.2.183/Google.VersionHandlerImpl.dll
- gvhp_targets-editor - gvhp_targets-editor
timeCreated: 1480838400
PluginImporter: PluginImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
iconMap: {} iconMap: {}
executionOrder: {} executionOrder: {}
defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData: platformData:
- first: - first:
Any: Any:
second: second:
enabled: 0 enabled: 0
settings: {} settings: {}
- first: - first:
Editor: Editor Editor: Editor
second: second:
enabled: 0 enabled: 1
settings: settings:
DefaultValueInitialized: true DefaultValueInitialized: true
- first: - first:
@ -32,6 +33,6 @@ PluginImporter:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View file

@ -2,12 +2,10 @@ fileFormatVersion: 2
guid: 2b4957d4e158489ca7b410312d84e001 guid: 2b4957d4e158489ca7b410312d84e001
labels: labels:
- gvh - gvh
- gvh_version-1.2.183
- gvh_version-12.5.0 - gvh_version-12.5.0
- gvhp_exportpath-ExternalDependencyManager/Editor/CHANGELOG.md - gvhp_exportpath-ExternalDependencyManager/Editor/CHANGELOG.md
timeCreated: 1584567712
licenseType: Pro
TextScriptImporter: TextScriptImporter:
userData: externalObjects: {}
assetBundleName: userData:
assetBundleVariant: assetBundleName:
assetBundleVariant:

View file

@ -2,21 +2,22 @@ fileFormatVersion: 2
guid: 164f2f671ce9410dadebde5826bc0b51 guid: 164f2f671ce9410dadebde5826bc0b51
labels: labels:
- gvh - gvh
- gvh_version-1.2.183
- gvh_version-12.5.0 - gvh_version-12.5.0
- gvhp_exportpath-ExternalDependencyManager/Editor/Google.VersionHandler.dll - gvhp_exportpath-ExternalDependencyManager/Editor/Google.VersionHandler.dll
- gvhp_targets-editor - gvhp_targets-editor
timeCreated: 1480838400
PluginImporter: PluginImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
iconMap: {} iconMap: {}
executionOrder: {} executionOrder: {}
defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData: platformData:
- first: - first:
Any: Any:
second: second:
enabled: 0 enabled: 0
settings: {} settings: {}
@ -32,6 +33,6 @@ PluginImporter:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View file

@ -2,12 +2,10 @@ fileFormatVersion: 2
guid: 805e2c2846dd44248246ef896b03c176 guid: 805e2c2846dd44248246ef896b03c176
labels: labels:
- gvh - gvh
- gvh_version-1.2.183
- gvh_version-12.5.0 - gvh_version-12.5.0
- gvhp_exportpath-ExternalDependencyManager/Editor/LICENSE - gvhp_exportpath-ExternalDependencyManager/Editor/LICENSE
timeCreated: 1584567712 DefaultImporter:
licenseType: Pro externalObjects: {}
TextScriptImporter: userData:
userData: assetBundleName:
assetBundleName: assetBundleVariant:
assetBundleVariant:

View file

@ -2,12 +2,10 @@ fileFormatVersion: 2
guid: 48c105d983344236ba7fd1e7d7208fca guid: 48c105d983344236ba7fd1e7d7208fca
labels: labels:
- gvh - gvh
- gvh_version-1.2.183
- gvh_version-12.5.0 - gvh_version-12.5.0
- gvhp_exportpath-ExternalDependencyManager/Editor/README.md - gvhp_exportpath-ExternalDependencyManager/Editor/README.md
timeCreated: 1584567712
licenseType: Pro
TextScriptImporter: TextScriptImporter:
userData: externalObjects: {}
assetBundleName: userData:
assetBundleVariant: assetBundleName:
assetBundleVariant:

View file

@ -4,13 +4,11 @@ labels:
- gvh - gvh
- gvh_manifest - gvh_manifest
- gvh_version-1.2.183 - gvh_version-1.2.183
- gvh_version-12.5.0
- gvhp_exportpath-ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt - gvhp_exportpath-ExternalDependencyManager/Editor/external-dependency-manager_version-1.2.183_manifest.txt
- gvhp_manifestname-0External Dependency Manager - gvhp_manifestname-0External Dependency Manager
- gvhp_manifestname-play-services-resolver - gvhp_manifestname-play-services-resolver
timeCreated: 1474401009
licenseType: Pro
TextScriptImporter: TextScriptImporter:
userData: externalObjects: {}
assetBundleName: userData:
assetBundleVariant: assetBundleName:
assetBundleVariant:

View file

@ -5,78 +5,114 @@ labels:
- gvh_targets-editor - gvh_targets-editor
- gvh_version-12.5.0 - gvh_version-12.5.0
- gvhp_exportpath-Firebase/Editor/Firebase.Editor.dll - gvhp_exportpath-Firebase/Editor/Firebase.Editor.dll
timeCreated: 1480838400
PluginImporter: PluginImporter:
serializedVersion: 1 externalObjects: {}
serializedVersion: 2
iconMap: {} iconMap: {}
executionOrder: {} executionOrder: {}
defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData: 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 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
Any: - first:
Any:
second:
enabled: 0 enabled: 0
settings: {} settings: {}
Editor: - first:
enabled: 0 Editor: Editor
second:
enabled: 1
settings: settings:
CPU: AnyCPU CPU: AnyCPU
DefaultValueInitialized: true DefaultValueInitialized: true
OS: AnyOS OS: AnyOS
Linux: - first:
Standalone: Linux64
second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
Linux64: - first:
Standalone: OSXUniversal
second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
LinuxUniversal: - first:
Standalone: Win
second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
OSXIntel: - first:
Standalone: Win64
second:
enabled: 0 enabled: 0
settings: settings:
CPU: None CPU: None
OSXIntel64: - first:
enabled: 0 Windows Store Apps: WindowsStoreApps
settings: second:
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:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
iOS: - first:
iPhone: iOS
second:
enabled: 0 enabled: 0
settings: settings:
CompileFlags: CompileFlags:
FrameworkDependencies: FrameworkDependencies:
tvOS: - first:
tvOS: tvOS
second:
enabled: 0 enabled: 0
settings: settings:
CompileFlags: CompileFlags:
FrameworkDependencies: FrameworkDependencies:
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

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

View 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

View file

@ -144,7 +144,7 @@
{ {
"type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "ShapeBuilder.LastPivotLocation", "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", "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", "type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "ShapeBuilder.LastSize", "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", "type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
@ -216,6 +216,11 @@
"key": "ShapeBuilder.Pipe", "key": "ShapeBuilder.Pipe",
"value": "{}" "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", "type": "UnityEngine.ProBuilder.ExtrudeMethod, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "editor.extrudeMethod", "key": "editor.extrudeMethod",