diff --git a/Assets/Prototype/佩佩/佩佩视觉模块.unity b/Assets/Prototype/佩佩/佩佩视觉模块.unity index 28fea960a..43490138e 100644 --- a/Assets/Prototype/佩佩/佩佩视觉模块.unity +++ b/Assets/Prototype/佩佩/佩佩视觉模块.unity @@ -20450,6 +20450,6 @@ SceneRoots: - {fileID: 1141076862} - {fileID: 1278583898} - {fileID: 1182811777} - - {fileID: 863689910} - {fileID: 223296691} + - {fileID: 863689910} - {fileID: 1761949062} diff --git a/Assets/Resources/Yarn/CutLine.meta b/Assets/Resources/Yarn/CutLine.meta new file mode 100644 index 000000000..7cb6b4ebc --- /dev/null +++ b/Assets/Resources/Yarn/CutLine.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0fc37b2ff0b6f16429dfa0e3914ac9fc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Yarn/CutLine/CutLine.yarnproject b/Assets/Resources/Yarn/CutLine/CutLine.yarnproject new file mode 100644 index 000000000..016b7ab29 --- /dev/null +++ b/Assets/Resources/Yarn/CutLine/CutLine.yarnproject @@ -0,0 +1,12 @@ +{ + "projectFileVersion": 2, + "sourceFiles": [ + "*.yarn" + ], + "excludeFiles": [ + "**/*~/*" + ], + "localisation": {}, + "baseLanguage": "zh-CHS", + "compilerOptions": {} +} \ No newline at end of file diff --git a/Assets/Resources/Yarn/CutLine/CutLine.yarnproject.meta b/Assets/Resources/Yarn/CutLine/CutLine.yarnproject.meta new file mode 100644 index 000000000..6ccb1359c --- /dev/null +++ b/Assets/Resources/Yarn/CutLine/CutLine.yarnproject.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e330debc3f1940f48a26e56843c74def +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 053561912b1654d80a424bb0696a74ae, type: 3} + useAddressableAssets: 0 + UseUnityLocalisationSystem: 0 + unityLocalisationStringTableCollection: {instanceID: 0} diff --git a/Assets/Resources/Yarn/CutLine/CutLine1.yarn b/Assets/Resources/Yarn/CutLine/CutLine1.yarn new file mode 100644 index 000000000..aa72f5bbd --- /dev/null +++ b/Assets/Resources/Yarn/CutLine/CutLine1.yarn @@ -0,0 +1,16 @@ +title: Start +tags: +--- +<> +<> +<> +<> +[command name=activate_socket_choice /] +[options /] + -> MemoryEyeScissor + 我:剪断哦了 + <> + -> MemoryUFScissor + 我:这个剪不断噢 + +=== diff --git a/Assets/Resources/Yarn/CutLine/CutLine1.yarn.meta b/Assets/Resources/Yarn/CutLine/CutLine1.yarn.meta new file mode 100644 index 000000000..c054b46f5 --- /dev/null +++ b/Assets/Resources/Yarn/CutLine/CutLine1.yarn.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2dd37687f6dec2e499e7cd50b3c8bda4 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3} diff --git a/Assets/Resources/Yarn/MessageBox.meta b/Assets/Resources/Yarn/MessageBox.meta new file mode 100644 index 000000000..23161d859 --- /dev/null +++ b/Assets/Resources/Yarn/MessageBox.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca6cfd3dc1f658c4f81b4fc556445d52 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Yarn/MessageBox/MessageBox.yarnproject b/Assets/Resources/Yarn/MessageBox/MessageBox.yarnproject new file mode 100644 index 000000000..016b7ab29 --- /dev/null +++ b/Assets/Resources/Yarn/MessageBox/MessageBox.yarnproject @@ -0,0 +1,12 @@ +{ + "projectFileVersion": 2, + "sourceFiles": [ + "*.yarn" + ], + "excludeFiles": [ + "**/*~/*" + ], + "localisation": {}, + "baseLanguage": "zh-CHS", + "compilerOptions": {} +} \ No newline at end of file diff --git a/Assets/Resources/Yarn/MessageBox/MessageBox.yarnproject.meta b/Assets/Resources/Yarn/MessageBox/MessageBox.yarnproject.meta new file mode 100644 index 000000000..6e2e40c67 --- /dev/null +++ b/Assets/Resources/Yarn/MessageBox/MessageBox.yarnproject.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9eca6f1b5a4584647beffd48f104950b +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 053561912b1654d80a424bb0696a74ae, type: 3} + useAddressableAssets: 0 + UseUnityLocalisationSystem: 0 + unityLocalisationStringTableCollection: {instanceID: 0} diff --git a/Assets/Resources/Yarn/MessageBox/MessageBox1.yarn b/Assets/Resources/Yarn/MessageBox/MessageBox1.yarn new file mode 100644 index 000000000..074a3b5f5 --- /dev/null +++ b/Assets/Resources/Yarn/MessageBox/MessageBox1.yarn @@ -0,0 +1,26 @@ +title: Start +tags: +--- +<> +<> +<> +=== + +title: Test +position: 537,-1196 +--- +[command name=activate_socket_choice /] +[options /] + -> UFView + <> + 我::插入UFview + <> + -> EyeView + <> + 我::插入Eyeview + <> + -> MemoryView + <> + 我::插入Memoryview + <> +=== diff --git a/Assets/Resources/Yarn/MessageBox/MessageBox1.yarn.meta b/Assets/Resources/Yarn/MessageBox/MessageBox1.yarn.meta new file mode 100644 index 000000000..5f0d48dd2 --- /dev/null +++ b/Assets/Resources/Yarn/MessageBox/MessageBox1.yarn.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7b342c35155a3ee45b13bcb985ceb0ff +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3} diff --git a/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn b/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn index 34a9455ac..5a6148d77 100644 --- a/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn +++ b/Assets/Resources/Yarn/PeipeiTalk/PeipeiTalk1.yarn @@ -20,51 +20,13 @@ position: 63,-958 // <> // 电视: 新闻3内容 // 我: 销售大赛…给机器人销售罐头?为什么呢…… -<> -///表示UF模块在当前维修阶段是否已经进入过了 -<> + <> //<> <> <> === -title: Test -position: 537,-1196 ---- -//<> -//<> -<> -<> -[command name=activate_socket_choice /] -[options /] - -> MemoryEyeScissor<> - 我::剪断哦了 - <> - <> - -> MemoryUFScissor - 我::这个剪不断噢 - <> -=== -title: Test2 -position: 537,-1196 ---- -// [command name=activate_socket_choice /] -// [options /] -// -> UFView -// <> -// 我::插入UFview -// <> -// -> EyeView -// <> -// 我::插入Eyeview -// <> -// -> MemoryView -// <> -// 我::插入Memoryview -// <> -=== - title: OutDoorTalk position: 72,-688 diff --git a/Assets/Scripts/FixSystem/Line/LineManager.cs b/Assets/Scripts/FixSystem/Line/LineManager.cs index 42727aa1c..6f7378116 100644 --- a/Assets/Scripts/FixSystem/Line/LineManager.cs +++ b/Assets/Scripts/FixSystem/Line/LineManager.cs @@ -65,6 +65,7 @@ public void CutLine(InteractiveLineSegment originalLineSegment, Vector3 splitPoi GameObject secondLineSegmentObject = Instantiate(physicLineSegmentPrefab, transform); PhysicLineSegment secondLineSegment = secondLineSegmentObject.GetComponent(); secondLineSegment.Initialize(originalLineSegment.EndTransform.position,splitPoint); + originalLineSegment.Option.SelectOption(); // Immediately destroy the original line segment Destroy(originalLineSegment.gameObject); @@ -81,12 +82,20 @@ private void AddPhysicsComponents(GameObject lineSegmentObject) HingeJoint2D hinge = lineSegmentObject.AddComponent(); hinge.anchor = Vector2.zero; // Set the anchor at one end of the line segment } - public void BindOptionToLineSegment(string lineSegmentName, YarnOption option) +public void BindOptionToLineSegment(string lineSegmentName, YarnOption option) { InteractiveLineSegment lineSegment = GetLineSegmentByName(lineSegmentName); if (lineSegment != null) { - lineSegment.Option = option; + if (option != null) + { + lineSegment.Option = option; + Debug.Log("Binded option to " + lineSegmentName); + } + else + { + Debug.LogError("Option is null for " + lineSegmentName); + } } } private void EnterLineSegment(InteractiveLineSegment lineSegment) @@ -100,6 +109,11 @@ private void EnterLineSegment(InteractiveLineSegment lineSegment) } private void LongPressLineSegment(InteractiveLineSegment lineSegment) { + if(!lineSegment.IsCuttable) + { + lineSegment.Option.SelectOption(); + return; + } longPressTime += Time.deltaTime; Vector3 midpoint = (lineSegment.StartPoint + lineSegment.EndPoint) / 2; @@ -182,16 +196,17 @@ private void ExitLineSegment() - - private void Start() +private void Start() +{ + // 查找场景中的所有 InteractiveLineSegment 并添加到字典中 + InteractiveLineSegment[] lineSegments = FindObjectsOfType(); + foreach (InteractiveLineSegment lineSegment in lineSegments) { - // 查找场景中的所有 InteractiveLineSegment 并添加到字典中 - InteractiveLineSegment[] lineSegments = FindObjectsOfType(); - foreach (InteractiveLineSegment lineSegment in lineSegments) - { - lineSegmentDictionary.Add(lineSegment.name, lineSegment); - } + lineSegmentDictionary.Add(lineSegment.name, lineSegment); + Debug.Log("Added " + lineSegment.name + " to lineSegmentDictionary"); } +} + public InteractiveLineSegment GetLineSegmentByName(string lineSegmentName) { if (lineSegmentDictionary.TryGetValue(lineSegmentName, out InteractiveLineSegment lineSegment))