Compare commits

...

44 Commits

Author SHA1 Message Date
liuyu 19e9b34fa1 Merge branch 'main' into HQB_workspace
# Conflicts:
#	Assets/StreamingAssets/realtimeStat.json
2024-09-09 08:20:29 +08:00
liuyu a66a6f9a3d Merge branch 'main' into HQB_workspace
# Conflicts:
#	Assets/Scripts/Project/Manager/ReconnectMgr.cs
#	Assets/Scripts/Project/Objects/Other/MobileController.cs
#	Assets/StreamingAssets/realtimeStat.json
2024-09-07 17:20:23 +08:00
liuyu 5e26973e4e 使用反射保存Trigger状态变量 2024-09-07 17:17:12 +08:00
liuyu a105033700 Merge branch 'main' into HQB_workspace
# Conflicts:
#	Assets/Scripts/CXX/Score/Score_1002.cs
#	Assets/Scripts/ExcelData/DataContainer/TB_UserExamStat.cs
#	Assets/Scripts/Project/Manager/ReconnectMgr.cs
#	Assets/Scripts/Project/Objects/Other/MobileController.cs
#	Assets/Scripts/Project/Objects/Other/PermanentTriggerBase.cs
2024-09-06 16:44:28 +08:00
liuyu b4cf6286a8 添加部分多场景保存 2024-09-06 15:24:48 +08:00
liuyu b280c5d0de 合并准备 2024-09-06 14:55:01 +08:00
liuyu e26450191a Merge branch 'main' into HQB_workspace
# Conflicts:
#	Assets/StreamingAssets/realtimeStat.json
2024-09-06 14:51:00 +08:00
liuyu 0c4162df67 添加对多场景的记录 2024-09-06 13:27:02 +08:00
liuyu 9e3d0fd4f1 Merge branch 'main' into HQB_workspace 2024-09-06 11:00:25 +08:00
liuyu 5276fcaede 20240906基线2 2024-09-06 11:00:07 +08:00
liuyu 877e3fb7cc 20240906基线 2024-09-06 10:58:09 +08:00
liuyu 17067bc33d 新增工单管理类 2024-09-06 10:04:23 +08:00
liuyu 22c974d21c Merge branch 'main' into HQB_workspace
# Conflicts:
#	Assets/StreamingAssets/realtimeStat.json
2024-09-06 09:07:35 +08:00
liuyu 27c356ba28 111 2024-09-06 08:18:31 +08:00
liuyu 824bc36529 111 2024-09-05 19:51:41 +08:00
liuyu d38e193431 修复从现场回到工具间拿取的工具不消失的bug 2024-09-05 17:25:37 +08:00
liuyu 939810213c Merge branch 'main' into HQB_workspace
# Conflicts:
#	Assets/Scenes/01_InitScene.unity
#	Assets/Scripts/CXX/Devices/杂/低压电流互感器/Device_LowVoltageCurrentTransformer.cs
#	Assets/Scripts/CXX/Devices/直接接入式电能计量装置/Device_Cover.cs
#	Assets/Scripts/CXX/Score/ScoreBase.cs
#	Assets/Scripts/Project/Manager/ReconnectMgr.cs
#	Assets/Scripts/Project/Objects/Other/NPCController.cs
#	Assets/StreamingAssets/realtimeStat.json
#	Assets/StreamingAssets/realtimeStat.json.meta
2024-09-05 13:45:27 +08:00
liuyu 9ca554ab57 抽象类改virtual 2024-09-05 13:41:34 +08:00
liuyu 0b6a393e81 保存读取trigger状态 2024-09-05 13:05:31 +08:00
liuyu b0d1ac0edd 添加Trigger状态记录函数 2024-09-05 11:14:16 +08:00
liuyu 3c9b1c9a8a 读取场景缓存 2024-09-04 17:54:42 +08:00
liuyu 36c6945209 缓存读取 2024-09-04 17:28:08 +08:00
liuyu 1597d53826 读取缓存 2024-09-04 17:12:56 +08:00
liuyu 8fdc47d314 保存场景缓存 2024-09-04 16:52:47 +08:00
liuyu 009110306d 工具栏显示BUG 2024-09-04 15:26:39 +08:00
liuyu eadf603199 在工具间模型上恢复穿戴 2024-09-04 14:07:58 +08:00
liuyu 8664ce8398 Merge branch 'main' into HQB_workspace
# Conflicts:
#	Assets/Scripts/Project/Manager/ProcessManager.cs
#	Assets/Scripts/Project/Manager/ReconnectMgr.cs
2024-09-04 13:38:06 +08:00
liuyu a79129a467 自动保存的启动放在ReconnectMgr中 2024-09-04 13:34:03 +08:00
liuyu 096c742205 分数读取后赋值 2024-09-04 10:38:36 +08:00
liuyu ce401f8b53 Merge branch 'main' into HQB_workspace 2024-09-04 09:24:34 +08:00
liuyu 165d08a8ec no message 2024-09-03 17:58:03 +08:00
liuyu b5083fa17e 记录分数 2024-09-03 17:34:49 +08:00
liuyu 2adbebe563 还原现场触发物场景 2024-09-03 16:09:24 +08:00
liuyu aa02fffc38 Merge branch 'main' into HQB_workspace 2024-09-03 15:04:19 +08:00
liuyu 03735133df 记录现场设备状态 2024-09-03 14:58:28 +08:00
liuyu bcc75cf099 穿戴装备恢复 2024-09-03 14:24:02 +08:00
liuyu 36098d8173 右侧工具栏切换 2024-09-03 14:05:26 +08:00
liuyu da457d6aff 0903 2024-09-03 11:22:28 +08:00
liuyu a502be2aa0 工具和材料状态的保存 2024-09-03 10:53:32 +08:00
liuyu 56eba812fe 获取场景内所有可以点击的物品 2024-09-03 09:38:55 +08:00
liuyu 254f54a708 0902 2024-09-02 22:30:24 +08:00
liuyu 97504b1e4b 保存工具 2024-09-02 19:04:31 +08:00
liuyu 70ada07f3a 记录工具,材料,装备 2024-09-02 18:09:39 +08:00
liuyu 1397e0e6ff GM中添加初始化 2024-09-02 17:19:46 +08:00
13 changed files with 73 additions and 28 deletions

View File

@ -4,7 +4,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Device_Base : PermanentTriggerBase
public abstract class Device_Base : PermanentTriggerBase
{
/// <summary>
/// 设备类型

View File

@ -16,6 +16,7 @@ public class DeviceTrigger : PermanentTriggerBase
/// 点击回调
/// </summary>
public Action clickAction;
protected override void OnMDown()
{
base.OnMDown();

View File

@ -64,5 +64,4 @@ public class Device_Switch : Device_Base
transform.localEulerAngles = new Vector3(0, 45, 0);
}
}

View File

@ -1,4 +1,6 @@
using DG.Tweening;
using LitJson;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@ -90,5 +92,4 @@ public class Device_CabinetDoor : Device_Base
transform.localEulerAngles = Vector3.zero;
transform.Find("¼ÆÁ¿¹ñËø2/¼ÆÁ¿¹ñËø3").localEulerAngles = Vector3.zero;
}
}

View File

@ -72,7 +72,7 @@ public abstract class ScoreBase : MonoBehaviour
}
/// <summary>
/// 设置科目得分,用于断线重连恢复
/// 设置科目得分,用于断线重连恢复 HQB
/// </summary>
public void setCurrentScore(float _score)
{

View File

@ -6,7 +6,7 @@ using UnityEngine;
using LitJson;
/// <summary>
/// ????buffer
/// 转存场景buffer
/// </summary>
public class BufferTemp_1002
{
@ -462,7 +462,7 @@ public class Score_1002 : ScoreBase
}
/// <summary>
/// ?????List??,??????
/// 保存场景中List缓存,用于断线重连
/// </summary>
/// <exception cref="System.NotImplementedException"></exception>
public override string SaveSceneBufferList()
@ -476,13 +476,13 @@ public class Score_1002 : ScoreBase
tmp.installCover = installCover;
tmp.currentInstallTestJieXian = currentInstallTestJieXian;
string sceneInfo = JsonConvert.SerializeObject(tmp, Formatting.Indented);
Debug.Log("==????:" + sceneInfo);
Debug.Log("==场景信息:" + sceneInfo);
return sceneInfo;
//throw new System.NotImplementedException();
}
/// <summary>
/// ??????
/// 读取场景缓存
/// </summary>
public override void LoadSceneBufferList(string sceneInfo)
{

View File

@ -101,4 +101,5 @@ public class Tool_Base : PermanentTriggerBase
back?.Invoke();
});
}
}

View File

@ -27,6 +27,13 @@ public class ReconnectTriggerInfo
public string triggerInfo;
}
//每个场景中保存的信息
public class ReconnectSpecialScene
{
public string sceneName;
public List<ReconnectItemInfo> currentSceneTools = new List<ReconnectItemInfo>();
public List<ReconnectTriggerInfo> currentSceneTriggers = new List<ReconnectTriggerInfo>();
}
//用于记录场景中物品的信息
[Serializable]
@ -55,7 +62,7 @@ public class TB_UserExamStat
/// <summary>
/// 用户经历过的场景
/// </summary>
//public List<string> experiencedScene = new List<string>();
public List<string> experiencedScene = new List<string>();
/// <summary>
/// 背包中所有的工具和材料
@ -86,4 +93,9 @@ public class TB_UserExamStat
/// 关卡内所有缓存信息,不定数据格式
/// </summary>
public string currentSceneOtherInfo = "";
/// <summary>
/// 记录每个场景中的情况
/// </summary>
public List<ReconnectSpecialScene> experiencedScenes = new List<ReconnectSpecialScene>();
}

View File

@ -39,16 +39,16 @@ public class ReconnectMgr : SingletonMono<ReconnectMgr>
/// <summary>
/// 用户每经历一个场景就需要保存一个场景的数据
/// </summary>
//public bool IntoNewScene(string sceneName)
//{
// if (UserExamStat.experiencedScene.Contains(sceneName))
// return false;
// else
// {
// UserExamStat.experiencedScene.Add(sceneName);
// return true;
// }
//}
public bool IntoNewScene(string sceneName)
{
if (UserExamStat.experiencedScene.Contains(sceneName))
return false;
else
{
UserExamStat.experiencedScene.Add(sceneName);
return true;
}
}
ReconnectMgr()//构造函数
{
@ -199,7 +199,7 @@ public class ReconnectMgr : SingletonMono<ReconnectMgr>
public void RecoverScene()
{
//先恢复场景
ScenesManager.Instance.LoadSceneAsyn($"{GameManager.Instance.systemId}_{GameManager.RunModelMgr.schemeID}_{UserExamStat.sceneName}", () =>
ScenesManager.Instance.LoadSceneAsyn(UserExamStat.sceneName, () =>
{
//右侧工具栏切换
if (!GameManager.UIMgr.GetPanel<UI_MenuBar>())//office场景下,右侧工具栏可能会隐藏
@ -329,4 +329,5 @@ public class ReconnectMgr : SingletonMono<ReconnectMgr>
RecoverScene();
}
}
}
}

View File

@ -27,6 +27,4 @@ public class MirrorController : PermanentTriggerBase
_highlight.SetHighlighted(false);
}
}
}

View File

@ -3,6 +3,9 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using LitJson;
using Newtonsoft.Json;
using Unity.VisualScripting;
using System.Reflection;
public class MobileController : PermanentTriggerBase

View File

@ -19,6 +19,10 @@ public class ScenesManager : BaseManager<ScenesManager>
LoadSceneMode loadSceneMode = LoadSceneMode.Single)
{
SceneManager.LoadScene(sceneName, loadSceneMode);
if (ReconnectMgr.Instance != null) //进入场景后做记录
{
ReconnectMgr.Instance.IntoNewScene(sceneName);
}
action?.Invoke();
}
@ -67,6 +71,10 @@ public class ScenesManager : BaseManager<ScenesManager>
{
yield return null;
}
if (ReconnectMgr.Instance != null)//进入场景后做记录
{
ReconnectMgr.Instance.IntoNewScene(sceneName);
}
action?.Invoke();
}
}

View File

@ -7,13 +7,13 @@
"index": 1,
"subProcessId": 1,
"currentScore": 0.0,
"isDone": false
"isDone": true
},
{
"index": 2,
"subProcessId": 2,
"currentScore": 0.0,
"isDone": false
"isDone": true
},
{
"index": 3,
@ -112,10 +112,31 @@
"isDone": false
}
],
"experiencedScene": [
"02_MenuScene",
"03_OfficeScene"
],
"allToolAndMaterial": [],
"allWear": [],
"sceneName": "02_MenuScene",
"sceneName": "03_OfficeScene",
"currentSceneTools": [],
"currentSceneTriggers": [],
"currentSceneOtherInfo": "{\r\n \"TestPen3list\": [],\r\n \"InSwitchCloseYDList\": [],\r\n \"InSwitchOpenYDList\": [],\r\n \"currentunInstallJieXian\": [],\r\n \"currentInstallJieXian\": [],\r\n \"installCover\": [],\r\n \"currentInstallTestJieXian\": []\r\n}"
"currentSceneTriggers": [
{
"triggerID": 5005,
"triggerName": "手机",
"selfPosInScene": {
"x": 0.0244421959,
"y": 0.885706842,
"z": -1.00569367
},
"selfRotInScene": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"triggerInfo": "{\"downIndex\":\"2\",\"triggerID\":\"5005\",\"triggerName\":\"\\u624B\\u673A\"}"
}
],
"currentSceneOtherInfo": "{\r\n \"TestPen3list\": [],\r\n \"InSwitchCloseYDList\": [],\r\n \"InSwitchOpenYDList\": [],\r\n \"currentunInstallJieXian\": [],\r\n \"currentInstallJieXian\": [],\r\n \"installCover\": [],\r\n \"currentInstallTestJieXian\": []\r\n}",
"experiencedScenes": []
}