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\HighlightBlurOutline.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\HighlightSeeThroughMask.shader" />
<None Include="Assets\HighlightPlus\Resources\HighlightPlus\HighlightInnerGlow.shader" />

View File

@ -344,7 +344,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7587649942819475418, guid: 6c9d41f3e96937c4f960e7fc87ca2d32, type: 3}
propertyPath: m_Name
value: "I\u578B\u96C6\u4E2D\u5668 (1)"
value: "l\u578B\u96C6\u4E2D\u5668"
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
@ -1272,7 +1272,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7587649942819475418, guid: 6c9d41f3e96937c4f960e7fc87ca2d32, type: 3}
propertyPath: m_Name
value: "I\u578B\u96C6\u4E2D\u5668 (2)"
value: "l\u578B\u96C6\u4E2D\u5668"
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
@ -1986,8 +1986,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
serializedVersion: 2
m_LocalRotation: {x: -0.0015304144, y: 0.99706376, z: -0.07372659, w: -0.020641118}
m_LocalPosition: {x: 1.2103322, y: 1.4038103, z: 1.5464077}
m_LocalRotation: {x: -0.118146285, y: 0.76067626, z: -0.14457282, w: -0.6217007}
m_LocalPosition: {x: -1.6662588, y: 1.7118076, z: -0.40496927}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@ -2440,68 +2440,6 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1160688574}
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
PrefabInstance:
m_ObjectHideFlags: 0
@ -4275,7 +4213,6 @@ Transform:
- {fileID: 97983903}
- {fileID: 930152845}
- {fileID: 1730311795}
- {fileID: 1166424403}
- {fileID: 4237368092973860874}
- {fileID: 11517223}
- {fileID: 541355879}
@ -4643,7 +4580,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7587649942819475418, guid: 6c9d41f3e96937c4f960e7fc87ca2d32, type: 3}
propertyPath: m_Name
value: "I\u578B\u96C6\u4E2D\u5668"
value: "l\u578B\u96C6\u4E2D\u5668"
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []

View File

@ -18,22 +18,21 @@ public enum ToolsPackScene
/// <summary>
/// 工具包
/// </summary>
public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
{
private Dictionary<string, GameObject> _toolsPack;
public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
{
private Dictionary<string, List<GameObject>> _toolsPack;
private Dictionary<string, Texture2D> _toolsPackWindowBtImage; //工具窗口下的按钮图集
private List<GameObject> _toolsPackWindowItemBts;//工具窗口下创建的按钮集合,点击按钮的X用来删除和新增
private GameObject _toolsPackWindow;
private List<GameObject> _toolsPackWindowItemBts; //工具窗口下创建的按钮集合,点击按钮的X用来删除和新增
private GameObject _toolsPackWindow;
private GameObject _toolsPackWindowBt;
private Transform _canvas;
private GameObject _toolsPackWindowTemp;
private ToolsPackScene _toolsPackScene;
public void OnCreate(object createParam)
{
_toolsPack = new Dictionary<string, GameObject>();
_toolsPack = new Dictionary<string, List<GameObject>>();
_toolsPackWindowItemBts = new List<GameObject>();
//加载工具窗口按钮
_toolsPackWindowBt = Resources.Load<GameObject>("Prefabs/Window/ToolsPack/ToolsPackWindowItemBt");
@ -76,7 +75,11 @@ public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
{
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>
/// <returns></returns>
public List<string> GetToolsPack()
public Dictionary<string, List<GameObject>> GetToolsPack()
{
List<string> list = new List<string>();
foreach (var v in _toolsPack)
{
list.Add(v.Key);
}
return list;
return _toolsPack;
}
/// <summary>
/// 根据名字查询工具包内容
/// </summary>
/// <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))
{
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)
@ -135,17 +139,17 @@ public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
{
return _toolsPackWindow;
}
public GameObject GetToolsPackWindowBt()
{
return _toolsPackWindowBt;
}
public GameObject GetToolsPackWindowTemp()
{
return _toolsPackWindowTemp;
}
public void SetToolsPackWindowTemp(GameObject win)
{
_toolsPackWindowTemp = win;
@ -160,10 +164,12 @@ public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
return _canvas;
}
public ToolsPackScene GetToolsPackScene()
{
return _toolsPackScene;
}
public void SetToolsPackScene(ToolsPackScene toolsPackScene)
{
_toolsPackScene = toolsPackScene;
@ -173,14 +179,15 @@ public class ToolsPackManager : ModuleSingleton<ToolsPackManager>, IModule
{
_toolsPackWindowItemBts.Add(toolGame);
}
public void ClearToolsPackWindowItemBts()
{
_toolsPackWindowItemBts.Clear();
}
public void DeleteToolsPackWindowItemBts(string toolName)
{
List<string> list = MotionEngine.GetModule<DataConfigManager>().GetToolsPackData(toolName);
List<string> list = MotionEngine.GetModule<DataConfigManager>().GetToolsPackData(toolName);
if (list != null)
{
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 GameObject closeBt;
[SerializeField] private string btName;
[SerializeField] private int index;
[SerializeField] private Text btNameText;
@ -19,18 +20,18 @@ namespace ToolsPack
{
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);
MotionEngine.GetModule<ToolsPackManager>().DeleteToolsPack(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;
this.btName = btName;
this.index = index;
ico.texture = MotionEngine.GetModule<ToolsPackManager>().GetToolsPackWindowBtImage(gName);
if (MotionEngine.GetModule<ToolsPackManager>().GetToolsPackScene() == ToolsPackScene.)
{

View File

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