Przeglądaj źródła

修复bug,添加一些功能

ZXP 1 rok temu
rodzic
commit
c2585c4c95

+ 1 - 1
Assets/Prefabs/SelectPrefab.prefab

@@ -367,7 +367,7 @@ MonoBehaviour:
     m_HorizontalOverflow: 0
     m_VerticalOverflow: 0
     m_LineSpacing: 1
-  m_Text: "\u786E\n\u8BA4"
+  m_Text: "\u4E0B\n\u4E00\n\u9898"
 --- !u!1 &5943149762659415345
 GameObject:
   m_ObjectHideFlags: 0

+ 3 - 0
Assets/Prefabs/WorldCanvas.prefab

@@ -1027,6 +1027,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0bb5e4d934d798343a34c26749cec382, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  loginGameObject: {fileID: 0}
   tj1: {fileID: 0}
   tj2: {fileID: 0}
   id: 
@@ -1709,6 +1710,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0bb5e4d934d798343a34c26749cec382, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  loginGameObject: {fileID: 0}
   tj1: {fileID: 0}
   tj2: {fileID: 0}
   id: 
@@ -1996,6 +1998,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 8cc76c86cf553c043a01d9b8dbc52259, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  skipButton: {fileID: 4400771669350186595}
   playListObjects1:
   - {fileID: 6406441234647609677}
   - {fileID: 6406441234365648108}

+ 66 - 20
Assets/Scenes/Main.unity

@@ -3063,6 +3063,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 0bb5e4d934d798343a34c26749cec382, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  loginGameObject: {fileID: 0}
   tj1: {fileID: 0}
   tj2: {fileID: 0}
   id: 
@@ -3680,16 +3681,60 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
       propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
-      value: 1
+      value: 3
+      objectReference: {fileID: 0}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_Mode
+      value: 6
+      objectReference: {fileID: 0}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[2].m_Mode
+      value: 6
       objectReference: {fileID: 0}
     - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
       propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
       value: 
       objectReference: {fileID: 5374442942383228809}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_Target
+      value: 
+      objectReference: {fileID: 5374442943955902139}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[2].m_Target
+      value: 
+      objectReference: {fileID: 6864616657517224061}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[2].m_CallState
+      value: 2
+      objectReference: {fileID: 0}
     - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
       propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
       value: SetActive
       objectReference: {fileID: 0}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName
+      value: SetActive
+      objectReference: {fileID: 0}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[2].m_MethodName
+      value: SetActive
+      objectReference: {fileID: 0}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[2].m_TargetAssemblyTypeName
+      value: UnityEngine.GameObject, UnityEngine
+      objectReference: {fileID: 0}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[2].m_Arguments.m_BoolArgument
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_Arguments.m_ObjectArgumentAssemblyTypeName
+      value: UnityEngine.Object, UnityEngine
+      objectReference: {fileID: 0}
+    - target: {fileID: 5256516899290289149, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
+      propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[2].m_Arguments.m_ObjectArgumentAssemblyTypeName
+      value: UnityEngine.Object, UnityEngine
+      objectReference: {fileID: 0}
     - target: {fileID: 5477182567403614777, guid: 2980ccc56dc596f498fa8bbd3b808cd9, type: 3}
       propertyPath: m_audioClip
       value: 
@@ -5058,7 +5103,7 @@ MonoBehaviour:
   m_OnEndEdit:
     m_PersistentCalls:
       m_Calls:
-      - m_Target: {fileID: 7135262254243271687}
+      - m_Target: {fileID: 6026058373977464324}
         m_TargetAssemblyTypeName: Login, Assembly-CSharp
         m_MethodName: InputPhoneNumber
         m_Mode: 0
@@ -5122,7 +5167,6 @@ GameObject:
   - component: {fileID: 5374442942383228810}
   - component: {fileID: 5374442942383228852}
   - component: {fileID: 5374442942383228811}
-  - component: {fileID: 7135262254243271687}
   m_Layer: 5
   m_Name: Login
   m_TagString: Untagged
@@ -5488,7 +5532,7 @@ MonoBehaviour:
           m_StringArgument: 
           m_BoolArgument: 1
         m_CallState: 2
-      - m_Target: {fileID: 7135262254243271687}
+      - m_Target: {fileID: 6026058373977464324}
         m_TargetAssemblyTypeName: Login, Assembly-CSharp
         m_MethodName: GetList
         m_Mode: 1
@@ -7312,6 +7356,7 @@ GameObject:
   serializedVersion: 6
   m_Component:
   - component: {fileID: 6026058373977464323}
+  - component: {fileID: 6026058373977464324}
   m_Layer: 0
   m_Name: VR
   m_TagString: Untagged
@@ -7336,6 +7381,23 @@ Transform:
   m_Father: {fileID: 0}
   m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &6026058373977464324
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6026058373977464322}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 0bb5e4d934d798343a34c26749cec382, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  loginGameObject: {fileID: 5374442942383228809}
+  tj1: {fileID: 4400771668005549539}
+  tj2: {fileID: 4400771668005549538}
+  id: gdsslw102
+  key: gdsslw102
 --- !u!20 &6026058374356012568
 Camera:
   m_ObjectHideFlags: 0
@@ -7583,22 +7645,6 @@ GameObject:
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
   m_IsActive: 0
---- !u!114 &7135262254243271687
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 5374442942383228809}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 0bb5e4d934d798343a34c26749cec382, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  tj1: {fileID: 4400771668005549539}
-  tj2: {fileID: 4400771668005549538}
-  id: gdsslw102
-  key: gdsslw102
 --- !u!222 &7492295443749115791
 CanvasRenderer:
   m_ObjectHideFlags: 0

+ 4 - 0
Assets/Scripts/AnimatorControl.cs

@@ -40,6 +40,10 @@ public class AnimatorControl : MonoBehaviour
     private void OnDisable()
     {
         audioSource.Stop();
+        animator.SetBool("S1", false);
+        animator.SetBool("S2", false);
+        animator.SetBool("S3", false);
+        animator.SetBool("Hold", true);
     }
     private IEnumerator Hold()
     {

+ 51 - 9
Assets/Scripts/Login.cs

@@ -9,8 +9,9 @@ using System.Security.Cryptography;
 using System.Text;
 using UnityEngine.Networking;
 
-public class Login : MonoBehaviour
+public class Login : SingletonBaseMono<Login>
 {
+    public GameObject loginGameObject;
     public GameObject tj1;
     public GameObject tj2;
 
@@ -33,6 +34,27 @@ public class Login : MonoBehaviour
     {
 
     }
+
+    /// <summary>
+    /// 发送成绩
+    /// </summary>
+    public void SendList(ArrayData arrayData)
+    {
+        List<ArrayData> arrays = new List<ArrayData>();
+        arrays.Add(arrayData);
+        string jsonValue = JsonConvert.SerializeObject(arrays);
+        StartCoroutine(SendListCoroutine(jsonValue));
+    }
+    public IEnumerator SendListCoroutine(string jsonValue)
+    {
+        WWWForm form = new WWWForm();
+        form.AddField("terminal-token", GetToken());
+        form.AddField("phoneNumber", phoneNumber);
+        form.AddField("array", jsonValue);
+        UnityWebRequest unityWebRequest = UnityWebRequest.Post("http://gdsyzxlwxx.dds-ai.cn/jxpc-server/third-api/vr/api/save-train-result", form);
+        yield return unityWebRequest.SendWebRequest();
+        Debug.Log(unityWebRequest.downloadHandler.text);
+    }
     public void InputPhoneNumber(string phoneNumber)
     {
         this.phoneNumber = phoneNumber;
@@ -48,9 +70,10 @@ public class Login : MonoBehaviour
         form.AddField("phoneNumber", phoneNumber);
         UnityWebRequest unityWebRequest = UnityWebRequest.Post("http://gdsyzxlwxx.dds-ai.cn/jxpc-server/third-api/vr/api/get-train-state", form);
         yield return unityWebRequest.SendWebRequest();
-        gameObject.SetActive(false);
+        loginGameObject.SetActive(false);
         JObject keyValuePairs = JObject.Parse(unityWebRequest.downloadHandler.text);
         string code = keyValuePairs["code"].ToString();
+        Debug.Log(unityWebRequest.downloadHandler.text);
         if (code != "200")
         {
 
@@ -103,11 +126,30 @@ public class Login : MonoBehaviour
 
 
 
-
-
-
-
-
-
-
+}
+public class ArrayData
+{
+    /// <summary>
+    /// 错误数量
+    /// </summary>
+    public int wrongCount;
+    /// <summary>
+    /// 正确数量
+    /// </summary>
+    public int correctCount;
+    /// <summary>
+    /// 错误选择情况
+    /// </summary>
+    public List<WrongQuestionsItem> wrongQuestions;
+}
+public class WrongQuestionsItem
+{
+    /// <summary>
+    /// 错误题号
+    /// </summary>
+    public string questionId;
+    /// <summary>
+    /// 错误选项
+    /// </summary>
+    public string userWrongOption;
 }

+ 3 - 0
Assets/Scripts/PlayList.cs

@@ -7,6 +7,7 @@ using System;
 
 public class PlayList : MonoBehaviour
 {
+    public GameObject skipButton;
     public GameObject[] playListObjects1;
     public GameObject[] playListObjects;
     /// <summary>
@@ -84,10 +85,12 @@ public class PlayList : MonoBehaviour
         SelectPrefab selectPrefab = obj.GetComponent<SelectPrefab>();
         if (selectPrefab == null)
         {
+            skipButton.SetActive(true);
             waitTime = obj.GetComponent<AudioSource>().clip.length + 1;
         }
         else
         {
+            skipButton.SetActive(false);
             waitTime = 9999999;
             selectPrefab.SelectPrefabCreateInit((bool value) =>
             {

+ 6 - 1
Assets/Scripts/SelectPrefab.cs

@@ -65,6 +65,10 @@ public class SelectPrefab : MonoBehaviour
         audioSource = GetComponent<AudioSource>();
         toggleGroup = GetComponent<ToggleGroup>();
     }
+    private void OnEnable()
+    {
+        text.gameObject.SetActive(true);
+    }
     private void Start()
     {
 
@@ -136,7 +140,8 @@ public class SelectPrefab : MonoBehaviour
         }
         else
         {
-            selectCallBack?.Invoke(isRight);
+            closeButton.gameObject.SetActive(true);
+            //selectCallBack?.Invoke(isRight);
         }
 
     }

+ 6 - 6
Assets/教室/motion/教师课堂行为管理情景.controller

@@ -17,9 +17,9 @@ AnimatorStateTransition:
   m_Mute: 0
   m_IsExit: 0
   serializedVersion: 3
-  m_TransitionDuration: 2.3257127
+  m_TransitionDuration: 0.6629262
   m_TransitionOffset: 0
-  m_ExitTime: 0.73571473
+  m_ExitTime: 0.8998058
   m_HasExitTime: 0
   m_HasFixedDuration: 1
   m_InterruptionSource: 0
@@ -95,9 +95,9 @@ AnimatorStateTransition:
   m_Mute: 0
   m_IsExit: 0
   serializedVersion: 3
-  m_TransitionDuration: 2.3440757
+  m_TransitionDuration: 0.573524
   m_TransitionOffset: 0
-  m_ExitTime: 0.7585597
+  m_ExitTime: 0.901969
   m_HasExitTime: 0
   m_HasFixedDuration: 1
   m_InterruptionSource: 0
@@ -301,9 +301,9 @@ AnimatorStateTransition:
   m_Mute: 0
   m_IsExit: 0
   serializedVersion: 3
-  m_TransitionDuration: 2.288424
+  m_TransitionDuration: 0.30455494
   m_TransitionOffset: 0
-  m_ExitTime: 0.7339041
+  m_ExitTime: 0.897186
   m_HasExitTime: 0
   m_HasFixedDuration: 1
   m_InterruptionSource: 0

粤ICP备19079148号