提交日志-20240701-1013

1、优化了【腾讯文档】散货0628问题修复
https://docs.qq.com/sheet/DT095c21TZ05NcXNo其中除B0014、B0023、B0031外的相关内容(修复人员含wj的部分);
2、堆区改为模型交互,且悬浮和点击具有不同的高亮效果;现已移除模糊查询筛选边框高亮的效果;
3、模糊查询新增企业Id参数;
This commit is contained in:
Afeijia 2024-07-01 10:23:25 +08:00
parent 612ae927bd
commit cf3792d7b7
29 changed files with 1197 additions and 637 deletions

View File

@ -124,7 +124,7 @@ Material:
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0, g: 0.63170195, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 0.39215687, g: 0.7372549, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 509.99216, b: 1024, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 09f3443a49251594b9e90ee00cb2cbfe
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 8bd5b470d052489459a8a41bbe6cd108
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.UIElements;
using static UnityEngine.GraphicsBuffer;
[CustomEditor(typeof(MiniMapManager))]
public class MiniMapManagerEditor : Editor
@ -87,16 +88,24 @@ public class MiniMapManagerEditor : Editor
SerializedProperty OriginTransform;
SerializedProperty MiniMap;
SerializedProperty PlayerInMap;
SerializedProperty FullScreenMiniMapOrthographicSize;
SerializedProperty DragSpeed;
SerializedProperty ZoomSpeed;
//SerializedProperty OrthographicSizeClamp;
SerializedProperty MinOrthographicSize;
SerializedProperty OrthographicSizeClamp;
SerializedProperty MiniMapTransport;
SerializedProperty MiniMapRayLayer;
SerializedProperty RayDistance;
bool use_chinese;
MiniMapManager _target;
protected virtual void OnEnable()
{
_target = target as MiniMapManager;
KeepPlayerInMiniMapCenter = serializedObject.FindProperty("KeepPlayerInMiniMapCenter");
MiniCamera = serializedObject.FindProperty("MiniCamera");
Player = serializedObject.FindProperty("Player");
@ -108,8 +117,11 @@ public class MiniMapManagerEditor : Editor
DragSpeed = serializedObject.FindProperty("DragSpeed");
ZoomSpeed = serializedObject.FindProperty("ZoomSpeed");
//OrthographicSizeClamp = serializedObject.FindProperty("OrthographicSizeClamp");
MinOrthographicSize = serializedObject.FindProperty("MinOrthographicSize");
OrthographicSizeClamp = serializedObject.FindProperty("OrthographicSizeClamp");
MiniMapTransport = serializedObject.FindProperty("MiniMapTransport");
MiniMapRayLayer = serializedObject.FindProperty("MiniMapRayLayer");
RayDistance = serializedObject.FindProperty("RayDistance");
}
public override void OnInspectorGUI()
@ -133,9 +145,18 @@ public class MiniMapManagerEditor : Editor
EditorGUILayout.PropertyField(FullScreenMiniMapOrthographicSize, new GUIContent(use_chinese ? "小地图相机可视全地图时的正交尺寸大小" : FullScreenMiniMapOrthographicSize.name));
EditorGUILayout.PropertyField(DragSpeed, new GUIContent(use_chinese ? "小地图拖拽速度" : DragSpeed.name));
EditorGUILayout.PropertyField(ZoomSpeed, new GUIContent(use_chinese ? "小地图缩放速度" : ZoomSpeed.name));
//EditorGUILayout.PropertyField(OrthographicSizeClamp, new GUIContent(use_chinese ? "苤華芞坫溫癹秶毓峓" : OrthographicSizeClamp.name));
EditorGUILayout.PropertyField(MinOrthographicSize, new GUIContent(use_chinese ? "苤華芞坫溫癹秶毓峓" : MinOrthographicSize.name));
EditorGUILayout.PropertyField(OrthographicSizeClamp, new GUIContent(use_chinese ? "苤華芞坫溫癹秶毓峓" : OrthographicSizeClamp.name));
GUILayout.Space(5);
GUILayout.Label("苤華芞換冞");
GUILayout.Space(5);
EditorGUILayout.PropertyField(MiniMapTransport, new GUIContent(use_chinese ? "岆瘁ぎ蚚苤華芞換冞" : MiniMapTransport.name));
if (_target.MiniMapTransport)
{
EditorGUILayout.PropertyField(MiniMapRayLayer, new GUIContent(use_chinese ? "苤華芞扞盄潰聆脯" : MiniMapRayLayer.name));
EditorGUILayout.PropertyField(RayDistance, new GUIContent(use_chinese ? "扞盄擒燭" : RayDistance.name));
}
serializedObject.ApplyModifiedProperties();
}

View File

@ -155,7 +155,7 @@ Camera:
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 23
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 8400000, guid: eb2348187ce6e8342b18435f608b12a5, type: 2}
m_TargetDisplay: 0
@ -179,7 +179,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RenderShadows: 0
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
@ -287,6 +287,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d1616ef1655c92d4582abd6baa9bfc90, type: 3}
m_Name:
m_EditorClassIdentifier:
MapFrameRectTransform: {fileID: 3896793119978184412}
SizeScale: {x: 0, y: 0}
--- !u!1 &3896793119596260640
GameObject:
m_ObjectHideFlags: 0
@ -407,7 +409,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchoredPosition: {x: 50, y: 60}
m_SizeDelta: {x: 300, y: 300}
m_Pivot: {x: 0, y: 0}
--- !u!222 &3896793119978184411
@ -619,7 +621,12 @@ MonoBehaviour:
orthographicSizeRate: 0
DragSpeed: 0.5
ZoomSpeed: 1
MinOrthographicSize: 20
OrthographicSizeClamp: {x: 5, y: 15}
MiniMapTransport: 1
MiniMapRayLayer:
serializedVersion: 2
m_Bits: 2147483647
RayDistance: 1000
--- !u!1 &3896793120727956044
GameObject:
m_ObjectHideFlags: 0

View File

@ -1285,6 +1285,75 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1796139520}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1001 &1930899385
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545789, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_Name
value: MiniMapRoot
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ed7444d8edc56e741ae55811aa53b43b, type: 3}
--- !u!1 &2060622013
GameObject:
m_ObjectHideFlags: 0
@ -1542,77 +1611,3 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &3896793119409442310
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalPosition.x
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalPosition.z
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545786, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3896793120661545787, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: Player
value:
objectReference: {fileID: 2093585512}
- target: {fileID: 3896793120661545789, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_Name
value: MiniMapRoot
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ed7444d8edc56e741ae55811aa53b43b, type: 3}

View File

@ -10,11 +10,19 @@ public class MiniMap : MonoBehaviour, IPointerDownHandler, IPointerMoveHandler,
/// 管理脚本
/// </summary>
MiniMapManager m_MiniMapManager;
/// <summary>
/// 是否保持鼠标左键按住状态
/// </summary>
bool hold;
/// <summary>
/// 鼠标左键按下的坐标
/// </summary>
Vector2 PointDownPos;
public void OnPointerDown(PointerEventData eventData)
{
hold = eventData.button == PointerEventData.InputButton.Left;
PointDownPos = eventData.position;
}
public void OnPointerExit(PointerEventData eventData)
@ -26,6 +34,7 @@ public class MiniMap : MonoBehaviour, IPointerDownHandler, IPointerMoveHandler,
{
if (hold)
{
m_MiniMapManager.MiniCamera.transform.position += new Vector3(-eventData.delta.x, 0, -eventData.delta.y) * m_MiniMapManager.DragSpeed * 0.1f * m_MiniMapManager.orthographicSizeRate;
//以上值还要乘相机orthographicSize比例
@ -47,13 +56,27 @@ public class MiniMap : MonoBehaviour, IPointerDownHandler, IPointerMoveHandler,
public void OnPointerUp(PointerEventData eventData)
{
hold = false;
if (m_MiniMapManager.MiniMapTransport)
{
if (eventData.position == PointDownPos)
{
//Debug.Log($"Click Point: {eventData.position}");
//要使用射线检测,
var _transPoint = new Vector2((eventData.position.x - MapFrameRectTransform.anchoredPosition.x) * SizeScale.x, (eventData.position.y - MapFrameRectTransform.anchoredPosition.y) * SizeScale.y);
var _ray = m_MiniMapManager.MiniCamera.ScreenPointToRay(_transPoint);
Debug.DrawRay(_ray.origin, _ray.direction * 1000, Color.blue, 10);
if (Physics.Raycast(_ray, out RaycastHit _hit, m_MiniMapManager.RayDistance, m_MiniMapManager.MiniMapRayLayer))
{
m_MiniMapManager.TransportPlayer(_hit.point);
}
}
}
}
public void OnScroll(PointerEventData eventData)
{
m_MiniMapManager.MiniCamera.orthographicSize -= eventData.scrollDelta.y * m_MiniMapManager.ZoomSpeed;
//m_MiniMapManager.MiniCamera.orthographicSize = Mathf.Clamp(m_MiniMapManager.MiniCamera.orthographicSize, m_MiniMapManager.OrthographicSizeClamp.x, m_MiniMapManager.OrthographicSizeClamp.y);
m_MiniMapManager.MiniCamera.orthographicSize = Mathf.Clamp(m_MiniMapManager.MiniCamera.orthographicSize, m_MiniMapManager.MinOrthographicSize, m_MiniMapManager.FullScreenMiniMapOrthographicSize);
m_MiniMapManager.MiniCamera.orthographicSize = Mathf.Clamp(m_MiniMapManager.MiniCamera.orthographicSize, m_MiniMapManager.OrthographicSizeClamp.x, m_MiniMapManager.OrthographicSizeClamp.y);
var clamp_value = m_MiniMapManager.MiniCamera.orthographicSize - m_MiniMapManager.FullScreenMiniMapOrthographicSize;
@ -68,6 +91,15 @@ public class MiniMap : MonoBehaviour, IPointerDownHandler, IPointerMoveHandler,
}
}
/// <summary>
/// 地图边框
/// </summary>
public RectTransform MapFrameRectTransform;
/// <summary>
/// 正交相机射线转换比例
/// </summary>
public Vector2 SizeScale;
// Start is called before the first frame update
void Start()
{
@ -76,5 +108,6 @@ public class MiniMap : MonoBehaviour, IPointerDownHandler, IPointerMoveHandler,
{
this.enabled = false;
}
SizeScale = new Vector2(m_MiniMapManager.MiniCamera.targetTexture.width / MapFrameRectTransform.rect.width, m_MiniMapManager.MiniCamera.targetTexture.height / MapFrameRectTransform.rect.height);
}
}

View File

@ -1,5 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting.Dependencies.NCalc;
using UnityEditor.Experimental.GraphView;
using UnityEngine;
public class MiniMapManager : MonoBehaviour
@ -74,8 +76,20 @@ public class MiniMapManager : MonoBehaviour
/// 缩放尺寸限制
/// 最小值应大于0
/// </summary>
//public Vector2 OrthographicSizeClamp = new Vector2(5, 15);
public float MinOrthographicSize = 20;
public Vector2 OrthographicSizeClamp = new Vector2(5, 15);
/// <summary>
/// 是否启用小地图传送
/// </summary>
public bool MiniMapTransport;
/// <summary>
/// 小地图射线检测层
/// </summary>
public LayerMask MiniMapRayLayer;
/// <summary>
/// 射线距离
/// </summary>
public float RayDistance = 1000;
// Start is called before the first frame update
void Start()
{
@ -132,4 +146,22 @@ public class MiniMapManager : MonoBehaviour
PlayerInMap.anchoredPosition = new Vector2(MiniMap.rect.height * heightRate, MiniMap.rect.width * widthRate) / orthographicSizeRate;
}
}
/// <summary>
/// 传送
/// </summary>
/// <param name="_point"></param>
public void TransportPlayer(Vector3 _point)
{
CameraMove.Instance.ShieldingOperation = true;
if (Player.position.y - _point.y > 0)
{
Player.position = new Vector3(_point.x, Player.position.y, _point.z);
}
else
{
Player.position = new Vector3(_point.x, _point.y + 1, _point.z);
}
CameraMove.Instance.ReInitTransform();
}
}

View File

@ -78423,7 +78423,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 523225d195de0e047bec42efdf4e94b8, type: 3}
m_Sprite: {fileID: 21300000, guid: 8bd5b470d052489459a8a41bbe6cd108, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1

View File

@ -3773,7 +3773,7 @@ RectTransform:
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -48, y: 29}
m_SizeDelta: {x: 223, y: 223}
m_SizeDelta: {x: 133.8, y: 133.8}
m_Pivot: {x: 1, y: 0}
--- !u!114 &1674400509
MonoBehaviour:
@ -3912,7 +3912,7 @@ Camera:
width: 1
height: 1
near clip plane: 0.3
far clip plane: 9000
far clip plane: 9200
field of view: 60
orthographic: 0
orthographic size: 5
@ -3938,14 +3938,14 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1701869329}
m_LocalRotation: {x: -0.032324355, y: -0.958363, z: 0.25679263, w: -0.12063611}
m_LocalPosition: {x: -40.39758, y: 237.4118, z: 688.6841}
m_LocalRotation: {x: -0.066452235, y: -0.9098438, z: 0.37686956, w: -0.16042991}
m_LocalPosition: {x: -195, y: 500, z: 670}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 30, y: -194.349, z: 0}
m_LocalEulerAnglesHint: {x: 45, y: -200, z: 0}
--- !u!114 &1701869334
MonoBehaviour:
m_ObjectHideFlags: 0
@ -3969,7 +3969,7 @@ MonoBehaviour:
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 0
m_RenderPostProcessing: 1
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
@ -5725,6 +5725,11 @@ PrefabInstance:
propertyPath: orthographic size
value: 300
objectReference: {fileID: 0}
- target: {fileID: 3896793119431439233, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_CullingMask.m_Bits
value: 23
objectReference: {fileID: 0}
- target: {fileID: 3896793119431439234, guid: ed7444d8edc56e741ae55811aa53b43b,
type: 3}
propertyPath: m_LocalPosition.x

View File

@ -156,7 +156,6 @@ public class CameraRoamManager : Singleton<CameraRoamManager>
}
else
{
CameraMove.Instance.ShieldingOperation = false;
if (m_RoamingTween != null)
{
if (_roam_continue)
@ -164,6 +163,7 @@ public class CameraRoamManager : Singleton<CameraRoamManager>
m_RoamingTween.Pause();
}
}
CameraMove.Instance.ReInitTransform();
}
}
}

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using UnityEngine.UIElements;
using UnityEditor.Search;
public class CameraController : MonoBehaviour
{
@ -58,7 +59,9 @@ public class CameraController : MonoBehaviour
horizontal = eulerx = myLocalAng.eulerAngles.y;
vertical = eulery = myLocalAng.eulerAngles.x;
if (vertical > 180)
vertical -= 360;
{
eulery = vertical -= 360;
}
myPos = transform.position;
}

View File

@ -135,6 +135,19 @@ public class CameraMove : CameraController
#region
/// <summary>
/// 重设置相机坐标
/// </summary>
public void ReInitTransform()
{
Target = null;
ShieldingOperation = true;
InitTransform();
init_position = transform.position;
init_rotation = transform.eulerAngles;
ShieldingOperation = false;
}
public void KillAllTween()
{
DOTween.Kill(transform);

View File

@ -0,0 +1,14 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraDevice : DeviceBase
{
/// <summary>
/// 根据是否有数据设置可见状态
/// </summary>
public void SetActiveState()
{
DeviceUI.gameObject.SetActive(T_BAS_CAMERA != null);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6096461c8dcb2884a8a5e639ea76e811
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -20,7 +20,7 @@ public class DeviceBase : MonoBehaviour
/// <summary>
/// 摄像头列表
/// </summary>
public static List<DeviceBase> CameraList = new List<DeviceBase>();
public static List<CameraDevice> CameraList = new List<CameraDevice>();
/// <summary>
/// 堆区列表
/// </summary>
@ -64,7 +64,7 @@ public class DeviceBase : MonoBehaviour
switch (DeviceType)
{
case DeviceType.CAMERA:
CameraList.Add(this);
CameraList.Add(this as CameraDevice);
DeviceIndex = transform.name.Split('_')[1];
//transform.parent.GetComponent<Renderer>().enabled = false;
break;

View File

@ -1,126 +1,227 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
/// <summary>
/// 堆场
/// </summary>
public class YardDevice : DeviceBase
{
/// <summary>
/// 重量单位
/// </summary>
public WeightUnit WeightUnit;
/// <summary>
/// 堆区下的所有渲染器
/// </summary>
public List<MeshRenderer> MeshRenderers = new List<MeshRenderer>();
/// <summary>
/// 自动分配各堆最大堆放量
/// 即各堆最大堆放量相同
/// </summary>
public bool AutoAllocationWeight = true;
/// <summary>
/// 该堆场的所有堆
/// </summary>
public List<PileDevice> Piles = new List<PileDevice>();
/// <summary>
/// 堆场的最大堆放量
/// </summary>
public float YardMaxWeight;
/// <summary>
/// 堆展示的最小百分比
/// </summary>
[Range(0, 1)]
public float MinimumPercentage = 0.1f;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.EventSystems;
using XCharts.Runtime;
/// <summary>
/// 堆场
/// </summary>
public class YardDevice : DeviceBase
{
/// <summary>
/// 重量单位
/// </summary>
public WeightUnit WeightUnit;
/// <summary>
/// 堆区下的所有渲染器
/// </summary>
public List<MeshRenderer> MeshRenderers = new List<MeshRenderer>();
/// <summary>
/// 自动分配各堆最大堆放量
/// 即各堆最大堆放量相同
/// </summary>
public bool AutoAllocationWeight = true;
/// <summary>
/// 该堆场的所有堆
/// </summary>
public List<PileDevice> Piles = new List<PileDevice>();
/// <summary>
/// 堆场的最大堆放量
/// </summary>
public float YardMaxWeight;
/// <summary>
/// 堆展示的最小百分比
/// </summary>
[Range(0, 1)]
public float MinimumPercentage = 0.1f;
/// <summary>
/// 粒子效果
/// </summary>
public ParticleSystem ParticleSystem;
/// <summary>
/// 闪烁脚本
/// </summary>
private Shark shark;
public override void Awake()
{
base.Awake();
MeshRenderers = transform.parent.GetComponentsInChildren<MeshRenderer>().ToList();
Piles = transform.parent.GetComponentsInChildren<PileDevice>().ToList();
shark = GetComponent<Shark>();
ParticleSystem = transform.parent.GetComponentInChildren<ParticleSystem>();
if (AutoAllocationWeight)
{
for (int i = 0; i < Piles.Count; i++)
{
Piles[i].Init(YardMaxWeight / Piles.Count, MinimumPercentage);
}
}
}
public void SetOutLine(bool _enable)
{
if (_enable)
{
for (int i = 0; i < MeshRenderers.Count; i++)
{
MeshRenderers[i].material.EnableKeyword("_ENABLE");
}
ParticleSystem?.Play();
//shark.StartShak();
}
else
{
for (int i = 0; i < MeshRenderers.Count; i++)
{
MeshRenderers[i].material.DisableKeyword("_ENABLE");
}
ParticleSystem?.Stop();
//shark.StopShak();
}
}
/// <summary>
/// 更新堆区堆放量
/// </summary>
public void UpdateYardWeight(float _weight)
{
ResetPiles();
if (_weight > YardMaxWeight)
{
Piles.ForEach(x => x.UpdateWeight(YardMaxWeight / Piles.Count));
return;
}
if (AutoAllocationWeight)
{
var _use_pile_count = Mathf.FloorToInt(_weight / (YardMaxWeight / Piles.Count));
if (_use_pile_count == 0)
{
Piles[0].UpdateWeight(_weight);
}
else
{
for (int i = 0; i < _use_pile_count; i++)
{
Piles[i].UpdateWeight(YardMaxWeight / Piles.Count);
}
//剩余没堆满的部分
Piles[_use_pile_count].UpdateWeight(_weight % (YardMaxWeight / Piles.Count));
}
}
}
/// <summary>
/// 重置所有Pile
/// </summary>
public void ResetPiles()
{
for (int i = 0; i < Piles.Count; i++)
{
Piles[i].gameObject.SetActive(false);
}
}
}
/// </summary>
public ParticleSystem ParticleSystem;
/// <summary>
/// 选中
/// </summary>
private bool Selected;
/// <summary>
/// 选中的堆场
/// </summary>
public static YardDevice SelectedYardDevice;
/// <summary>
/// 闪烁脚本
/// </summary>
private Shark shark;
/// <summary>
/// 鼠标悬浮颜色
/// </summary>
Color HoverColor = new Color(0, 0, 1, 0.5f);
/// <summary>
/// 鼠标点击选中颜色
/// </summary>
Color SelectColor = new Color(0, 1, 0, 0.5f);
public override void Awake()
{
base.Awake();
MeshRenderers = transform.parent.GetComponentsInChildren<MeshRenderer>().ToList();
Piles = transform.parent.GetComponentsInChildren<PileDevice>().ToList();
shark = GetComponent<Shark>();
ParticleSystem = transform.parent.GetComponentInChildren<ParticleSystem>();
if (AutoAllocationWeight)
{
for (int i = 0; i < Piles.Count; i++)
{
Piles[i].Init(YardMaxWeight / Piles.Count, MinimumPercentage);
}
}
}
public void SetOutLine(bool _enable)
{
if (_enable)
{
for (int i = 0; i < MeshRenderers.Count; i++)
{
MeshRenderers[i].material.EnableKeyword("_ENABLE");
}
//SetOnHoverd(true);
//shark.StartShak();
}
else
{
for (int i = 0; i < MeshRenderers.Count; i++)
{
MeshRenderers[i].material.DisableKeyword("_ENABLE");
}
//SetOnHoverd(false);
//shark.StopShak();
}
}
/// <summary>
/// 更新堆区堆放量
/// </summary>
public void UpdateYardWeight(float _weight)
{
ResetPiles();
if (_weight > YardMaxWeight)
{
Piles.ForEach(x => x.UpdateWeight(YardMaxWeight / Piles.Count));
return;
}
if (AutoAllocationWeight)
{
var _use_pile_count = Mathf.FloorToInt(_weight / (YardMaxWeight / Piles.Count));
if (_use_pile_count == 0)
{
Piles[0].UpdateWeight(_weight);
}
else
{
for (int i = 0; i < _use_pile_count; i++)
{
Piles[i].UpdateWeight(YardMaxWeight / Piles.Count);
}
//剩余没堆满的部分
Piles[_use_pile_count].UpdateWeight(_weight % (YardMaxWeight / Piles.Count));
}
}
}
/// <summary>
/// 重置所有Pile
/// </summary>
public void ResetPiles()
{
for (int i = 0; i < Piles.Count; i++)
{
Piles[i].gameObject.SetActive(false);
}
}
private void OnMouseEnter()
{
if (!EventSystem.current.IsPointerOverGameObject())
{
//ParticleSystem.MainModule _main = ParticleSystem.main;
//_main.startColor = HoverColor;
//ParticleSystem.Play();
SetOnHoverd(true);
}
}
private void OnMouseExit()
{
if (!Selected)
{
//ParticleSystem.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
SetOnHoverd(false);
}
}
private void OnMouseDown()
{
if (!EventSystem.current.IsPointerOverGameObject())
{
if (SelectedYardDevice != null && SelectedYardDevice != this)
{
SelectedYardDevice.SetOnSelected(false);
}
SelectedYardDevice = this;
SelectedYardDevice.SetOnSelected(true);
UIManager.Instance.ShowYardInformationPage(T_BAS_YARD, (_force) =>
{
if (_force)
{
SelectedYardDevice = null;
SetOnSelected(false);
}
else
{
if (SelectedYardDevice != this)
{
SetOnSelected(false);
}
}
});
}
}
public void SetOnHoverd(bool _hovered)
{
if (_hovered)
{
ParticleSystem.MainModule _main = ParticleSystem.main;
_main.startColor = HoverColor;
ParticleSystem.Play();
}
else
{
ParticleSystem.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
}
}
public void SetOnSelected(bool _selected)
{
Selected = _selected;
if (_selected)
{
ParticleSystem.MainModule _main = ParticleSystem.main;
_main.startColor = SelectColor;
ParticleSystem.Play();
}
else
{
ParticleSystem.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
}
}
}

View File

@ -13,11 +13,11 @@ public class ApiManager : Singleton<ApiManager>
/// <summary>
/// ½Ó¿ÚipµØÖ·
/// </summary>
public string IpAddress
public string IpAddress
{
get
{
if(!Application.isEditor)
if (!Application.isEditor)
{
//·¢²¼³öÀ´
return "http://" + CallForTest.instance.ServerIP + ":4000";
@ -68,7 +68,7 @@ public class ApiManager : Singleton<ApiManager>
{
base.Awake();
//var _ip_str_url = Path.Combine(Application.streamingAssetsPath, "configure.json");
//StartCoroutine(RequestBase.Get(_ip_str_url, (_data, _error) =>
//{
@ -390,7 +390,7 @@ public class ApiManager : Singleton<ApiManager>
{
yield return null;
var _post_check_yard = IpAddress + ApiDic["PostCheckYard"];
var _post_data = $"{{ \"SHIP_NAME_EN\": \"{_SHIP_NAME_EN}\",\"VOYAGE_NO\": \"{_VOYAGE_NO}\",\"STANDARD_NAME\": \"{_SHIP_NAME_EN}\",\"SILO_CODE\":\"{_SILO_CODE}\"}}";
var _post_data = $"{{ \"MONITOR_ID\": \"{CallForTest.instance.MONITOR_ID}\",\"SHIP_NAME_EN\": \"{_SHIP_NAME_EN}\",\"VOYAGE_NO\": \"{_VOYAGE_NO}\",\"STANDARD_NAME\": \"{_SHIP_NAME_EN}\",\"SILO_CODE\":\"{_SILO_CODE}\"}}";
StartCoroutine(RequestBase.Post(_post_check_yard, _post_data, (_data, _error) =>
{
if (_error != null)

View File

@ -68,13 +68,14 @@ public class MainScene : Singleton<MainScene>
_belt_scale_icon.GetComponent<DeviceUIBase>().InitModel(DeviceBase.DeviceBaseList[i]);
break;
case DeviceType.YARD:
if (ModelRoot.Instance.YardIconPrefab == null)
{
ModelRoot.Instance.YardIconPrefab = Resources.Load("Prefabs/UI/DeviceIcons/YardIcon") as GameObject;
}
var _yard_icon = Instantiate(ModelRoot.Instance.YardIconPrefab, ModelRoot.Instance.Canvas_3D);
_yard_icon.transform.position = DeviceBase.DeviceBaseList[i].transform.position;
_yard_icon.GetComponent<DeviceUIBase>().InitModel(DeviceBase.DeviceBaseList[i]);
//堆区不展示UI直接和模型交互
//if (ModelRoot.Instance.YardIconPrefab == null)
//{
// ModelRoot.Instance.YardIconPrefab = Resources.Load("Prefabs/UI/DeviceIcons/YardIcon") as GameObject;
//}
//var _yard_icon = Instantiate(ModelRoot.Instance.YardIconPrefab, ModelRoot.Instance.Canvas_3D);
//_yard_icon.transform.position = DeviceBase.DeviceBaseList[i].transform.position;
//_yard_icon.GetComponent<DeviceUIBase>().InitModel(DeviceBase.DeviceBaseList[i]);
break;
default:
break;
@ -104,6 +105,11 @@ public class MainScene : Singleton<MainScene>
DeviceBase.CameraList[i].T_BAS_CAMERA = _camera;
DeviceBase.CameraList[i].DeviceUI.InitData();
}
else
{
DeviceBase.CameraList[i].T_BAS_CAMERA = null;
DeviceBase.CameraList[i].SetActiveState();
}
}
m_camera_done = true;
}
@ -122,7 +128,7 @@ public class MainScene : Singleton<MainScene>
if (_yard != null)
{
DeviceBase.YardList[i].T_BAS_YARD = _yard;
DeviceBase.YardList[i].DeviceUI.InitData();
DeviceBase.YardList[i].DeviceUI?.InitData();
}
}
m_yard_done = true;

View File

@ -3,6 +3,7 @@ using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class UIManager : Singleton<UIManager>
{
@ -200,10 +201,10 @@ public class UIManager : Singleton<UIManager>
/// 打开堆场信息窗口
/// </summary>
/// <param name="_yard_id"></param>
public void ShowYardInformationPage(T_BAS_YARD _T_BAS_YARD)
public void ShowYardInformationPage(T_BAS_YARD _T_BAS_YARD, Action<bool> _callback_onclose = null)
{
//UIRoot.Instance.YardInformation.ShowPanel();
UIRoot.Instance.YardInformation.UpdatePageData(_T_BAS_YARD);
UIRoot.Instance.YardInformation.UpdatePageData(_T_BAS_YARD, _callback_onclose);
}
#endregion

View File

@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class PhysicManager : MonoBehaviour
{
@ -26,9 +27,12 @@ public class PhysicManager : MonoBehaviour
{
if (Input.GetMouseButtonDown(0))
{
if (PhysicRay(ModelRoot.Instance.MainCamera.ScreenPointToRay(Input.mousePosition), out RaycastHit hit))
if (!EventSystem.current.IsPointerOverGameObject())
{
Debug.Log(hit.collider.name);
if (PhysicRay(ModelRoot.Instance.MainCamera.ScreenPointToRay(Input.mousePosition), out RaycastHit hit))
{
Debug.Log(hit.collider.name);
}
}
}
}

View File

@ -257,7 +257,7 @@ public class MeasuringScale : PanelBase
TimeSearchButton.onClick.AddListener(ApplyHistoryData);
CloseButton.onClick.AddListener(HidePanel);
CloseButton.onClick.AddListener(ForceHidePanel);
MeasuringScaleItemPrefab = Resources.Load<MeasuringScaleItem>("Prefabs/UI/MeasuringScaleInfo/MeasuringScaleItem");
//ĬÈÏʱ¼ä
@ -276,14 +276,20 @@ public class MeasuringScale : PanelBase
ApplyHistoryData();
}
public override void ShowPanel(bool _hide_last_panel = true)
public override void ShowPanel(bool _hide_last_panel = true, Action<bool> _on_panel_close = null, bool _force = false)
{
base.ShowPanel(_hide_last_panel);
base.ShowPanel(_hide_last_panel, _on_panel_close);
gameObject.SetActive(true);
}
public override void HidePanel()
void ForceHidePanel()
{
base.HidePanel();
HidePanel(true);
}
public override void HidePanel(bool _force)
{
base.HidePanel(_force);
gameObject.SetActive(false);
PickTime(false);
}

View File

@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@ -9,6 +10,10 @@ public class PanelBase : UITool
/// 当前面板
/// </summary>
public static PanelBase current_panel;
/// <summary>
/// 面板关闭事件
/// </summary>
public Action<bool> on_panel_close;
// Start is called before the first frame update
protected virtual void Start()
{
@ -25,20 +30,28 @@ public class PanelBase : UITool
/// 展示面板
/// </summary>
/// <param name="_hide_last_panel">隐藏上一个面板</param>
public virtual void ShowPanel(bool _hide_last_panel = true)
/// <param name="_on_panel_close">关闭面板执行事件</param>
/// <param name="_force"></param>
public virtual void ShowPanel(bool _hide_last_panel = true, Action<bool> _on_panel_close = null, bool _force = false)
{
if (_hide_last_panel && current_panel != null && current_panel != this)
//if (_hide_last_panel && current_panel != null && current_panel != this)
//{
// current_panel.HidePanel();
//}
if (_hide_last_panel && current_panel != null)
{
current_panel.HidePanel();
//若面板类型不同则执行被关闭面板的回调参数为True应用场景点击堆区后点击其摄像机或皮带秤时除关闭堆区面板外还需取消堆区高亮
current_panel.HidePanel(current_panel != this);
}
current_panel = this;
on_panel_close = _on_panel_close;
}
/// <summary>
/// 隐藏面板
/// </summary>
public virtual void HidePanel()
public virtual void HidePanel(bool _force = false)
{
on_panel_close?.Invoke(_force);
}
}

View File

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using TMPro;
using ZenFulcrum.EmbeddedBrowser;
using Competition.Mysql.Model;
@ -35,18 +36,23 @@ public class VideoWebPage : PanelBase
protected override void Start()
{
CloseButton.onClick.AddListener(HidePanel);
CloseButton.onClick.AddListener(ForceHidePanel);
}
public override void ShowPanel(bool _hide_last_panel = true)
void ForceHidePanel()
{
base.ShowPanel(_hide_last_panel);
HidePanel(true);
}
public override void ShowPanel(bool _hide_last_panel = true, Action<bool> _on_panel_close = null, bool _force = false)
{
base.ShowPanel(_hide_last_panel, _on_panel_close, true);
gameObject.SetActive(true);
}
public override void HidePanel()
public override void HidePanel(bool _force)
{
base.HidePanel();
base.HidePanel(_force);
gameObject.SetActive(false);
}

View File

@ -35,23 +35,35 @@ public class YardInformation : PanelBase
/// 堆场数据项
/// </summary>
public List<YardItem> YardItems = new List<YardItem>();
/// <summary>
/// 关闭面板
/// </summary>
public Button CloseButton;
/// <summary>
/// 当前选择的堆场
/// </summary>
public T_BAS_YARD CurrentYard;
// Start is called before the first frame update
protected override void Start()
{
CloseButton.onClick.AddListener(HidePanel);
CloseButton.onClick.AddListener(ForceHidePanel);
YardItemsPrefab = Resources.Load<YardItem>("Prefabs/UI/YardInfo/YardItem");
}
public override void ShowPanel(bool _hide_last_panel = true)
public override void ShowPanel(bool _hide_last_panel = true, Action<bool> _on_panel_close = null, bool _force = false)
{
base.ShowPanel(_hide_last_panel);
base.ShowPanel(_hide_last_panel, _on_panel_close);
gameObject.SetActive(true);
}
public override void HidePanel()
void ForceHidePanel()
{
base.HidePanel();
HidePanel(true);
}
public override void HidePanel(bool _force)
{
base.HidePanel(_force);
gameObject.SetActive(false);
}
@ -59,9 +71,9 @@ public class YardInformation : PanelBase
/// 更新页面上展示的数据
/// </summary>
/// <param name="_T_BAS_YARD">堆场信息</param>
public void UpdatePageData(T_BAS_YARD _T_BAS_YARD)
public void UpdatePageData(T_BAS_YARD _T_BAS_YARD, Action<bool> _callback_onclose = null)
{
ShowPanel();//先打开面板以启动接口协程
ShowPanel(_on_panel_close: _callback_onclose);//先打开面板以启动接口协程
transform.localScale = Vector3.zero;
YardName.text = _T_BAS_YARD.YARD_NAME;
@ -77,9 +89,15 @@ public class YardInformation : PanelBase
for (int i = 0; i < _storage_list.Count; i++)
{
//过滤库存剩余量为0的数据
if (float.Parse(_storage_list[i].STOCK_BALANCE.ToString()) == 0)
{
continue;
}
var _yard = Instantiate(YardItemsPrefab);
_yard.transform.parent = YardItemContent;
_yard.Init(_storage_list[i]);
YardItems.Add(_yard);
}
DOTween.To(() => transform.localScale, _scale => transform.localScale = _scale, Vector3.one, 0.5f);
}));

View File

@ -25,6 +25,7 @@ public class DeviceUIBase : MonoBehaviour, IPointerClickHandler
break;
case DeviceType.YARD:
//打开堆区窗口
//转移至点击堆区模型直接展示
UIManager.Instance.ShowYardInformationPage(DeviceBase.T_BAS_YARD);
break;
default: