Merge branch 'SXElectricityInformationAcquisition' of http://gitea.umayle.com/huangjiayu/ShanxiKnowledgeBase into SXElectricityInformationAcquisition

This commit is contained in:
黄嘉宇 2024-06-05 00:18:10 +08:00
commit a5faf89ff9
6 changed files with 64 additions and 110 deletions

View File

@ -81,6 +81,7 @@
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightTarget.shader" /> <None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightTarget.shader" />
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightBlurOutline.shader" /> <None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightBlurOutline.shader" />
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightBlurGlow.shader" /> <None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightBlurGlow.shader" />
<None Include="Assets\Shader\遮罩贴图材质球.shader" />
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightAddDepth.shader" /> <None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightAddDepth.shader" />
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightSeeThroughMask.shader" /> <None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightSeeThroughMask.shader" />
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightInnerGlow.shader" /> <None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightInnerGlow.shader" />

View File

@ -344,7 +344,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7587649942819475418, guid: 6c9d41f3e96937c4f960e7fc87ca2d32, type: 3} - target: {fileID: 7587649942819475418, guid: 6c9d41f3e96937c4f960e7fc87ca2d32, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: "I\u578B\u96C6\u4E2D\u5668 (1)" value: "l\u578B\u96C6\u4E2D\u5668"
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
@ -1272,7 +1272,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7587649942819475418, guid: 6c9d41f3e96937c4f960e7fc87ca2d32, type: 3} - target: {fileID: 7587649942819475418, guid: 6c9d41f3e96937c4f960e7fc87ca2d32, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: "I\u578B\u96C6\u4E2D\u5668 (2)" value: "l\u578B\u96C6\u4E2D\u5668"
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
@ -1986,8 +1986,8 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225} m_GameObject: {fileID: 963194225}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0.0015304144, y: 0.99706376, z: -0.07372659, w: -0.020641118} m_LocalRotation: {x: -0.118146285, y: 0.76067626, z: -0.14457282, w: -0.6217007}
m_LocalPosition: {x: 1.2103322, y: 1.4038103, z: 1.5464077} m_LocalPosition: {x: -1.6662588, y: 1.7118076, z: -0.40496927}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -2440,68 +2440,6 @@ MeshFilter:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1160688574} m_GameObject: {fileID: 1160688574}
m_Mesh: {fileID: 2272001217198551621, guid: 156cca832bad49447b16a92685b1fa5b, type: 3} m_Mesh: {fileID: 2272001217198551621, guid: 156cca832bad49447b16a92685b1fa5b, type: 3}
--- !u!1001 &1166424402
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1771205975173060022}
m_Modifications:
- target: {fileID: 2531760708895959068, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_Name
value: "\u5DE5\u4F5C\u5355 (1)"
objectReference: {fileID: 0}
- target: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_LocalPosition.x
value: -3.128
objectReference: {fileID: 0}
- target: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_LocalPosition.y
value: 1.559
objectReference: {fileID: 0}
- target: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_LocalPosition.z
value: -4.491
objectReference: {fileID: 0}
- target: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_LocalRotation.w
value: 0.50000155
objectReference: {fileID: 0}
- target: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_LocalRotation.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_LocalRotation.y
value: -0.5
objectReference: {fileID: 0}
- target: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_LocalRotation.z
value: 0.49999842
objectReference: {fileID: 0}
- target: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 90
objectReference: {fileID: 0}
- target: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 90
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
--- !u!4 &1166424403 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 8682586252348545697, guid: d0b0fe5637eccca4d916e04a7613ab7b, type: 3}
m_PrefabInstance: {fileID: 1166424402}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1189895269 --- !u!1001 &1189895269
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -4275,7 +4213,6 @@ Transform:
- {fileID: 97983903} - {fileID: 97983903}
- {fileID: 930152845} - {fileID: 930152845}
- {fileID: 1730311795} - {fileID: 1730311795}
- {fileID: 1166424403}
- {fileID: 4237368092973860874} - {fileID: 4237368092973860874}
- {fileID: 11517223} - {fileID: 11517223}
- {fileID: 541355879} - {fileID: 541355879}
@ -4643,7 +4580,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7587649942819475418, guid: 6c9d41f3e96937c4f960e7fc87ca2d32, type: 3} - target: {fileID: 7587649942819475418, guid: 6c9d41f3e96937c4f960e7fc87ca2d32, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: "I\u578B\u96C6\u4E2D\u5668" value: "l\u578B\u96C6\u4E2D\u5668"
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []

View File

@ -18,22 +18,21 @@ public enum ToolsPackScene
/// <summary> /// <summary>
/// 工具包 /// 工具包
/// </summary> /// </summary>
public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
{ {
private Dictionary<string, List<GameObject>> _toolsPack;
private Dictionary<string, GameObject> _toolsPack;
private Dictionary<string, Texture2D> _toolsPackWindowBtImage; //工具窗口下的按钮图集 private Dictionary<string, Texture2D> _toolsPackWindowBtImage; //工具窗口下的按钮图集
private List<GameObject> _toolsPackWindowItemBts;//工具窗口下创建的按钮集合,点击按钮的X用来删除和新增 private List<GameObject> _toolsPackWindowItemBts; //工具窗口下创建的按钮集合,点击按钮的X用来删除和新增
private GameObject _toolsPackWindow; private GameObject _toolsPackWindow;
private GameObject _toolsPackWindowBt; private GameObject _toolsPackWindowBt;
private Transform _canvas; private Transform _canvas;
private GameObject _toolsPackWindowTemp; private GameObject _toolsPackWindowTemp;
private ToolsPackScene _toolsPackScene; private ToolsPackScene _toolsPackScene;
public void OnCreate(object createParam) public void OnCreate(object createParam)
{ {
_toolsPack = new Dictionary<string, GameObject>(); _toolsPack = new Dictionary<string, List<GameObject>>();
_toolsPackWindowItemBts = new List<GameObject>(); _toolsPackWindowItemBts = new List<GameObject>();
//加载工具窗口按钮 //加载工具窗口按钮
_toolsPackWindowBt = Resources.Load<GameObject>("Prefabs/Window/ToolsPack/ToolsPackWindowItemBt"); _toolsPackWindowBt = Resources.Load<GameObject>("Prefabs/Window/ToolsPack/ToolsPackWindowItemBt");
@ -76,7 +75,11 @@ public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
{ {
if (!_toolsPack.ContainsKey(toolsName)) if (!_toolsPack.ContainsKey(toolsName))
{ {
_toolsPack.Add(toolsName, toolsGame); _toolsPack.Add(toolsName, new List<GameObject>() { toolsGame });
}
else
{
_toolsPack[toolsName].Add(toolsGame);
} }
} }
@ -93,31 +96,32 @@ public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
/// 获取所有工具包内容 /// 获取所有工具包内容
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public List<string> GetToolsPack() public Dictionary<string, List<GameObject>> GetToolsPack()
{ {
List<string> list = new List<string>();
foreach (var v in _toolsPack) return _toolsPack;
{
list.Add(v.Key);
}
return list;
} }
/// <summary> /// <summary>
/// 根据名字查询工具包内容 /// 根据名字查询工具包内容
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public (string, GameObject) GetToolsPack(string toolsName) public GameObject GetToolsPack(string toolsName,int index)
{ {
GameObject game; List<GameObject> game;
if (_toolsPack.TryGetValue(toolsName, out game)) if (_toolsPack.TryGetValue(toolsName, out game))
{ {
return (toolsName, game); for (int i = 0; i < game.Count; i++)
{
if (i == index)
{
return (game[i]);
}
}
} }
return (toolsName, null); return null;
} }
public Texture2D GetToolsPackWindowBtImage(string gName) public Texture2D GetToolsPackWindowBtImage(string gName)
@ -135,17 +139,17 @@ public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
{ {
return _toolsPackWindow; return _toolsPackWindow;
} }
public GameObject GetToolsPackWindowBt() public GameObject GetToolsPackWindowBt()
{ {
return _toolsPackWindowBt; return _toolsPackWindowBt;
} }
public GameObject GetToolsPackWindowTemp() public GameObject GetToolsPackWindowTemp()
{ {
return _toolsPackWindowTemp; return _toolsPackWindowTemp;
} }
public void SetToolsPackWindowTemp(GameObject win) public void SetToolsPackWindowTemp(GameObject win)
{ {
_toolsPackWindowTemp = win; _toolsPackWindowTemp = win;
@ -160,10 +164,12 @@ public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
return _canvas; return _canvas;
} }
public ToolsPackScene GetToolsPackScene() public ToolsPackScene GetToolsPackScene()
{ {
return _toolsPackScene; return _toolsPackScene;
} }
public void SetToolsPackScene(ToolsPackScene toolsPackScene) public void SetToolsPackScene(ToolsPackScene toolsPackScene)
{ {
_toolsPackScene = toolsPackScene; _toolsPackScene = toolsPackScene;
@ -173,14 +179,15 @@ public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
{ {
_toolsPackWindowItemBts.Add(toolGame); _toolsPackWindowItemBts.Add(toolGame);
} }
public void ClearToolsPackWindowItemBts() public void ClearToolsPackWindowItemBts()
{ {
_toolsPackWindowItemBts.Clear(); _toolsPackWindowItemBts.Clear();
} }
public void DeleteToolsPackWindowItemBts(string toolName) public void DeleteToolsPackWindowItemBts(string toolName)
{ {
List<string> list = MotionEngine.GetModule<DataConfigManager>().GetToolsPackData(toolName);
List<string> list = MotionEngine.GetModule<DataConfigManager>().GetToolsPackData(toolName);
if (list != null) if (list != null)
{ {
for (int i = 0; i < _toolsPackWindowItemBts.Count; i++) for (int i = 0; i < _toolsPackWindowItemBts.Count; i++)
@ -208,7 +215,5 @@ public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
} }
} }
} }
} }
} }

View File

@ -12,6 +12,7 @@ namespace ToolsPack
[SerializeField] private RawImage ico; [SerializeField] private RawImage ico;
[SerializeField] private GameObject closeBt; [SerializeField] private GameObject closeBt;
[SerializeField] private string btName; [SerializeField] private string btName;
[SerializeField] private int index;
[SerializeField] private Text btNameText; [SerializeField] private Text btNameText;
@ -19,18 +20,18 @@ namespace ToolsPack
{ {
closeBt.GetComponent<Button>().onClick.AddListener(delegate closeBt.GetComponent<Button>().onClick.AddListener(delegate
{ {
(string str, GameObject toolsGame) = MotionEngine.GetModule<ToolsPackManager>().GetToolsPack(btName); GameObject toolsGame = MotionEngine.GetModule<ToolsPackManager>().GetToolsPack(btName,index);
toolsGame.SetActive(true); toolsGame.SetActive(true);
MotionEngine.GetModule<ToolsPackManager>().DeleteToolsPack(btName); MotionEngine.GetModule<ToolsPackManager>().DeleteToolsPack(btName);
MotionEngine.GetModule<ToolsPackManager>().DeleteToolsPackWindowItemBts(btName); MotionEngine.GetModule<ToolsPackManager>().DeleteToolsPackWindowItemBts(btName);
}); });
} }
public void Init(string gName, string btName) public void Init(string gName, string btName,int index)
{ {
btNameText.text = gName; btNameText.text = gName;
this.btName = btName; this.btName = btName;
this.index = index;
ico.texture = MotionEngine.GetModule<ToolsPackManager>().GetToolsPackWindowBtImage(gName); ico.texture = MotionEngine.GetModule<ToolsPackManager>().GetToolsPackWindowBtImage(gName);
if (MotionEngine.GetModule<ToolsPackManager>().GetToolsPackScene() == ToolsPackScene.) if (MotionEngine.GetModule<ToolsPackManager>().GetToolsPackScene() == ToolsPackScene.)
{ {

View File

@ -12,7 +12,7 @@ namespace ToolsPack
/// </summary> /// </summary>
public class ToolsPackWindowManager : MonoBehaviour public class ToolsPackWindowManager : MonoBehaviour
{ {
private List<string> _toolsNames; private Dictionary<string, List<GameObject>> _toolsNames;
[SerializeField] private Transform content; [SerializeField] private Transform content;
@ -23,6 +23,7 @@ namespace ToolsPack
{ {
Destroy(content.GetChild(i).gameObject); Destroy(content.GetChild(i).gameObject);
} }
MotionEngine.GetModule<ToolsPackManager>().ClearToolsPackWindowItemBts(); MotionEngine.GetModule<ToolsPackManager>().ClearToolsPackWindowItemBts();
//初始化工具集 //初始化工具集
@ -31,23 +32,32 @@ namespace ToolsPack
GameObject bt = MotionEngine.GetModule<ToolsPackManager>().GetToolsPackWindowBt(); GameObject bt = MotionEngine.GetModule<ToolsPackManager>().GetToolsPackWindowBt();
foreach (var v in _toolsNames) foreach (var v in _toolsNames)
{ {
List<string> li = MotionEngine.GetModule<DataConfigManager>().GetToolsPackData(v); List<string> li = MotionEngine.GetModule<DataConfigManager>().GetToolsPackData(v.Key);
if (li == null) if (li == null)
{ {
ToolsPackWindowItemBtComponent btComponent = Instantiate(bt, content, false).GetComponent<ToolsPackWindowItemBtComponent>(); ToolsPackWindowItemBtComponent btComponent = Instantiate(bt, content, false).GetComponent<ToolsPackWindowItemBtComponent>();
btComponent.name = v; btComponent.name = v.Key;
btComponent.Init(v,v); btComponent.Init(v.Key, v.Key, 0);
MotionEngine.GetModule<ToolsPackManager>().AddToolsPackWindowItemBts(btComponent.gameObject); MotionEngine.GetModule<ToolsPackManager>().AddToolsPackWindowItemBts(btComponent.gameObject);
} }
else else
{ {
foreach (var to in li) int index = 0;
foreach (var lis in v.Value)
{ {
ToolsPackWindowItemBtComponent btComponent = Instantiate(bt, content, false).GetComponent<ToolsPackWindowItemBtComponent>(); foreach (var to in li)
btComponent.name = to; {
btComponent.Init(to,v); ToolsPackWindowItemBtComponent btComponent = Instantiate(bt, content, false).GetComponent<ToolsPackWindowItemBtComponent>();
MotionEngine.GetModule<ToolsPackManager>().AddToolsPackWindowItemBts(btComponent.gameObject); btComponent.name = to;
btComponent.Init(to,v.Key,index);
MotionEngine.GetModule<ToolsPackManager>().AddToolsPackWindowItemBts(btComponent.gameObject);
}
index++;
} }
} }
} }
} }

View File

@ -10,7 +10,7 @@
"盒装螺丝", "盒装螺丝",
"盒装封印", "盒装封印",
{ {
"name": "集中器", "name": "l型集中器",
"models": [ "models": [
"集中器无盖模型", "集中器无盖模型",
"集中器盖子模型" "集中器盖子模型"