代码提交
This commit is contained in:
parent
165c4d3422
commit
092ed0f4c5
File diff suppressed because one or more lines are too long
|
@ -54,7 +54,7 @@ Material:
|
|||
- _QueueControl: 0
|
||||
- _QueueOffset: 0
|
||||
- _depth: 7.2
|
||||
- _scale: 1
|
||||
- _scale: -1
|
||||
- _speed: 0.1
|
||||
- _strength: 0.1
|
||||
m_Colors:
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.5 MiB |
|
@ -1,123 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 50c565e11fbe93e4286801af0115a04b
|
||||
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
|
||||
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:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ebf7694870287534686cd09e1500aa28
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,107 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &8452045265935338666
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8452045265935338667}
|
||||
- component: {fileID: 8452045265935338645}
|
||||
- component: {fileID: 8452045265935338644}
|
||||
- component: {fileID: 6792933745276284637}
|
||||
- component: {fileID: 6053792245040113255}
|
||||
m_Layer: 5
|
||||
m_Name: BeltScaleIcon
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8452045265935338667
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8452045265935338666}
|
||||
m_LocalRotation: {x: -0.5, y: -0.5, z: -0.49999997, w: 0.5}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 252, y: 100}
|
||||
m_Pivot: {x: 0.155, y: 0}
|
||||
--- !u!222 &8452045265935338645
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8452045265935338666}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8452045265935338644
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8452045265935338666}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 23168afab8891c14982ef0a4e5537555, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &6792933745276284637
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8452045265935338666}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 52b8fb0629028ff428dd6d219a696e2a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_distance: 0
|
||||
_multi: 0.1
|
||||
--- !u!114 &6053792245040113255
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8452045265935338666}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a3449b44ff76a714386383fa244e9516, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
DeviceBase: {fileID: 0}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e7ad0f889a5caf34694e81358be43763
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,107 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &5655601701136068776
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5655601701136068777}
|
||||
- component: {fileID: 5655601701136068759}
|
||||
- component: {fileID: 5655601701136068758}
|
||||
- component: {fileID: 7309994115744305887}
|
||||
- component: {fileID: 2663913974204241051}
|
||||
m_Layer: 5
|
||||
m_Name: CameraIcon
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5655601701136068777
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5655601701136068776}
|
||||
m_LocalRotation: {x: -0.5, y: -0.5, z: -0.49999997, w: 0.5}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 63}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -50, y: -160438560}
|
||||
m_SizeDelta: {x: 75, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0}
|
||||
--- !u!222 &5655601701136068759
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5655601701136068776}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &5655601701136068758
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5655601701136068776}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 7792277c1d6359a42b5a2705141eaf6a, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &7309994115744305887
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5655601701136068776}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 52b8fb0629028ff428dd6d219a696e2a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_distance: 0
|
||||
_multi: 0.1
|
||||
--- !u!114 &2663913974204241051
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5655601701136068776}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a3449b44ff76a714386383fa244e9516, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
DeviceBase: {fileID: 0}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cb3fd01616e2fe44c821bf55e111259d
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -3237,10 +3237,12 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 023e80ce33ca6b74d9254cc9439c8162, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
current_panel: {fileID: 0}
|
||||
MeasureScaleButton: {fileID: 0}
|
||||
CollectDataButton: {fileID: 0}
|
||||
MSPage: {fileID: 0}
|
||||
CDPage: {fileID: 0}
|
||||
CloseButton: {fileID: 0}
|
||||
MeasuringScaleName: {fileID: 0}
|
||||
MeasuringScaleNO: {fileID: 0}
|
||||
ModelNO: {fileID: 0}
|
||||
|
@ -12972,6 +12974,7 @@ GameObject:
|
|||
- component: {fileID: 4429255974527647796}
|
||||
- component: {fileID: 4429255974527647798}
|
||||
- component: {fileID: 4429255974527647797}
|
||||
- component: {fileID: 3343553896636442357}
|
||||
m_Layer: 0
|
||||
m_Name: CloseButton
|
||||
m_TagString: Untagged
|
||||
|
@ -13037,6 +13040,50 @@ MonoBehaviour:
|
|||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &3343553896636442357
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4429255974527647755}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 4429255974527647797}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &4429255974536337049
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -134,7 +134,7 @@ GameObject:
|
|||
- component: {fileID: 8656760002306844203}
|
||||
- component: {fileID: 8656760002306844202}
|
||||
m_Layer: 0
|
||||
m_Name: VideoWeb
|
||||
m_Name: VideoWebPage
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
@ -213,6 +213,7 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: b02ea4de31030054fa95651a1e50677f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
current_panel: {fileID: 0}
|
||||
VideoName: {fileID: 0}
|
||||
CloseButton: {fileID: 0}
|
||||
WebPage: {fileID: 0}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,31 +0,0 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
public static class ClassBase
|
||||
{
|
||||
|
||||
public static IEnumerator Get(string _url, Action<string> _callback)
|
||||
{
|
||||
using (UnityWebRequest webRequest = UnityWebRequest.Get(_url))
|
||||
{
|
||||
yield return webRequest.SendWebRequest();
|
||||
switch (webRequest.result)
|
||||
{
|
||||
case UnityWebRequest.Result.InProgress:
|
||||
break;
|
||||
case UnityWebRequest.Result.Success:
|
||||
_callback?.Invoke(webRequest.downloadHandler.text);
|
||||
break;
|
||||
case UnityWebRequest.Result.ConnectionError:
|
||||
break;
|
||||
case UnityWebRequest.Result.ProtocolError:
|
||||
break;
|
||||
case UnityWebRequest.Result.DataProcessingError:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
/// <summary>
|
||||
/// 设备类型
|
||||
/// </summary>
|
||||
public enum DeviceType
|
||||
{
|
||||
/// <summary>
|
||||
/// 摄像机
|
||||
/// </summary>
|
||||
CAMERA = 0,
|
||||
/// <summary>
|
||||
/// 皮带秤
|
||||
/// </summary>
|
||||
BELT_SCALE = 1,
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 250f6dbc13a298846b7c16d6e9efbc6c
|
||||
guid: b983b4e840bc3f447b6889144f17d039
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
public class DataBase<T>
|
||||
{
|
||||
public string code { get; set; }
|
||||
public string state { get; set; }
|
||||
public T data { get; set; }
|
||||
}
|
||||
|
||||
public static class RequestBase
|
||||
{
|
||||
|
||||
public static IEnumerator Get(string _url, Action<string, string> _callback)
|
||||
{
|
||||
using (UnityWebRequest webRequest = new UnityWebRequest())
|
||||
{
|
||||
webRequest.url = _url;
|
||||
webRequest.method = "GET";
|
||||
|
||||
webRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
yield return webRequest.SendWebRequest();
|
||||
switch (webRequest.result)
|
||||
{
|
||||
case UnityWebRequest.Result.InProgress:
|
||||
break;
|
||||
case UnityWebRequest.Result.Success:
|
||||
_callback?.Invoke(webRequest.downloadHandler.text, null);
|
||||
break;
|
||||
case UnityWebRequest.Result.ConnectionError:
|
||||
_callback?.Invoke(null, webRequest.error);
|
||||
break;
|
||||
case UnityWebRequest.Result.ProtocolError:
|
||||
_callback?.Invoke(null, webRequest.error);
|
||||
break;
|
||||
case UnityWebRequest.Result.DataProcessingError:
|
||||
_callback?.Invoke(null, webRequest.error);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerator Get(string _url, Dictionary<string, string> _quary_datas, Action<string, string> _callback)
|
||||
{
|
||||
using (UnityWebRequest webRequest = new UnityWebRequest())
|
||||
{
|
||||
if (_quary_datas != null)
|
||||
{
|
||||
_url = _url + "?";
|
||||
foreach (var item in _quary_datas)
|
||||
{
|
||||
_url = string.Format("{0}{1}={2}&", _url, item.Key, item.Value);
|
||||
}
|
||||
}
|
||||
_url = _url.TrimEnd('&');
|
||||
|
||||
UnityEngine.Debug.Log(_url);
|
||||
|
||||
webRequest.url = _url;
|
||||
webRequest.method = "GET";
|
||||
|
||||
webRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
yield return webRequest.SendWebRequest();
|
||||
switch (webRequest.result)
|
||||
{
|
||||
case UnityWebRequest.Result.InProgress:
|
||||
break;
|
||||
case UnityWebRequest.Result.Success:
|
||||
_callback?.Invoke(webRequest.downloadHandler.text, null);
|
||||
break;
|
||||
case UnityWebRequest.Result.ConnectionError:
|
||||
_callback?.Invoke(null, webRequest.error);
|
||||
break;
|
||||
case UnityWebRequest.Result.ProtocolError:
|
||||
_callback?.Invoke(null, webRequest.error);
|
||||
break;
|
||||
case UnityWebRequest.Result.DataProcessingError:
|
||||
_callback?.Invoke(null, webRequest.error);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9132dea7a1d23b54f9f8093e7521820d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
fileFormatVersion: 2
|
||||
guid: 9132dea7a1d23b54f9f8093e7521820d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,25 +1,33 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 企业管理
|
||||
/// </summary>
|
||||
public class CorporationManger : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// 企业id
|
||||
/// </summary>
|
||||
public string MONITOR_ID;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
//检查企业id
|
||||
if(MONITOR_ID!=CallForTest.instance.MONITOR_ID)
|
||||
{
|
||||
//弹出提示,exe打开错误
|
||||
Debug.LogError("企业程序选择错误,请检查");
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 企业管理
|
||||
/// </summary>
|
||||
public class CorporationManger : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// 企业id
|
||||
/// </summary>
|
||||
public string MONITOR_ID;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (CallForTest.instance != null)
|
||||
{
|
||||
//检查企业id
|
||||
if (MONITOR_ID != CallForTest.instance.MONITOR_ID)
|
||||
{
|
||||
//弹出提示,exe打开错误
|
||||
Debug.LogError("企业程序选择错误,请检查");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
MainScene.Instance.OnSceneLoaded?.Invoke();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CRTest : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// ÂþÓÎËÙ¶È µ¥Î» m/s
|
||||
/// </summary>
|
||||
public float speed = 2;
|
||||
// Start is called before the first frame update
|
||||
void Awake()
|
||||
{
|
||||
var rand = Random.Range(3, 8);
|
||||
RoamingAnchor last = null;
|
||||
for (int i = 0; i < rand; i++)
|
||||
{
|
||||
var ro = new GameObject($"RomAncP{i}", typeof(RoamingAnchor)).GetComponent<RoamingAnchor>();
|
||||
ro.Index = i + 1;
|
||||
|
||||
ro.transform.parent = transform;
|
||||
ro.transform.position = Random.insideUnitCircle * 20;
|
||||
|
||||
if (last != null)
|
||||
{
|
||||
ro.Duration = Vector3.Distance(last.transform.position, ro.transform.position) / speed;
|
||||
}
|
||||
|
||||
last = ro;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -1,134 +1,143 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using W.Bezier;
|
||||
|
||||
public class CameraRoamManager : Singleton<CameraRoamManager>
|
||||
{
|
||||
/// <summary>
|
||||
/// 目标相机
|
||||
/// </summary>
|
||||
public Transform TargetCamera;
|
||||
/// <summary>
|
||||
/// 贝塞尔曲线绘画工具
|
||||
/// </summary>
|
||||
public BezierDrawer BezierDrawer;
|
||||
/// <summary>
|
||||
/// 贝塞尔曲线
|
||||
/// </summary>
|
||||
public BezierCurve BezierCurve;
|
||||
/// <summary>
|
||||
/// 所有的漫游锚点
|
||||
/// </summary>
|
||||
public List<RoamingAnchor> m_RoamingAnchors = new List<RoamingAnchor>();
|
||||
/// <summary>
|
||||
/// 贝塞尔曲线基准坐标集合
|
||||
/// </summary>
|
||||
public Vector3[] m_RoamingPoints;
|
||||
|
||||
/// <summary>
|
||||
/// 漫游协程
|
||||
/// </summary>
|
||||
public Coroutine m_RoamingCoroutine;
|
||||
|
||||
/// <summary>
|
||||
/// 漫游Tween
|
||||
/// </summary>
|
||||
private Tween m_RoamingTween;
|
||||
|
||||
/// <summary>
|
||||
/// 是否正在漫游
|
||||
/// </summary>
|
||||
public bool isRoaming;
|
||||
/// <summary>
|
||||
/// 漫游实时坐标
|
||||
/// </summary>
|
||||
public Vector3 m_Position;
|
||||
/// <summary>
|
||||
/// 漫游实时视角
|
||||
/// </summary>
|
||||
public Quaternion m_Rotation;
|
||||
/// <summary>
|
||||
/// 漫游速度
|
||||
/// </summary>
|
||||
public float RoamingSpeed = 2;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
InitRoamAnchor();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (isRoaming)
|
||||
{
|
||||
m_Position = transform.position;
|
||||
m_Rotation = transform.rotation;
|
||||
}
|
||||
}
|
||||
|
||||
void InitRoamAnchor()
|
||||
{
|
||||
if (TargetCamera == null)
|
||||
{
|
||||
TargetCamera = Camera.main.transform;
|
||||
}
|
||||
BezierDrawer = GetComponent<BezierDrawer>();
|
||||
|
||||
m_RoamingAnchors = ModelRoot.Instance.RoamAnchorRoot.GetComponentsInChildren<RoamingAnchor>().ToList();
|
||||
|
||||
m_RoamingPoints = new Vector3[m_RoamingAnchors.Count];
|
||||
|
||||
for (int i = 0; i < m_RoamingPoints.Length; i++)
|
||||
{
|
||||
m_RoamingPoints[i] = m_RoamingAnchors[i].Position;
|
||||
}
|
||||
}
|
||||
[Range(0,1)]
|
||||
public float look = 0;
|
||||
/// <summary>
|
||||
/// 执行自动漫游
|
||||
/// </summary>
|
||||
/// <param name="_roaming">启动、关闭自动漫游</param>
|
||||
/// <param name="_looping">是否循环漫游</param>
|
||||
/// <param name="_roam_continue"> 是否继续上次中止的路径</param>
|
||||
/// <param name="_roming_finish_callback"></param>
|
||||
public void AutoRoaming(bool _roaming, bool _looping = false, bool _roam_continue = true, Action _roming_finish_callback = null)
|
||||
{
|
||||
if (_roaming)
|
||||
{
|
||||
//判断是否继续上次的漫游
|
||||
if (_roam_continue)
|
||||
{
|
||||
if (m_RoamingTween != null)
|
||||
{
|
||||
m_RoamingTween.Play();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//重新开始漫游
|
||||
if (BezierCurve == null)
|
||||
{
|
||||
BezierCurve = new BezierCurve(m_RoamingPoints, BezierDrawer != null ? BezierDrawer.accuracy : 10);
|
||||
}
|
||||
TargetCamera.position = BezierCurve.CurvePoints[0];
|
||||
m_RoamingTween = TargetCamera.DOPath(BezierCurve.CurvePoints, BezierCurve.CurveLength / RoamingSpeed).SetEase(Ease.Linear).SetLoops(_looping ? -1 : 0).SetLookAt(look).OnComplete(() => { _roming_finish_callback?.Invoke(); });
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_RoamingTween != null)
|
||||
{
|
||||
if (_roam_continue)
|
||||
{
|
||||
m_RoamingTween.Pause();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using W.Bezier;
|
||||
|
||||
public class CameraRoamManager : Singleton<CameraRoamManager>
|
||||
{
|
||||
/// <summary>
|
||||
/// 目标相机
|
||||
/// </summary>
|
||||
public Transform TargetCamera;
|
||||
/// <summary>
|
||||
/// 贝塞尔曲线绘画工具
|
||||
/// </summary>
|
||||
public BezierDrawer BezierDrawer;
|
||||
/// <summary>
|
||||
/// 贝塞尔曲线
|
||||
/// </summary>
|
||||
public BezierCurve BezierCurve;
|
||||
/// <summary>
|
||||
/// 所有的漫游锚点
|
||||
/// </summary>
|
||||
public List<RoamingAnchor> m_RoamingAnchors = new List<RoamingAnchor>();
|
||||
/// <summary>
|
||||
/// 贝塞尔曲线基准坐标集合
|
||||
/// </summary>
|
||||
public Vector3[] m_RoamingPoints;
|
||||
|
||||
/// <summary>
|
||||
/// 漫游协程
|
||||
/// </summary>
|
||||
public Coroutine m_RoamingCoroutine;
|
||||
|
||||
/// <summary>
|
||||
/// 漫游Tween
|
||||
/// </summary>
|
||||
private Tween m_RoamingTween;
|
||||
|
||||
/// <summary>
|
||||
/// 是否使用曲线路径
|
||||
/// </summary>
|
||||
public bool m_UseCurvePath = true;
|
||||
|
||||
/// <summary>
|
||||
/// 是否正在漫游
|
||||
/// </summary>
|
||||
public bool isRoaming;
|
||||
/// <summary>
|
||||
/// 漫游实时坐标
|
||||
/// </summary>
|
||||
public Vector3 m_Position;
|
||||
/// <summary>
|
||||
/// 漫游实时视角
|
||||
/// </summary>
|
||||
public Quaternion m_Rotation;
|
||||
/// <summary>
|
||||
/// 漫游速度
|
||||
/// </summary>
|
||||
public float RoamingSpeed = 2;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
InitRoamAnchor();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (isRoaming)
|
||||
{
|
||||
m_Position = transform.position;
|
||||
m_Rotation = transform.rotation;
|
||||
}
|
||||
}
|
||||
|
||||
void InitRoamAnchor()
|
||||
{
|
||||
if (TargetCamera == null)
|
||||
{
|
||||
TargetCamera = Camera.main.transform;
|
||||
}
|
||||
BezierDrawer = GetComponent<BezierDrawer>();
|
||||
|
||||
m_RoamingAnchors = ModelRoot.Instance.RoamAnchorRoot.GetComponentsInChildren<RoamingAnchor>().ToList();
|
||||
|
||||
m_RoamingPoints = new Vector3[m_RoamingAnchors.Count];
|
||||
|
||||
for (int i = 0; i < m_RoamingPoints.Length; i++)
|
||||
{
|
||||
m_RoamingPoints[i] = m_RoamingAnchors[i].Position;
|
||||
}
|
||||
}
|
||||
[Range(0, 1)]
|
||||
public float look = 0;
|
||||
/// <summary>
|
||||
/// 执行自动漫游
|
||||
/// </summary>
|
||||
/// <param name="_roaming">启动、关闭自动漫游</param>
|
||||
/// <param name="_looping">是否循环漫游</param>
|
||||
/// <param name="_roam_continue"> 是否继续上次中止的路径</param>
|
||||
/// <param name="_roming_finish_callback"></param>
|
||||
public void AutoRoaming(bool _roaming, bool _looping = false, bool _roam_continue = true, Action _roming_finish_callback = null)
|
||||
{
|
||||
if (_roaming)
|
||||
{
|
||||
CameraMove.Instance.ShieldingOperation = true;
|
||||
//判断是否继续上次的漫游
|
||||
if (_roam_continue)
|
||||
{
|
||||
if (m_RoamingTween != null)
|
||||
{
|
||||
TargetCamera.eulerAngles = Vector3.zero;
|
||||
m_RoamingTween.Play();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//重新开始漫游
|
||||
if (BezierCurve == null)
|
||||
{
|
||||
BezierCurve = new BezierCurve(m_RoamingPoints, BezierDrawer != null ? BezierDrawer.accuracy : 10);
|
||||
}
|
||||
TargetCamera.position = BezierCurve.CurvePoints[0];
|
||||
TargetCamera.LookAt(BezierCurve.CurvePoints[1]);
|
||||
m_RoamingTween = TargetCamera.DOPath(BezierCurve.CurvePoints, BezierCurve.CurveLength / RoamingSpeed).SetEase(Ease.Linear).SetLoops(_looping ? -1 : 0).SetLookAt(look).OnComplete(() => { _roming_finish_callback?.Invoke(); });
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
CameraMove.Instance.ShieldingOperation = false;
|
||||
if (m_RoamingTween != null)
|
||||
{
|
||||
if (_roam_continue)
|
||||
{
|
||||
m_RoamingTween.Pause();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4648d158fa86b3f4f87bea0bacc21bc3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,72 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
|
||||
public class AutoRoaming : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否自动漫游
|
||||
/// </summary>
|
||||
public bool autoRoaming;
|
||||
/// <summary>
|
||||
/// 自动漫游旋转轴
|
||||
/// </summary>
|
||||
private Vector3 RotateAng = Vector3.up;
|
||||
[Range(-10, 10), Tooltip("漫游速度")]
|
||||
public float roamSpeed = 5;
|
||||
[Range(0, 1), Tooltip("视角回正速度")]
|
||||
public float ResetVisualSpeed = 0.5f;
|
||||
|
||||
private Vector3 RoamingPosition;
|
||||
private Vector3 RoamingAngle;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
RoamingPosition = Camera.main.transform.position;
|
||||
RoamingAngle = Camera.main.transform.eulerAngles;
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (autoRoaming)
|
||||
transform.Rotate(RotateAng * roamSpeed * Time.deltaTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开始漫游
|
||||
/// </summary>
|
||||
/// <param name="callback"></param>
|
||||
/// <param name="onStartRoming">开始漫游后回调</param>
|
||||
public void StartRoam(System.Action callback = null, System.Action onStartRoming = null)
|
||||
{
|
||||
if (autoRoaming) return;
|
||||
callback?.Invoke();
|
||||
int count = Camera.main.transform.DOKill();
|
||||
Debug.Log("Kill count: " + count);
|
||||
Camera.main.transform.DORotate(RoamingAngle, 0.4f);
|
||||
Camera.main.transform.DOMove(RoamingPosition, 0.4f).OnComplete(() =>
|
||||
{
|
||||
autoRoaming = true;
|
||||
CameraController.Instance.SetTransform(RoamingPosition, RoamingAngle);
|
||||
onStartRoming?.Invoke();
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
///<param name="reset">是否重置角度</param>
|
||||
///<param name="callback"></param>
|
||||
///<param name="onStopRoming">重置角度后回调</param>
|
||||
public void StopRoam(bool reset = false, System.Action callback = null, System.Action onStopRoming = null)
|
||||
{
|
||||
if (!autoRoaming) return;
|
||||
callback?.Invoke();
|
||||
autoRoaming = false;
|
||||
if (reset)
|
||||
{
|
||||
transform.DORotate(Vector3.zero, ResetVisualSpeed).OnComplete(() => { onStopRoming?.Invoke(); });
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f14f803f457a242428891b7cf2641e6c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,129 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
public class CameraController : MonoBehaviour
|
||||
{
|
||||
public static CameraController Instance;
|
||||
/// <summary>
|
||||
/// 禁止操作
|
||||
/// </summary>
|
||||
//[HideInInspector]
|
||||
public bool ShieldingOperation;
|
||||
|
||||
protected Quaternion myLocalAng;
|
||||
protected Vector3 myPos;
|
||||
|
||||
/// <summary>
|
||||
/// 定位目标
|
||||
/// </summary>
|
||||
protected Transform Target;
|
||||
/// <summary>
|
||||
/// 默认定位距离
|
||||
/// </summary>
|
||||
public float distance = 200;
|
||||
public float Distance => distance;
|
||||
|
||||
public float eulerx;
|
||||
public float eulery;
|
||||
public float horizontal;
|
||||
public float vertical;
|
||||
|
||||
public Vector2 XLimit = new Vector2(-500, 500);
|
||||
public Vector2 YLimit = new Vector2(5, 500);
|
||||
public Vector2 ZLimit = new Vector2(-500, 500);
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
//if (Target != null)
|
||||
// Distance = Vector3.Distance(Target.position, transform.position);
|
||||
}
|
||||
|
||||
protected void InitTransform()
|
||||
{
|
||||
//ShieldingOperation = true;
|
||||
myLocalAng = transform.rotation;
|
||||
horizontal = eulerx = myLocalAng.eulerAngles.y;
|
||||
vertical = eulery = myLocalAng.eulerAngles.x;
|
||||
if (vertical > 180)
|
||||
vertical -= 360;
|
||||
myPos = transform.position;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置相机位置
|
||||
/// 开启自动漫游时设置
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="angle"></param>
|
||||
public void SetTransform(Vector3 position, Vector3 angle)
|
||||
{
|
||||
Target = null;
|
||||
transform.position = position;
|
||||
transform.eulerAngles = angle;
|
||||
InitTransform();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置坐标及角度
|
||||
/// </summary>
|
||||
/// <param name="_position"></param>
|
||||
/// <param name="_rotation"></param>
|
||||
public void SetTransform(Vector3 _position, Quaternion _rotation)
|
||||
{
|
||||
Target = null;
|
||||
transform.position = _position;
|
||||
transform.rotation = _rotation;
|
||||
InitTransform();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定位至目标
|
||||
/// </summary>
|
||||
/// <param name="target"></param>
|
||||
public void LocateToTarget(Transform target, float distance = 50)
|
||||
{
|
||||
if (target == null) return;
|
||||
this.distance = distance;
|
||||
Target = target;
|
||||
ShieldingOperation = true;
|
||||
|
||||
transform.DOMove((transform.rotation * Vector3.back * Distance + Target.position), 0.5f).OnComplete(() =>
|
||||
{
|
||||
myPos = transform.position;
|
||||
ShieldingOperation = false;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定位至目标
|
||||
/// </summary>
|
||||
/// <param name="target"></param>
|
||||
public void LocateToTarget(Transform target, Vector3 _angle, float distance = 50)
|
||||
{
|
||||
if (target == null) return;
|
||||
this.distance = distance;
|
||||
Target = target;
|
||||
ShieldingOperation = true;
|
||||
|
||||
transform.DORotate(_angle, 0.5f);
|
||||
|
||||
transform.DOMove((transform.rotation * Vector3.back * Distance + Target.position), 0.5f).OnComplete(() =>
|
||||
{
|
||||
myPos = transform.position;
|
||||
ShieldingOperation = false;
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 351db9be0c6f8d443aa54dd41edb4fab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,202 @@
|
|||
using DG.Tweening;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using static UnityEngine.EventSystems.EventTrigger;
|
||||
|
||||
public class CameraMove : CameraController
|
||||
{
|
||||
public new static CameraMove Instance;
|
||||
/// <summary>
|
||||
/// 速度
|
||||
/// </summary>
|
||||
public float m_Speed;
|
||||
[Header("移动加速度")]
|
||||
public float m_AcceSpeed = 50;
|
||||
/// <summary>
|
||||
/// 最大移动速度
|
||||
/// </summary>
|
||||
public float maxSpeed = 50;
|
||||
|
||||
[Range(0, 1), Tooltip("旋转响应速度")]
|
||||
public float RotLerp = 0.4f;
|
||||
|
||||
|
||||
[Range(0, 1), Tooltip("移动响应速度")]
|
||||
public float AccelerationLerp = 0.3f;
|
||||
|
||||
/// <summary>
|
||||
/// 滚轮移动速度
|
||||
/// </summary>
|
||||
private float m_ScrollSpeed = 80;
|
||||
|
||||
public Vector3 init_position = new Vector3(3707, 397, 2543);
|
||||
public Vector3 init_rotation = new Vector3(40, 278, 0);
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
Debug.Log("相机控制初始化");
|
||||
InitTransform();
|
||||
init_position = transform.position;
|
||||
init_rotation = transform.eulerAngles;
|
||||
}
|
||||
|
||||
bool lostFocus;
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (ShieldingOperation) return;
|
||||
|
||||
if (!Application.isFocused)
|
||||
lostFocus = true;
|
||||
|
||||
#region 移动
|
||||
//键盘移动
|
||||
if (UtilityInput.Horizontal != 0 || UtilityInput.Vertical != 0)
|
||||
{
|
||||
if (Target != null) Target = null;
|
||||
if (m_Speed < maxSpeed)
|
||||
m_Speed += Time.deltaTime * m_AcceSpeed;
|
||||
myPos += transform.TransformDirection(Dirction);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Speed -= Time.deltaTime * m_AcceSpeed;
|
||||
}
|
||||
m_Speed = Mathf.Clamp(m_Speed, 0, maxSpeed);
|
||||
|
||||
if (!EventSystem.current.IsPointerOverGameObject())
|
||||
{
|
||||
#region 旋转
|
||||
if (UtilityInput.HoldRightMouse)
|
||||
{
|
||||
//解决当重新获取焦点时,鼠标移动值异常的情况
|
||||
if (lostFocus)
|
||||
{
|
||||
lostFocus = false;
|
||||
return;
|
||||
}
|
||||
horizontal += UtilityInput.MouseMoveX;
|
||||
vertical -= UtilityInput.MouseMoveY;
|
||||
|
||||
vertical = Mathf.Clamp(vertical, -90, 90);
|
||||
}
|
||||
eulerx = Mathf.Lerp(eulerx, horizontal, RotLerp);
|
||||
eulery = Mathf.Lerp(eulery, vertical, RotLerp);
|
||||
#endregion
|
||||
|
||||
//滚轮前进
|
||||
if (Dirction.Equals(Vector3.zero) && UtilityInput.Scroll != 0)
|
||||
{
|
||||
if (Target != null) distance -= UtilityInput.Scroll * m_ScrollSpeed;
|
||||
distance = Mathf.Clamp(distance, 20, 500);
|
||||
myPos += transform.TransformDirection(Vector3.forward * UtilityInput.Scroll * m_ScrollSpeed);
|
||||
}
|
||||
|
||||
//滚轮移动
|
||||
if (Dirction.Equals(Vector3.zero) && UtilityInput.HoldMiddleMouse)
|
||||
{
|
||||
Target = null;
|
||||
float x = UtilityInput.MouseMoveX;
|
||||
float y = UtilityInput.MouseMoveY;
|
||||
myPos += transform.TransformDirection(new Vector3(-x, -y) * 2);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
transform.rotation = Quaternion.Euler(eulery, eulerx, 0);
|
||||
if (Target == null)
|
||||
{
|
||||
myPos.x = Mathf.Clamp(myPos.x, XLimit.x, XLimit.y);
|
||||
myPos.y = Mathf.Clamp(myPos.y, YLimit.x, YLimit.y);
|
||||
myPos.z = Mathf.Clamp(myPos.z, ZLimit.x, ZLimit.y);
|
||||
//transform.position = Vector3.Lerp(transform.position, myPos, AccelerationLerp);
|
||||
transform.localPosition = Vector3.Lerp(transform.localPosition, myPos, AccelerationLerp);
|
||||
}
|
||||
else
|
||||
{
|
||||
//存在定位目标时,绕目标旋转
|
||||
Vector3 tempPos = transform.rotation * Vector3.back * Distance + Target.position;
|
||||
tempPos.x = Mathf.Clamp(tempPos.x, XLimit.x, XLimit.y);
|
||||
tempPos.y = Mathf.Clamp(tempPos.y, YLimit.x, YLimit.y);
|
||||
tempPos.z = Mathf.Clamp(tempPos.z, ZLimit.x, ZLimit.y);
|
||||
transform.position = myPos = tempPos;
|
||||
}
|
||||
}
|
||||
|
||||
#region 自定义功能
|
||||
|
||||
public void KillAllTween()
|
||||
{
|
||||
DOTween.Kill(transform);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 首页角度
|
||||
/// </summary>
|
||||
public void SetInitTransform()
|
||||
{
|
||||
Target = null;
|
||||
ShieldingOperation = true;
|
||||
transform.DORotate(init_rotation, 0.5f);
|
||||
transform.DOMove(init_position, 0.5f).OnComplete(() => { InitTransform(); ShieldingOperation = false; });
|
||||
}
|
||||
|
||||
public Vector3 power_grid_monitoring_pos = new Vector3(3360, 291, 2200);
|
||||
public Vector3 power_grid_monitoring_ang = new Vector3(40, -35, 0);
|
||||
|
||||
/// <summary>
|
||||
/// 电网监控
|
||||
/// </summary>
|
||||
public void SetPowerGridTransform()
|
||||
{
|
||||
Target = null;
|
||||
ShieldingOperation = true;
|
||||
transform.DORotate(power_grid_monitoring_ang, 0.5f);
|
||||
transform.DOMove(power_grid_monitoring_pos, 0.5f).OnComplete(() => { InitTransform(); ShieldingOperation = false; });
|
||||
}
|
||||
|
||||
public Vector3 power_energy_management_pos = new Vector3(3154, 202, 2635);
|
||||
public Vector3 power_energy_management_ang = new Vector3(41, 118, 0);
|
||||
|
||||
/// <summary>
|
||||
/// 能源管理
|
||||
/// </summary>
|
||||
public void SetEnergyManagementTransform()
|
||||
{
|
||||
Target = null;
|
||||
ShieldingOperation = true;
|
||||
transform.DORotate(power_energy_management_ang, 0.5f);
|
||||
transform.DOMove(power_energy_management_pos, 0.5f).OnComplete(() => { InitTransform(); ShieldingOperation = false; });
|
||||
}
|
||||
|
||||
public Vector3 power_energy_efficiency_management_pos = new Vector3(2993, 317, 2662);
|
||||
public Vector3 power_energy_efficiency_management_ang = new Vector3(51, 158, 0);
|
||||
|
||||
/// <summary>
|
||||
/// 能效管理
|
||||
/// </summary>
|
||||
public void SetEnergyEfficiencyManagementTransform()
|
||||
{
|
||||
Target = null;
|
||||
ShieldingOperation = true;
|
||||
transform.DORotate(power_energy_efficiency_management_ang, 0.5f);
|
||||
transform.DOMove(power_energy_efficiency_management_pos, 0.5f).OnComplete(() => { InitTransform(); ShieldingOperation = false; });
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 键盘操作
|
||||
/// </summary>
|
||||
public Vector3 Dirction => new Vector3(UtilityInput.Horizontal, 0, UtilityInput.Vertical) * Time.deltaTime * m_Speed * (UtilityInput.SpeedUp ? 2 : 1);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6c85bb0618559d44094a5cc9be212b3a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,66 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MouseOrbit : MonoBehaviour
|
||||
{
|
||||
public bool ShieldingOperation;
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加速
|
||||
/// </summary>
|
||||
float accelerate;
|
||||
public float speed = 50;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (ShieldingOperation) return;
|
||||
if (transform.position.y <= 1f) transform.position = new Vector3(transform.position.x,1f, transform.position.z);
|
||||
if (Input.GetMouseButton(0))//UtilityInput.HoldRightMouse)
|
||||
{
|
||||
float x = Input.GetAxis("Mouse X");
|
||||
float y = Input.GetAxis("Mouse Y");
|
||||
transform.Rotate(new Vector3(-y, x) * 1.8f);
|
||||
|
||||
Vector3 v = transform.localEulerAngles;
|
||||
transform.localEulerAngles = new Vector3(v.x, v.y, 0);
|
||||
}
|
||||
|
||||
if (Input.GetMouseButton(2))
|
||||
{
|
||||
float x = Input.GetAxis("Mouse X");
|
||||
float y = Input.GetAxis("Mouse Y");
|
||||
transform.Translate(new Vector3(-x*1.2f, -y*1.2f));
|
||||
}else if (Input.GetKey(KeyCode.Q))
|
||||
{
|
||||
float y = Time.deltaTime * 5;
|
||||
transform.Translate(new Vector3(0, -y));
|
||||
}
|
||||
else if (Input.GetKey(KeyCode.E))
|
||||
{
|
||||
float y = -Time.deltaTime * 5;
|
||||
transform.Translate(new Vector3(0, -y));
|
||||
}
|
||||
if (Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0)
|
||||
//UtilityInput.Horizontal != 0 || UtilityInput.Vertical != 0)
|
||||
{
|
||||
if (accelerate < 10)
|
||||
accelerate += Time.deltaTime * 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
accelerate -= Time.deltaTime * 5;
|
||||
}
|
||||
accelerate = Mathf.Clamp(accelerate, 0, 10);
|
||||
transform.Translate(Dirction);
|
||||
if (Dirction.Equals(Vector3.zero)) transform.Translate(Vector3.forward * Input.GetAxis("Mouse ScrollWheel") * 10);
|
||||
}
|
||||
|
||||
|
||||
public Vector3 Dirction => new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")) * Time.deltaTime * accelerate * (Input .GetKey(KeyCode.LeftShift) ? 20 : 010);
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 40d4184c0fa2cd44ba81c6469740d096
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,35 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class UtilityInput
|
||||
{
|
||||
public static float Scroll { get => Input.GetAxis("Mouse ScrollWheel"); }
|
||||
public static float MouseMoveX { get => Input.GetAxis("Mouse X"); }
|
||||
public static float MouseMoveY { get => Input.GetAxis("Mouse Y"); }
|
||||
public static bool HoldLeftMouse { get => Input.GetMouseButton(0); }
|
||||
public static bool HoldRightMouse { get => Input.GetMouseButton(1); }
|
||||
public static bool HoldMiddleMouse { get => Input.GetMouseButton(2); }
|
||||
public static bool MouseUp { get => Input.GetMouseButtonUp(0); }
|
||||
public static bool IsOverUI { get => EventSystem.current.IsPointerOverGameObject(); }
|
||||
public static bool AnyMouseDown { get => Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2); }
|
||||
public static bool AnyMouseUp { get => Input.GetMouseButtonUp(0) || Input.GetMouseButtonUp(1) || Input.GetMouseButtonUp(2); }
|
||||
|
||||
public static float Horizontal { get => Input.GetAxis("Horizontal"); }
|
||||
public static float Vertical { get => Input.GetAxis("Vertical"); }
|
||||
|
||||
public static bool LeftShift { get => Input.GetKey(KeyCode.LeftShift); }
|
||||
|
||||
public static bool GetMouse(int _mouse) =>Input.GetMouseButton(_mouse);
|
||||
|
||||
public static bool SpeedUp => Input.GetKey(KeyCode.LeftShift);
|
||||
//public static float Horizontal => Input.GetAxis("Horizontal");
|
||||
//public static float Vertical => Input.GetAxis("Vertical");
|
||||
public static bool OverUI => EventSystem.current.IsPointerOverGameObject();
|
||||
|
||||
public static bool Down { get { return Input.GetKey(KeyCode.Z); } }
|
||||
public static bool Up { get { return Input.GetKey(KeyCode.X); } }
|
||||
|
||||
public static bool Sprint { get { return Input.GetKey(KeyCode.LeftShift); } }
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ed93b3c51ec0beb49834fbfbd25e4318
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,39 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class DeviceBase : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备类型
|
||||
/// </summary>
|
||||
public DeviceType DeviceType;
|
||||
/// <summary>
|
||||
/// 设备编号
|
||||
/// </summary>
|
||||
public string DeviceIndex;
|
||||
/// <summary>
|
||||
/// 设备列表
|
||||
/// </summary>
|
||||
public static List<DeviceBase> DeviceBaseList = new List<DeviceBase>();
|
||||
/// <summary>
|
||||
/// 相机字段表
|
||||
/// </summary>
|
||||
[SerializeField]
|
||||
public Competition.Mysql.Model.T_BAS_CAMERA T_BAS_CAMERA;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
transform.position = GetComponentInParent<Renderer>().bounds.center;
|
||||
if (transform.parent.name.Contains("_"))
|
||||
{
|
||||
DeviceIndex = transform.parent.name.Split('_')[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
DeviceIndex = transform.parent.name;
|
||||
}
|
||||
DeviceBaseList.Add(this);
|
||||
Debug.Log(transform.parent.name);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 664453e88152fe6429a5bcf681ac120a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,44 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class DeviceUIBase : MonoBehaviour, IPointerClickHandler
|
||||
{
|
||||
public DeviceBase DeviceBase;
|
||||
public string DeviceIndex;
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
Debug.Log(DeviceBase.DeviceType + "_" + DeviceBase.DeviceIndex);
|
||||
switch (DeviceBase.DeviceType)
|
||||
{
|
||||
case DeviceType.CAMERA:
|
||||
//打开相机窗口
|
||||
Debug.Log(DeviceBase.T_BAS_CAMERA.ToString());
|
||||
UIManager.Instance.ShowCameraPage(DeviceBase.T_BAS_CAMERA.CameraID, DeviceBase.T_BAS_CAMERA.CUSTOMS_CODE, DeviceBase.T_BAS_CAMERA.MONITOR_ID);
|
||||
break;
|
||||
case DeviceType.BELT_SCALE:
|
||||
//打开皮带秤窗口
|
||||
UIManager.Instance.ShowBeltScalePage(DeviceBase.DeviceIndex);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void Init(DeviceBase _device_base)
|
||||
{
|
||||
DeviceBase = _device_base;
|
||||
DeviceIndex = _device_base.DeviceIndex;
|
||||
switch (DeviceBase.DeviceType)
|
||||
{
|
||||
case DeviceType.CAMERA:
|
||||
transform.name = "Camera_UI_" + DeviceIndex;
|
||||
break;
|
||||
case DeviceType.BELT_SCALE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a3449b44ff76a714386383fa244e9516
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,22 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class LookAtCamera : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
public float _distance;
|
||||
public float _multi = 0.1f;
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
transform.eulerAngles = ModelRoot.Instance.MainCamera.transform.eulerAngles;
|
||||
|
||||
/*var*/ _distance = Vector3.Distance(transform.position, ModelRoot.Instance.MainCamera.transform.position);
|
||||
transform.localScale = Vector3.one * Mathf.Clamp(_distance * _multi *0.01f, 0.05f, 0.3f);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 52b8fb0629028ff428dd6d219a696e2a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,112 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Competition.Mysql.Model;
|
||||
using Unity.VisualScripting;
|
||||
|
||||
public class ApiManager : Singleton<ApiManager>
|
||||
{
|
||||
/// <summary>
|
||||
/// 接口ip地址
|
||||
/// </summary>
|
||||
public string IpAddress = "";
|
||||
/// <summary>
|
||||
/// 本地配置的Api字典
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ApiDic = new Dictionary<string, string>();
|
||||
/// <summary>
|
||||
/// 本地配置的Camera字典
|
||||
/// Key:相机编号
|
||||
/// Value:CameraID
|
||||
/// </summary>
|
||||
public Dictionary<string, string> CameraDic = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// 相机列表数据
|
||||
/// </summary>
|
||||
public List<T_BAS_CAMERA> T_BAS_CAMERA_List { get; set; } = new List<T_BAS_CAMERA>();
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
var _ip_str_url = Path.Combine(Application.streamingAssetsPath, "configure.json");
|
||||
StartCoroutine(RequestBase.Get(_ip_str_url, (_data, _error) =>
|
||||
{
|
||||
if (_error != null)
|
||||
{
|
||||
Debug.Log($"<color=#ff0000> {_error} </color>");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("读取配置文件完成");
|
||||
IpAddress = JObject.Parse(_data)["ip"].ToString();
|
||||
}
|
||||
}));
|
||||
|
||||
var _api_dic_url = Path.Combine(Application.streamingAssetsPath, "configure_api.json");
|
||||
StartCoroutine(RequestBase.Get(_api_dic_url, (_data, _error) =>
|
||||
{
|
||||
if (_error != null)
|
||||
{
|
||||
Debug.Log($"<color=#ff0000> {_error} </color>");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("读取api文件完成");
|
||||
ApiDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(_data);
|
||||
}
|
||||
}));
|
||||
|
||||
var _cam_dic_url = Path.Combine(Application.streamingAssetsPath, "configure_camera.json");
|
||||
StartCoroutine(RequestBase.Get(_cam_dic_url, (_data, _error) =>
|
||||
{
|
||||
if (_error != null)
|
||||
{
|
||||
Debug.Log($"<color=#ff0000> {_error} </color>");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("读取相机文件完成");
|
||||
CameraDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(_data);
|
||||
}
|
||||
}));
|
||||
|
||||
StartCoroutine(GetCameraList());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 接口-获取相机列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IEnumerator GetCameraList()
|
||||
{
|
||||
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
|
||||
var _get_camera_list = IpAddress + ApiDic["GetCameraList"];
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (CallForTest.instance != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(CallForTest.instance.MONITOR_ID))
|
||||
{
|
||||
//编辑器测试
|
||||
CallForTest.instance.MONITOR_ID = "CNMAW350015";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
StartCoroutine(RequestBase.Get(_get_camera_list, new Dictionary<string, string>() { ["monotorId"] = CallForTest.instance.MONITOR_ID }, (_data, _error) =>
|
||||
{
|
||||
if (_error != null)
|
||||
{
|
||||
Debug.Log($"<color=#ff0000> {_error} </color>");
|
||||
}
|
||||
else
|
||||
{
|
||||
T_BAS_CAMERA_List = JsonConvert.DeserializeObject<DataBase<List<T_BAS_CAMERA>>>(_data).data;
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a946f432636a8b64d9594412dabd0cea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,19 +1,81 @@
|
|||
using Competition.Mysql.Model;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using XCharts.Runtime;
|
||||
|
||||
public class MainScene : MonoBehaviour
|
||||
public class MainScene : Singleton<MainScene>
|
||||
{
|
||||
/// <summary>
|
||||
/// 模型场景加载完成后调用
|
||||
/// </summary>
|
||||
public Action OnSceneLoaded;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
SceneManager.LoadScene(2, LoadSceneMode.Additive);
|
||||
OnSceneLoaded += SceneLoaded;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
void SceneLoaded()
|
||||
{
|
||||
//模型场景加载完毕后,根据模型场景中的设备生成对应UI
|
||||
Debug.Log("444333");
|
||||
|
||||
for (int i = 0; i < DeviceBase.DeviceBaseList.Count; i++)
|
||||
{
|
||||
switch (DeviceBase.DeviceBaseList[i].DeviceType)
|
||||
{
|
||||
case DeviceType.CAMERA:
|
||||
if (ModelRoot.Instance.CameraIconPrefab == null)
|
||||
{
|
||||
ModelRoot.Instance.CameraIconPrefab = Resources.Load("Prefabs/UI/DeviceIcons/CameraIcon") as GameObject;
|
||||
}
|
||||
var _camera_icon = Instantiate(ModelRoot.Instance.CameraIconPrefab, ModelRoot.Instance.Canvas_3D);
|
||||
_camera_icon.transform.position = DeviceBase.DeviceBaseList[i].transform.position;
|
||||
_camera_icon.GetComponent<DeviceUIBase>().Init(DeviceBase.DeviceBaseList[i]);
|
||||
break;
|
||||
case DeviceType.BELT_SCALE:
|
||||
if (ModelRoot.Instance.BeltScaleIconPrefab == null)
|
||||
{
|
||||
ModelRoot.Instance.BeltScaleIconPrefab = Resources.Load("Prefabs/UI/DeviceIcons/BeltScaleIcon") as GameObject;
|
||||
}
|
||||
var _belt_scale_icon = Instantiate(ModelRoot.Instance.BeltScaleIconPrefab, ModelRoot.Instance.Canvas_3D);
|
||||
_belt_scale_icon.transform.position = DeviceBase.DeviceBaseList[i].transform.position;
|
||||
_belt_scale_icon.GetComponent<DeviceUIBase>().Init(DeviceBase.DeviceBaseList[i]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
StartCoroutine(SetCamera());
|
||||
}
|
||||
|
||||
IEnumerator SetCamera()
|
||||
{
|
||||
yield return new WaitUntil(() => { return ApiManager.Instance.T_BAS_CAMERA_List.Count != 0; }) ;
|
||||
for (int i = 0; i < DeviceBase.DeviceBaseList.Count; i++)
|
||||
{
|
||||
switch (DeviceBase.DeviceBaseList[i].DeviceType)
|
||||
{
|
||||
case DeviceType.CAMERA:
|
||||
|
||||
var _camera_id = ApiManager.Instance.CameraDic[DeviceBase.DeviceBaseList[i].DeviceIndex];
|
||||
var _camera = ApiManager.Instance.T_BAS_CAMERA_List.Find(x => x.CameraID == _camera_id);
|
||||
if (_camera != null)
|
||||
{
|
||||
DeviceBase.DeviceBaseList[i].T_BAS_CAMERA = _camera;
|
||||
}
|
||||
|
||||
break;
|
||||
case DeviceType.BELT_SCALE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,11 +13,31 @@ public class ModelRoot : Singleton<ModelRoot>
|
|||
/// </summary>
|
||||
public Camera MainCamera;
|
||||
|
||||
/// <summary>
|
||||
/// 设备图标画布
|
||||
/// </summary>
|
||||
public Transform Canvas_3D;
|
||||
|
||||
/// <summary>
|
||||
/// 预制体-相机UI图标
|
||||
/// </summary>
|
||||
public GameObject CameraIconPrefab;
|
||||
/// <summary>
|
||||
/// 预制体-皮带秤UI图标
|
||||
/// </summary>
|
||||
public GameObject BeltScaleIconPrefab;
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
RoamAnchorRoot = GameObject.Find("RoamAnchorRoot");
|
||||
MainCamera = Camera.main;
|
||||
Canvas_3D = GameObject.Find("3DCanvas").transform;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using W.UI;
|
||||
|
||||
public class UIManager : MonoBehaviour
|
||||
public class UIManager : Singleton<UIManager>
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否在漫游
|
||||
|
@ -109,4 +108,32 @@ public class UIManager : MonoBehaviour
|
|||
|
||||
//同时清空场景中的高亮
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开摄像头窗口
|
||||
/// </summary>
|
||||
/// <param name="_camera_id">摄像头ID</param>
|
||||
/// <param name="_custom_code">关区ID</param>
|
||||
/// <param name="_monitor_id">企业系统代码</param>
|
||||
public void ShowCameraPage(string _camera_id, string _custom_code, string _monitor_id)
|
||||
{
|
||||
//拼接url
|
||||
UIRoot.Instance.VideoWebPage.ShowPanel();
|
||||
UIRoot.Instance.VideoWebPage.SetWebPage(_camera_id, _custom_code, _monitor_id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开皮带秤窗口
|
||||
/// </summary>
|
||||
/// <param name="_index"></param>
|
||||
public void ShowBeltScalePage(string _index)
|
||||
{
|
||||
UIRoot.Instance.MeasuringScale.ShowPanel();
|
||||
//UIRoot.Instance.MeasuringScale.SetWebPage(_camera_id, _custom_code, _monitor_id);
|
||||
}
|
||||
|
||||
public void ShowYardInformationPage()
|
||||
{
|
||||
UIRoot.Instance.YardInformation.ShowPanel();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,77 +1,90 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using W.UI;
|
||||
|
||||
public class UIRoot : UITool
|
||||
{
|
||||
private static UIRoot _instance;
|
||||
public static UIRoot Instance => _instance;
|
||||
|
||||
#region UI
|
||||
/// <summary>
|
||||
/// 年月日
|
||||
/// </summary>
|
||||
public TextMeshProUGUI Time_YYMMDD;
|
||||
/// <summary>
|
||||
/// 星期
|
||||
/// </summary>
|
||||
public TextMeshProUGUI Time_Week;
|
||||
/// <summary>
|
||||
/// 时分秒
|
||||
/// </summary>
|
||||
public TextMeshProUGUI Time_HHmmss;
|
||||
|
||||
/// <summary>
|
||||
/// 自动漫游按钮
|
||||
/// </summary>
|
||||
public Button RoamingButton;
|
||||
|
||||
/// <summary>
|
||||
/// 船名搜索输入框
|
||||
/// </summary>
|
||||
public TMP_InputField ShipNameInputField;
|
||||
/// <summary>
|
||||
/// 航次搜索输入框
|
||||
/// </summary>
|
||||
public TMP_InputField VoyageInputField;
|
||||
/// <summary>
|
||||
/// 卸货地搜索输入框
|
||||
/// </summary>
|
||||
public TMP_InputField DischargeLocationInputField;
|
||||
/// <summary>
|
||||
/// 商品名称搜索输入框
|
||||
/// </summary>
|
||||
public TMP_InputField GoodsNameInputField;
|
||||
/// <summary>
|
||||
/// 搜索按钮
|
||||
/// </summary>
|
||||
public Button SearchButton;
|
||||
/// <summary>
|
||||
/// 清空按钮
|
||||
/// </summary>
|
||||
public Button ClearSearchButton;
|
||||
#endregion
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
_instance = this;
|
||||
StartCoroutine(Time());
|
||||
}
|
||||
|
||||
IEnumerator Time()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Time_YYMMDD.text = DateTime.Now.ToString("yyyy.MM.dd");
|
||||
Time_Week.text = DateTime.Now.ToString("dddd");
|
||||
Time_HHmmss.text = DateTime.Now.ToString("HH:mm:ss");
|
||||
|
||||
yield return new WaitForSeconds(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using W.UI;
|
||||
|
||||
public class UIRoot : UITool
|
||||
{
|
||||
private static UIRoot _instance;
|
||||
public static UIRoot Instance => _instance;
|
||||
|
||||
#region UI
|
||||
/// <summary>
|
||||
/// 年月日
|
||||
/// </summary>
|
||||
public TextMeshProUGUI Time_YYMMDD;
|
||||
/// <summary>
|
||||
/// 星期
|
||||
/// </summary>
|
||||
public TextMeshProUGUI Time_Week;
|
||||
/// <summary>
|
||||
/// 时分秒
|
||||
/// </summary>
|
||||
public TextMeshProUGUI Time_HHmmss;
|
||||
|
||||
/// <summary>
|
||||
/// 自动漫游按钮
|
||||
/// </summary>
|
||||
public Button RoamingButton;
|
||||
|
||||
/// <summary>
|
||||
/// 船名搜索输入框
|
||||
/// </summary>
|
||||
public TMP_InputField ShipNameInputField;
|
||||
/// <summary>
|
||||
/// 航次搜索输入框
|
||||
/// </summary>
|
||||
public TMP_InputField VoyageInputField;
|
||||
/// <summary>
|
||||
/// 卸货地搜索输入框
|
||||
/// </summary>
|
||||
public TMP_InputField DischargeLocationInputField;
|
||||
/// <summary>
|
||||
/// 商品名称搜索输入框
|
||||
/// </summary>
|
||||
public TMP_InputField GoodsNameInputField;
|
||||
/// <summary>
|
||||
/// 搜索按钮
|
||||
/// </summary>
|
||||
public Button SearchButton;
|
||||
/// <summary>
|
||||
/// 清空按钮
|
||||
/// </summary>
|
||||
public Button ClearSearchButton;
|
||||
|
||||
/// <summary>
|
||||
/// 皮带秤界面
|
||||
/// </summary>
|
||||
public MeasuringScale MeasuringScale;
|
||||
/// <summary>
|
||||
/// 堆场界面
|
||||
/// </summary>
|
||||
public YardInformation YardInformation;
|
||||
/// <summary>
|
||||
/// 摄像机视频界面
|
||||
/// </summary>
|
||||
public VideoWebPage VideoWebPage;
|
||||
#endregion
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
_instance = this;
|
||||
StartCoroutine(Time());
|
||||
}
|
||||
|
||||
IEnumerator Time()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Time_YYMMDD.text = DateTime.Now.ToString("yyyy.MM.dd");
|
||||
Time_Week.text = DateTime.Now.ToString("dddd");
|
||||
Time_HHmmss.text = DateTime.Now.ToString("HH:mm:ss");
|
||||
|
||||
yield return new WaitForSeconds(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,9 +24,12 @@ public class PhysicManager : MonoBehaviour
|
|||
|
||||
private void Update()
|
||||
{
|
||||
if (PhysicRay(ModelRoot.Instance.MainCamera.ScreenPointToRay(Input.mousePosition),out RaycastHit hit))
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
Debug.Log(hit.collider.name);
|
||||
if (PhysicRay(ModelRoot.Instance.MainCamera.ScreenPointToRay(Input.mousePosition), out RaycastHit hit))
|
||||
{
|
||||
Debug.Log(hit.collider.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,130 +1,134 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using W.UI;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
using XCharts.Runtime;
|
||||
|
||||
/// <summary>
|
||||
/// 计量秤Page
|
||||
/// </summary>
|
||||
public class MeasuringScale : UITool
|
||||
{
|
||||
/// <summary>
|
||||
/// 计量秤按钮
|
||||
/// </summary>
|
||||
public CustomGroupButton MeasureScaleButton;
|
||||
/// <summary>
|
||||
/// 采集数据按钮
|
||||
/// </summary>
|
||||
public CustomGroupButton CollectDataButton;
|
||||
|
||||
/// <summary>
|
||||
/// 计量秤页面
|
||||
/// </summary>
|
||||
public RectTransform MSPage;
|
||||
/// <summary>
|
||||
/// 测量数据页面
|
||||
/// </summary>
|
||||
public RectTransform CDPage;
|
||||
|
||||
/// <summary>
|
||||
/// 关闭按钮
|
||||
/// </summary>
|
||||
public Button CloseButton;
|
||||
|
||||
#region 计量秤页面内容
|
||||
|
||||
/// <summary>
|
||||
/// 计量秤名称
|
||||
/// </summary>
|
||||
public TextMeshProUGUI MeasuringScaleName;
|
||||
/// <summary>
|
||||
/// 计量秤编号
|
||||
/// </summary>
|
||||
public TextMeshProUGUI MeasuringScaleNO;
|
||||
/// <summary>
|
||||
/// 型号
|
||||
/// </summary>
|
||||
public TextMeshProUGUI ModelNO;
|
||||
/// <summary>
|
||||
/// 出厂编号
|
||||
/// </summary>
|
||||
public TextMeshProUGUI FactoryNO;
|
||||
/// <summary>
|
||||
/// 生产厂家
|
||||
/// </summary>
|
||||
public TextMeshProUGUI ProduceName;
|
||||
/// <summary>
|
||||
/// 出厂日期
|
||||
/// </summary>
|
||||
public TextMeshProUGUI FactoryDate;
|
||||
|
||||
/// <summary>
|
||||
/// 计量秤编码_实时数据
|
||||
/// </summary>
|
||||
public TextMeshProUGUI MeasuringScaleNO_RealTime;
|
||||
/// <summary>
|
||||
/// 采集时间
|
||||
/// </summary>
|
||||
public TextMeshProUGUI CollectTime;
|
||||
/// <summary>
|
||||
/// 实时累计质量
|
||||
/// </summary>
|
||||
public TextMeshProUGUI RealTimeCumulativeQuality;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 采集数据页面内容
|
||||
|
||||
/// <summary>
|
||||
/// 图形展示
|
||||
/// </summary>
|
||||
public Toggle ChartToggle;
|
||||
/// <summary>
|
||||
/// 表展示
|
||||
/// </summary>
|
||||
public Toggle TableToggle;
|
||||
|
||||
/// <summary>
|
||||
/// 采集数据折线图
|
||||
/// </summary>
|
||||
public LineChart LineChart;
|
||||
/// <summary>
|
||||
/// 采集数据表
|
||||
/// </summary>
|
||||
public RectTransform Table;
|
||||
|
||||
#endregion
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
MeasureScaleButton.onClick.AddListener(() =>
|
||||
{
|
||||
MSPage.gameObject.SetActive(true);
|
||||
CDPage.gameObject.SetActive(false);
|
||||
});
|
||||
CollectDataButton.onClick.AddListener(() =>
|
||||
{
|
||||
CDPage.gameObject.SetActive(true);
|
||||
MSPage.gameObject.SetActive(false);
|
||||
});
|
||||
|
||||
ChartToggle.onValueChanged.AddListener(ison =>
|
||||
{
|
||||
LineChart.gameObject.SetActive(ison);
|
||||
});
|
||||
TableToggle.onValueChanged.AddListener(ison =>
|
||||
{
|
||||
Table.gameObject.SetActive(ison);
|
||||
});
|
||||
|
||||
CloseButton.onClick.AddListener(ClosePage);
|
||||
}
|
||||
|
||||
void ClosePage()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
using XCharts.Runtime;
|
||||
|
||||
/// <summary>
|
||||
/// 计量秤Page
|
||||
/// </summary>
|
||||
public class MeasuringScale : PanelBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 计量秤按钮
|
||||
/// </summary>
|
||||
public CustomGroupButton MeasureScaleButton;
|
||||
/// <summary>
|
||||
/// 采集数据按钮
|
||||
/// </summary>
|
||||
public CustomGroupButton CollectDataButton;
|
||||
|
||||
/// <summary>
|
||||
/// 计量秤页面
|
||||
/// </summary>
|
||||
public RectTransform MSPage;
|
||||
/// <summary>
|
||||
/// 测量数据页面
|
||||
/// </summary>
|
||||
public RectTransform CDPage;
|
||||
|
||||
/// <summary>
|
||||
/// 关闭按钮
|
||||
/// </summary>
|
||||
public Button CloseButton;
|
||||
|
||||
#region 计量秤页面内容
|
||||
|
||||
/// <summary>
|
||||
/// 计量秤名称
|
||||
/// </summary>
|
||||
public TextMeshProUGUI MeasuringScaleName;
|
||||
/// <summary>
|
||||
/// 计量秤编号
|
||||
/// </summary>
|
||||
public TextMeshProUGUI MeasuringScaleNO;
|
||||
/// <summary>
|
||||
/// 型号
|
||||
/// </summary>
|
||||
public TextMeshProUGUI ModelNO;
|
||||
/// <summary>
|
||||
/// 出厂编号
|
||||
/// </summary>
|
||||
public TextMeshProUGUI FactoryNO;
|
||||
/// <summary>
|
||||
/// 生产厂家
|
||||
/// </summary>
|
||||
public TextMeshProUGUI ProduceName;
|
||||
/// <summary>
|
||||
/// 出厂日期
|
||||
/// </summary>
|
||||
public TextMeshProUGUI FactoryDate;
|
||||
|
||||
/// <summary>
|
||||
/// 计量秤编码_实时数据
|
||||
/// </summary>
|
||||
public TextMeshProUGUI MeasuringScaleNO_RealTime;
|
||||
/// <summary>
|
||||
/// 采集时间
|
||||
/// </summary>
|
||||
public TextMeshProUGUI CollectTime;
|
||||
/// <summary>
|
||||
/// 实时累计质量
|
||||
/// </summary>
|
||||
public TextMeshProUGUI RealTimeCumulativeQuality;
|
||||
|
||||
#endregion
|
||||
|
||||
#region 采集数据页面内容
|
||||
|
||||
/// <summary>
|
||||
/// 图形展示
|
||||
/// </summary>
|
||||
public Toggle ChartToggle;
|
||||
/// <summary>
|
||||
/// 表展示
|
||||
/// </summary>
|
||||
public Toggle TableToggle;
|
||||
|
||||
/// <summary>
|
||||
/// 采集数据折线图
|
||||
/// </summary>
|
||||
public LineChart LineChart;
|
||||
/// <summary>
|
||||
/// 采集数据表
|
||||
/// </summary>
|
||||
public RectTransform Table;
|
||||
|
||||
#endregion
|
||||
// Start is called before the first frame update
|
||||
protected override void Start()
|
||||
{
|
||||
MeasureScaleButton.onClick.AddListener(() =>
|
||||
{
|
||||
MSPage.gameObject.SetActive(true);
|
||||
CDPage.gameObject.SetActive(false);
|
||||
});
|
||||
CollectDataButton.onClick.AddListener(() =>
|
||||
{
|
||||
CDPage.gameObject.SetActive(true);
|
||||
MSPage.gameObject.SetActive(false);
|
||||
});
|
||||
|
||||
ChartToggle.onValueChanged.AddListener(ison =>
|
||||
{
|
||||
LineChart.gameObject.SetActive(ison);
|
||||
});
|
||||
TableToggle.onValueChanged.AddListener(ison =>
|
||||
{
|
||||
Table.gameObject.SetActive(ison);
|
||||
});
|
||||
|
||||
CloseButton.onClick.AddListener(HidePanel);
|
||||
}
|
||||
public override void ShowPanel(bool _hide_last_panel = true)
|
||||
{
|
||||
base.ShowPanel(_hide_last_panel);
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
public override void HidePanel()
|
||||
{
|
||||
base.HidePanel();
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using W.UI;
|
||||
|
||||
public class PanelBase : UITool
|
||||
{
|
||||
public PanelBase current_panel;
|
||||
// Start is called before the first frame update
|
||||
protected virtual void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
protected virtual void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 展示面板
|
||||
/// </summary>
|
||||
/// <param name="_hide_last_panel">隐藏上一个面板</param>
|
||||
public virtual void ShowPanel(bool _hide_last_panel = true)
|
||||
{
|
||||
if (_hide_last_panel && current_panel != null && current_panel != this)
|
||||
{
|
||||
current_panel.HidePanel();
|
||||
}
|
||||
current_panel = this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏面板
|
||||
/// </summary>
|
||||
public virtual void HidePanel()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4d7d8bdb0c57ef04997e6a933cb318a3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,40 +1,64 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using W.UI;
|
||||
using TMPro;
|
||||
using ZenFulcrum.EmbeddedBrowser;
|
||||
|
||||
public class VideoWebPage : UITool
|
||||
{
|
||||
/// <summary>
|
||||
/// ÊÓƵÃû³Æ
|
||||
/// </summary>
|
||||
public TextMeshProUGUI VideoName;
|
||||
|
||||
/// <summary>
|
||||
/// ¹Ø±Õ°´Å¥
|
||||
/// </summary>
|
||||
public Button CloseButton;
|
||||
|
||||
/// <summary>
|
||||
/// Ò³Ãæ
|
||||
/// </summary>
|
||||
public Browser WebPage;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
CloseButton.onClick.AddListener(ClosePage);
|
||||
}
|
||||
|
||||
void ClosePage()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void SetWebPage(string url)
|
||||
{
|
||||
WebPage.Url = url;
|
||||
}
|
||||
}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
using ZenFulcrum.EmbeddedBrowser;
|
||||
|
||||
/*
|
||||
*
|
||||
* 相机预览页面:http://服务器IP/shjgcus/Pages/VideoMonitor/RealTimePlayHik.html?id=Camera000100&CobCustomId=3505&EnterpriseCode=CNMAW350015
|
||||
* 说明:以上红色参数依次为T_BAS_CAMERA表中的
|
||||
* id:摄像头ID CameraID
|
||||
* CobCustomId:关区代码 CUSTOMS_CODE
|
||||
* EnterpriseCode:企业系统代码 MONITOR_ID
|
||||
* 服务器IP用启动器传的
|
||||
*/
|
||||
|
||||
public class VideoWebPage : PanelBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 视频名称
|
||||
/// </summary>
|
||||
public TextMeshProUGUI VideoName;
|
||||
|
||||
/// <summary>
|
||||
/// 关闭按钮
|
||||
/// </summary>
|
||||
public Button CloseButton;
|
||||
|
||||
/// <summary>
|
||||
/// 页面
|
||||
/// </summary>
|
||||
public Browser WebPage;
|
||||
|
||||
protected override void Start()
|
||||
{
|
||||
CloseButton.onClick.AddListener(HidePanel);
|
||||
}
|
||||
|
||||
public override void ShowPanel(bool _hide_last_panel = true)
|
||||
{
|
||||
base.ShowPanel(_hide_last_panel);
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public override void HidePanel()
|
||||
{
|
||||
base.HidePanel();
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置网页地址
|
||||
/// </summary>
|
||||
/// <param name="_camera_id">摄像头ID</param>
|
||||
/// <param name="_custom_code">关区代码</param>
|
||||
/// <param name="_monitor_id">企业系统代码</param>
|
||||
public void SetWebPage(string _camera_id, string _custom_code, string _monitor_id)
|
||||
{
|
||||
//拼接视频地址
|
||||
var _url = ApiManager.Instance.ApiDic["VideoWebUrl"].Replace("IP", CallForTest.instance.ServerIP) + "?id=" + _camera_id + "&CobCustomId=" + _custom_code + "&EnterpriseCode=" + _monitor_id;
|
||||
WebPage.Url = _url;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,45 +1,43 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using W.UI;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// 堆场信息表
|
||||
/// </summary>
|
||||
public class YardInformation : UITool
|
||||
{
|
||||
/// <summary>
|
||||
/// 堆场名称
|
||||
/// </summary>
|
||||
public TextMeshProUGUI YardName;
|
||||
/// <summary>
|
||||
/// 堆场面积
|
||||
/// </summary>
|
||||
public TextMeshProUGUI YardArea;
|
||||
|
||||
/// <summary>
|
||||
/// 堆场Item根节点
|
||||
/// </summary>
|
||||
public RectTransform YardItemContent;
|
||||
|
||||
public Button CloseButton;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
CloseButton.onClick.AddListener(ClosePage);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ClosePage()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// 堆场信息表
|
||||
/// </summary>
|
||||
public class YardInformation : PanelBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 堆场名称
|
||||
/// </summary>
|
||||
public TextMeshProUGUI YardName;
|
||||
/// <summary>
|
||||
/// 堆场面积
|
||||
/// </summary>
|
||||
public TextMeshProUGUI YardArea;
|
||||
|
||||
/// <summary>
|
||||
/// 堆场Item根节点
|
||||
/// </summary>
|
||||
public RectTransform YardItemContent;
|
||||
|
||||
public Button CloseButton;
|
||||
|
||||
// Start is called before the first frame update
|
||||
protected override void Start()
|
||||
{
|
||||
CloseButton.onClick.AddListener(HidePanel);
|
||||
}
|
||||
public override void ShowPanel(bool _hide_last_panel = true)
|
||||
{
|
||||
base.ShowPanel(_hide_last_panel);
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
public override void HidePanel()
|
||||
{
|
||||
base.HidePanel();
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
public class Helper : MonoBehaviour
|
||||
|
@ -73,4 +74,33 @@ public class Helper : MonoBehaviour
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
[ContextMenu("重命名")]
|
||||
void ReName()
|
||||
{
|
||||
for (int i = 0; i < transform.childCount; i++)
|
||||
{
|
||||
transform.GetChild(i).name = transform.GetChild(i).name.Insert(transform.GetChild(i).name.Length - 2, "_");
|
||||
}
|
||||
//transform.GetChild(0).name = transform.GetChild(0).name.Insert(transform.GetChild(0).name.Length - 2, "_");
|
||||
}
|
||||
|
||||
[ContextMenu("添加组件")]
|
||||
void AddComponent()
|
||||
{
|
||||
for (int i = 0; i < transform.childCount; i++)
|
||||
{
|
||||
var dev = transform.GetChild(i).GetChild(0).AddComponent<DeviceBase>();
|
||||
dev.DeviceType = DeviceType.CAMERA;
|
||||
}
|
||||
}
|
||||
|
||||
[ContextMenu("重置坐标")]
|
||||
void ResetTransform()
|
||||
{
|
||||
for (int i = 0; i < transform.childCount; i++)
|
||||
{
|
||||
transform.GetChild(i).GetChild(0).transform.position = transform.GetChild(i).GetComponent<Renderer>().bounds.center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"ip": "http://111.229.30.246:30014"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 36ce379c5afc140469a854f89499f92b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -7,5 +7,6 @@
|
|||
"GetWeighterInfo": "/api/Weighter/GetInfo",
|
||||
"GetWeighterList": "/api/Weighter/GetList",
|
||||
"GetWeighterRealTimeData": "/api/Weighter/GetRealTimeData",
|
||||
"PostHistroyData": "/api/Weighter/GetHistroyData"
|
||||
"PostHistroyData": "/api/Weighter/GetHistroyData",
|
||||
"VideoWebUrl": "http://IP/shjgcus/Pages/VideoMonitor/RealTimePlayHik.html"
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"01": "Camera000100",
|
||||
"02": "Camera000101",
|
||||
"03": "Camera000102",
|
||||
"04": "Camera000103",
|
||||
"05": "Camera000104",
|
||||
"06": "Camera000105",
|
||||
"07": "Camera000106",
|
||||
"08": "Camera000107",
|
||||
"09": "",
|
||||
"10": "",
|
||||
"11": "",
|
||||
"12": "",
|
||||
"13": "",
|
||||
"14": "",
|
||||
"15": "",
|
||||
"16": "",
|
||||
"17": "",
|
||||
"18": "",
|
||||
"19": "",
|
||||
"20": "",
|
||||
"21": "",
|
||||
"22": "",
|
||||
"23": "",
|
||||
"24": "",
|
||||
"25": "",
|
||||
"26": ""
|
||||
}
|
Loading…
Reference in New Issue