diff --git a/Assets/Plugins.meta b/Assets/Plugins.meta new file mode 100644 index 0000000..e7cc43d --- /dev/null +++ b/Assets/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: df1b92f4f1591463f81c99fd2d5c881b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Roslyn.meta b/Assets/Plugins/Roslyn.meta new file mode 100644 index 0000000..60b98a2 --- /dev/null +++ b/Assets/Plugins/Roslyn.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7385cc8b190ec4f9daf6493085d85c8e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.CSharp.dll b/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.CSharp.dll new file mode 100644 index 0000000..1be970b Binary files /dev/null and b/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.CSharp.dll differ diff --git a/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.CSharp.dll.meta b/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.CSharp.dll.meta new file mode 100644 index 0000000..298bc5a --- /dev/null +++ b/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.CSharp.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 907d2682209f74665adadfc4a80a48cc +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: diff --git a/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.dll b/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.dll new file mode 100644 index 0000000..0444903 Binary files /dev/null and b/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.dll differ diff --git a/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.dll.meta b/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.dll.meta new file mode 100644 index 0000000..e7280a8 --- /dev/null +++ b/Assets/Plugins/Roslyn/Microsoft.CodeAnalysis.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 765d0bec0824d4f7ca1e4a8bd663954d +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: diff --git a/Assets/Plugins/Roslyn/System.Collections.Immutable.dll b/Assets/Plugins/Roslyn/System.Collections.Immutable.dll new file mode 100644 index 0000000..3082288 Binary files /dev/null and b/Assets/Plugins/Roslyn/System.Collections.Immutable.dll differ diff --git a/Assets/Plugins/Roslyn/System.Collections.Immutable.dll.meta b/Assets/Plugins/Roslyn/System.Collections.Immutable.dll.meta new file mode 100644 index 0000000..77f617c --- /dev/null +++ b/Assets/Plugins/Roslyn/System.Collections.Immutable.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 896fcac97063147398939ca105de81d5 +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: diff --git a/Assets/Plugins/Roslyn/System.Reflection.Metadata.dll b/Assets/Plugins/Roslyn/System.Reflection.Metadata.dll new file mode 100644 index 0000000..4e0d053 Binary files /dev/null and b/Assets/Plugins/Roslyn/System.Reflection.Metadata.dll differ diff --git a/Assets/Plugins/Roslyn/System.Reflection.Metadata.dll.meta b/Assets/Plugins/Roslyn/System.Reflection.Metadata.dll.meta new file mode 100644 index 0000000..4438e89 --- /dev/null +++ b/Assets/Plugins/Roslyn/System.Reflection.Metadata.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 834d6e3c6ab3345fe8f4089834d8ae57 +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: diff --git a/Assets/Plugins/Roslyn/System.Runtime.CompilerServices.Unsafe.dll b/Assets/Plugins/Roslyn/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000..491a80a Binary files /dev/null and b/Assets/Plugins/Roslyn/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/Assets/Plugins/Roslyn/System.Runtime.CompilerServices.Unsafe.dll.meta b/Assets/Plugins/Roslyn/System.Runtime.CompilerServices.Unsafe.dll.meta new file mode 100644 index 0000000..4061014 --- /dev/null +++ b/Assets/Plugins/Roslyn/System.Runtime.CompilerServices.Unsafe.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 2ae768ea29bc143f7a6ae42657bca350 +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: diff --git a/Assets/Scenes/main.unity b/Assets/Scenes/main.unity index c1260f7..2663521 100644 --- a/Assets/Scenes/main.unity +++ b/Assets/Scenes/main.unity @@ -349,32 +349,32 @@ PrefabInstance: - target: {fileID: -8679921383154817045, guid: ef5fbbeda893849a285d196510e10634, type: 3} propertyPath: m_LocalScale.x - value: 1 + value: 0.011181515 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: ef5fbbeda893849a285d196510e10634, type: 3} propertyPath: m_LocalScale.y - value: 1 + value: 0.011181515 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: ef5fbbeda893849a285d196510e10634, type: 3} propertyPath: m_LocalScale.z - value: 1 + value: 0.011181515 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: ef5fbbeda893849a285d196510e10634, type: 3} propertyPath: m_LocalPosition.x - value: 3.5 + value: -8.242 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: ef5fbbeda893849a285d196510e10634, type: 3} propertyPath: m_LocalPosition.y - value: 0.5 + value: 0.14941 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: ef5fbbeda893849a285d196510e10634, type: 3} propertyPath: m_LocalPosition.z - value: 4.5 + value: -8.2853 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: ef5fbbeda893849a285d196510e10634, type: 3} diff --git a/Assets/Scripts/Interaction/ShoseClickHandler.cs b/Assets/Scripts/Interaction/ShoseClickHandler.cs index 0509dff..ce6a625 100644 --- a/Assets/Scripts/Interaction/ShoseClickHandler.cs +++ b/Assets/Scripts/Interaction/ShoseClickHandler.cs @@ -11,14 +11,13 @@ public class ShoseClickHandler : MonoBehaviour { var col = GetComponent(); if (col == null) col = gameObject.AddComponent(); - if (col is SphereCollider sc) { sc.radius = 1.2f; sc.isTrigger = false; } - var drag = GetComponent(); - if (drag != null) Destroy(drag); + col.enabled = true; + if (col is SphereCollider sc) { sc.radius = 1.5f; sc.isTrigger = false; } CreateOutlineMesh(); StopAllCoroutines(); StartCoroutine(BlinkOutline()); _clicked = false; - Debug.Log($"[ShoseClick] OnEnable outline={_outlineMesh!=null} col={((SphereCollider)col).radius}"); + Debug.Log($"[ShoseClick] OnEnable obj={gameObject.name} outline={_outlineMesh!=null} col enabled={col.enabled} radius={((SphereCollider)col).radius}"); } void CreateOutlineMesh() @@ -50,13 +49,20 @@ public class ShoseClickHandler : MonoBehaviour void Update() { if (_clicked || !Input.GetMouseButtonDown(0)) return; - foreach (var cam in Camera.allCameras) + var cams = Object.FindObjectsOfType(); + foreach (var cam in cams) { if (!cam.enabled) continue; - var hits = Physics.RaycastAll(cam.ScreenPointToRay(Input.mousePosition), 100f); + var hits = Physics.RaycastAll(cam.ScreenPointToRay(Input.mousePosition), 200f); + if (hits.Length > 0) + { + var names = new System.Text.StringBuilder(); + foreach (var h in hits) names.Append(h.collider?.gameObject?.name ?? "null").Append(", "); + Debug.Log($"[ShoseClick] ★ Update click! hits={hits.Length} — {names}"); + } foreach (var h in hits) { - if (h.collider != null && h.collider.gameObject == gameObject) + if (h.collider != null && (h.collider.gameObject == gameObject || h.collider.gameObject.name == gameObject.name)) { OnClicked(); return; } @@ -67,10 +73,11 @@ public class ShoseClickHandler : MonoBehaviour void OnClicked() { _clicked = true; - Debug.Log("[ShoseClick] ★ 被点击了 ★"); + Debug.Log($"[ShoseClick] ★ {gameObject.name} 被点击了 ★"); StopAllCoroutines(); if (_outlineMesh != null) _outlineMesh.enabled = false; - if (targetPoint != null) { transform.position = targetPoint.position; transform.rotation = targetPoint.rotation; } + if (targetPoint != null) { transform.position = targetPoint.position; transform.rotation = targetPoint.rotation; Debug.Log($"[ShoseClick] 移动到 {targetPoint.name}"); } + else Debug.LogWarning("[ShoseClick] targetPoint 为空"); if (nextObject != null) nextObject.SetActive(true); } }