图标添加,UI逻辑修改
This commit is contained in:
parent
ec305be7cb
commit
97bb77af26
@ -33941,6 +33941,7 @@ Transform:
|
||||
- {fileID: 8723461770243791743}
|
||||
- {fileID: 6261296338349454840}
|
||||
- {fileID: 4145591156296750619}
|
||||
- {fileID: 2554635646079307280}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -38860,3 +38861,113 @@ SphereCollider:
|
||||
serializedVersion: 2
|
||||
m_Radius: 1.5
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &4208561955345259803
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 8829451551789304537}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 6
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 10
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 10
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0.7071068
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0.7071068
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 3.33
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 90
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3000126825845327308, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
objectReference: {fileID: 21300000, guid: b5a68c3e8dd1ff548917e167adcedc24, type: 3}
|
||||
- target: {fileID: 5396330232717131061, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7755407179789064366, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Canvas
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
--- !u!224 &2554635646079307280 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 1807125808574649099, guid: 2198aa810c39f1547a3e2c252636f6b7, type: 3}
|
||||
m_PrefabInstance: {fileID: 4208561955345259803}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
8
xiaofang/Assets/Res/gsj/08_slices/Materials.meta
Normal file
8
xiaofang/Assets/Res/gsj/08_slices/Materials.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d5ef2001182ffd4ead108dda82fbf0e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,80 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: icn_intercom_light_s02
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 2800000, guid: 89c7aeb0ed75e214c8c3fa735b194399, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd64c103168c1a647bf7a010e90995c1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
180
xiaofang/Assets/Res/gsj/Canvas.prefab
Normal file
180
xiaofang/Assets/Res/gsj/Canvas.prefab
Normal file
@ -0,0 +1,180 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &5396330232717131061
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6220582941641101905}
|
||||
- component: {fileID: 7062995027494007406}
|
||||
- component: {fileID: 3000126825845327308}
|
||||
m_Layer: 6
|
||||
m_Name: Image
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6220582941641101905
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5396330232717131061}
|
||||
m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.73}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1807125808574649099}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90}
|
||||
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: 3, y: 4.8}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7062995027494007406
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5396330232717131061}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3000126825845327308
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5396330232717131061}
|
||||
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: 7507f24c4cc7b604cbcc56eb0ed94dd9, 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!1 &7755407179789064366
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1807125808574649099}
|
||||
- component: {fileID: 4767990882302717105}
|
||||
- component: {fileID: 4017801227407201557}
|
||||
- component: {fileID: 4718796657024693748}
|
||||
m_Layer: 6
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1807125808574649099
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7755407179789064366}
|
||||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 6220582941641101905}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 10, y: 10}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!223 &4767990882302717105
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7755407179789064366}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &4017801227407201557
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7755407179789064366}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &4718796657024693748
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7755407179789064366}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
7
xiaofang/Assets/Res/gsj/Canvas.prefab.meta
Normal file
7
xiaofang/Assets/Res/gsj/Canvas.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2198aa810c39f1547a3e2c252636f6b7
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
58
xiaofang/Assets/Res/gsj/GameObject.prefab
Normal file
58
xiaofang/Assets/Res/gsj/GameObject.prefab
Normal file
@ -0,0 +1,58 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &804385547032097059
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 804385547032097061}
|
||||
- component: {fileID: 804385547032097060}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &804385547032097061
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 804385547032097059}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 1006.09503, y: 598.65985, z: -4.566557}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &804385547032097060
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 804385547032097059}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 13fa0701c49727a4c84282a40243e52d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
npcJsonFile: {fileID: 4900000, guid: a854e20393334f04a8fc75e06404fe4f, type: 3}
|
||||
locationJsonFile: {fileID: 4900000, guid: 4d6cd655327e27c4b88c2033169c8fed, type: 3}
|
||||
eventJsonFile: {fileID: 4900000, guid: 2ef075e4830019a42b84d8d05d13d81c, type: 3}
|
||||
matialJsonFile: {fileID: 4900000, guid: d98cb351d1a87dc4887a37106b9745d4, type: 3}
|
||||
sceneJsonFile: {fileID: 4900000, guid: 06c09fd1c8b0a0a45951a1065189d922, type: 3}
|
||||
incidentSiteJosnFile: {fileID: 4900000, guid: 1efa4372b10d4294199638c49173ff4c, type: 3}
|
||||
NPCJosnFile: {fileID: 4900000, guid: 41009f009f0718647a782c7e1aec97dd, type: 3}
|
||||
LanguageJsonFile: {fileID: 4900000, guid: 62a41129c4663ee41a06274114d28feb, type: 3}
|
||||
SelectJsonFile: {fileID: 4900000, guid: 3efd15f4195557144a45659d2baa1ba3, type: 3}
|
||||
TaskJsonFile: {fileID: 4900000, guid: 4dec25769ed4ed3469693b1c881248af, type: 3}
|
||||
GlobalJsonFile: {fileID: 4900000, guid: 27ecc4e37cb448e45a2611c086cdfb90, type: 3}
|
||||
SelectsJsonFile: {fileID: 4900000, guid: 3efd15f4195557144a45659d2baa1ba3, type: 3}
|
7
xiaofang/Assets/Res/gsj/GameObject.prefab.meta
Normal file
7
xiaofang/Assets/Res/gsj/GameObject.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd9f55df9efe9da4ab07a66b12d77d94
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
xiaofang/Assets/Res/gsj/icn_zbjx@3x.png
Normal file
BIN
xiaofang/Assets/Res/gsj/icn_zbjx@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
123
xiaofang/Assets/Res/gsj/icn_zbjx@3x.png.meta
Normal file
123
xiaofang/Assets/Res/gsj/icn_zbjx@3x.png.meta
Normal file
@ -0,0 +1,123 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b29692669dc8dfe42aff682a7858e7f7
|
||||
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: 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:
|
@ -9,9 +9,10 @@ public class Alertwindow : MonoBehaviour
|
||||
private Button cancel;
|
||||
private bool isback=false;
|
||||
public GameObject player; // 模拟的玩家对象
|
||||
public Canvas preDrillPanel; // 演练未开始时的界面布局
|
||||
// 用于“强制下线”延时
|
||||
public float forceOfflineDelay = 3f;
|
||||
private GameObject peopleposition;
|
||||
private List<GameObject> nameImage; // 存储所有角色标签的子物体
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
@ -19,7 +20,19 @@ public class Alertwindow : MonoBehaviour
|
||||
cancel=transform.Find("bg/downbg/GameObject3/Cancel").GetComponent<Button>();
|
||||
sure.onClick.AddListener(OnSureBtn);
|
||||
cancel.onClick.AddListener(OnCancelBtn);
|
||||
|
||||
peopleposition = GameObject.Find("peopleposition").gameObject;
|
||||
//获取所有子物体中的 Button 组件
|
||||
nameImage = new List<GameObject>();
|
||||
foreach (Transform child in peopleposition.transform)
|
||||
{
|
||||
// 查找每个子物体中的"bg"子物体
|
||||
Transform bgTransform = child.Find("nameImage");
|
||||
if (bgTransform != null)
|
||||
{
|
||||
nameImage.Add(bgTransform.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@ -35,6 +48,11 @@ public class Alertwindow : MonoBehaviour
|
||||
isback = true;
|
||||
BoolValueChanged?.Invoke(isback);
|
||||
Game.uiManager.CloseUI("Panel1_2");
|
||||
// 根据Toggle的状态控制所有"nameImage"子物体的显示与隐藏
|
||||
foreach (var bgObject in nameImage)
|
||||
{
|
||||
bgObject.SetActive(isback); // 显示或隐藏
|
||||
}
|
||||
//玩家三秒后强制下线
|
||||
await StopDrillAsync(); // 使用 async/await 执行异步操作
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class Panel2 : MonoBehaviour
|
||||
end = transform.Find("left/btn_enddrill").GetComponent<Button>();
|
||||
end.onClick.AddListener(EndBtn);
|
||||
|
||||
peopleposition = transform.Find("peopleposition").gameObject;
|
||||
peopleposition = GameObject.Find("peopleposition").gameObject;
|
||||
//获取所有子物体中的 Button 组件
|
||||
nameImage = new List<GameObject>();
|
||||
foreach (Transform child in peopleposition.transform)
|
||||
@ -106,7 +106,6 @@ public class Panel2 : MonoBehaviour
|
||||
camera.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
// 启用选中角色的摄像头
|
||||
if (index >= 0 && index < characterCameras.Count)
|
||||
{
|
||||
@ -121,6 +120,5 @@ public class Panel2 : MonoBehaviour
|
||||
{
|
||||
//结束演习
|
||||
Game.uiManager.ShowUI<Image>("PoPhost");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ public class Panel3 : MonoBehaviour
|
||||
private Button follow;//跟随查按钮
|
||||
private Dropdown dropdown;
|
||||
private int optionCount; // 用于存储传入的确定Dropdown选项数量的参数
|
||||
|
||||
private GameObject peopleposition;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
@ -21,6 +21,8 @@ public class Panel3 : MonoBehaviour
|
||||
dropdown=transform.Find("left/Dropdown").GetComponent<Dropdown>();
|
||||
follow = transform.Find("left/Follow").GetComponent<Button>();
|
||||
follow.onClick.AddListener(FollowBtn);
|
||||
peopleposition = GameObject.Find("peopleposition").gameObject;
|
||||
peopleposition.SetActive(false);
|
||||
}
|
||||
// 用于外部传入参数来设置Dropdown选项数量的方法
|
||||
public void SetOptionCount(int count)
|
||||
@ -42,6 +44,7 @@ public class Panel3 : MonoBehaviour
|
||||
}
|
||||
void OnCancelBtn()
|
||||
{
|
||||
peopleposition.gameObject.SetActive(true);
|
||||
//返回上帝视角界面
|
||||
Game.uiManager.ShowUI<Image>("Panel1_2");
|
||||
Game.uiManager.CloseUI("Panel1_3");
|
||||
|
@ -4,6 +4,7 @@ using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Unity.VisualScripting;
|
||||
public class Starthost : MonoBehaviour
|
||||
{
|
||||
private GameObject panel;
|
||||
@ -24,8 +25,11 @@ public class Starthost : MonoBehaviour
|
||||
private Panel2 GetPanel2;
|
||||
public Alertwindow alertwindow;
|
||||
private bool isButtonClicked = false; // 监听的变量
|
||||
//private Button[] buttons; // 所有子物体上的 Button 组件
|
||||
//private GameObject peopleposition;
|
||||
private GameObject peopleposition;//人员的位置信息
|
||||
//非主持人的画面
|
||||
public bool ishost=false;
|
||||
private Button ready;
|
||||
private Image image;
|
||||
void Start()
|
||||
{
|
||||
panel = transform.Find("Panel1").gameObject;
|
||||
@ -40,10 +44,25 @@ public class Starthost : MonoBehaviour
|
||||
rectTransform = time.GetComponent<RectTransform>();
|
||||
canvas = time.GetComponentInParent<Canvas>();
|
||||
time.gameObject.SetActive(false);
|
||||
//peopleposition = transform.Find("peopleposition").gameObject;
|
||||
// 获取所有子物体中的 Button 组件
|
||||
//buttons =transform.Find("peopleposition").GetComponentsInChildren<Button>();
|
||||
//peopleposition.SetActive(false);
|
||||
peopleposition = GameObject.Find("peopleposition").gameObject;
|
||||
|
||||
ready = transform.Find("Panel1/right/under/Ready").GetComponent<Button>();
|
||||
image= transform.Find("Panel1/right/under/Image").GetComponent<Image>();
|
||||
ready.gameObject.SetActive(false);
|
||||
image.gameObject.SetActive(false);
|
||||
if (!ishost)
|
||||
{
|
||||
ready.gameObject.SetActive(true);
|
||||
posiBtn.gameObject.SetActive(false);
|
||||
start.gameObject.SetActive(false);
|
||||
ready.onClick.AddListener(OnReadyBtn);
|
||||
}
|
||||
else
|
||||
{
|
||||
ready.gameObject.SetActive(false);
|
||||
posiBtn.gameObject.SetActive(true);
|
||||
start.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
void OnEnable()
|
||||
{
|
||||
@ -87,6 +106,12 @@ public class Starthost : MonoBehaviour
|
||||
StopTimer();
|
||||
rectTransform.localScale = new Vector3(1,1,1);
|
||||
}
|
||||
|
||||
}
|
||||
void OnReadyBtn()
|
||||
{
|
||||
image.gameObject.SetActive(true);
|
||||
ready.gameObject.SetActive(false);
|
||||
}
|
||||
// 停止计时并重置时间显示的方法
|
||||
public void StopTimer()
|
||||
|
376
xiaofang/Assets/Res/gsj/scripts/UseObjects.cs
Normal file
376
xiaofang/Assets/Res/gsj/scripts/UseObjects.cs
Normal file
@ -0,0 +1,376 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UseObjects : MonoBehaviour
|
||||
{
|
||||
private Transform parentObject; // 父物体(包含所有子物体)
|
||||
private GameObject player;//玩家
|
||||
public JSONReader js;
|
||||
//警戒物品使用
|
||||
public GameObject warningPrefab; // 警戒锥道具模型
|
||||
public GameObject polePrefab; // 警戒杆道具模型
|
||||
public GameObject tapePrefab; // 隔离警示带模型
|
||||
public float maxDistance = 10f; // 最大直接距离10米
|
||||
public bool hasTape = false; // 是否携带隔离警示带
|
||||
private List<GameObject> warningObjects = new List<GameObject>(); // 存储所有警戒类道具
|
||||
//物品交付
|
||||
public List<GameObject> potentialTargets; // 所有可能成为交付对象的目标列表
|
||||
public Button deliverButton; // 交付按钮
|
||||
public float deliveryRange = 1f; // 交付范围半径
|
||||
private GameObject currentTarget; // 当前最近的交付目标
|
||||
private bool islogistics;//角色是否为后勤保障组;
|
||||
private bool isdelivery;//是否开启交付
|
||||
[System.Serializable]
|
||||
public class EmergencyItem
|
||||
{
|
||||
public string itemName; // 道具名称
|
||||
public bool isConsumable; // 是否消耗品 (1=是,0=否)
|
||||
public int validTime; // 有效时间:-1(无限),0 或正数(有限时间)
|
||||
}
|
||||
|
||||
// 模拟物品的字段配置
|
||||
public Dictionary<string, EmergencyItem> itemConfigs = new Dictionary<string, EmergencyItem>();
|
||||
|
||||
void Start()
|
||||
{
|
||||
parentObject = GameObject.Find("fireEquip").transform;
|
||||
player=GameObject.FindGameObjectWithTag("Player");
|
||||
// 初始化模拟物品数据
|
||||
InitializeItemConfigs(3001);
|
||||
// 隐藏交付按钮
|
||||
deliverButton.gameObject.SetActive(false);
|
||||
deliverButton.onClick.AddListener(HandleDelivery);
|
||||
|
||||
// 为每个子物体添加点击事件
|
||||
foreach (Transform child in parentObject)
|
||||
{
|
||||
Button childButton = child.GetComponent<Button>();
|
||||
if (childButton == null)
|
||||
{
|
||||
Debug.LogWarning($"子物体 {child.name} 缺少 Button 组件!");
|
||||
continue;
|
||||
}
|
||||
// 初始化子物体状态
|
||||
Transform buttonPanel = child.Find("informationImage");
|
||||
Transform highlight = child.Find("Image");
|
||||
if (buttonPanel != null) buttonPanel.gameObject.SetActive(false);
|
||||
if (highlight != null) highlight.gameObject.SetActive(false);
|
||||
|
||||
// 绑定点击事件
|
||||
childButton.onClick.AddListener(() => OnChildClicked(child.gameObject));
|
||||
}
|
||||
UseCautionaryitems(player.transform.position, polePrefab);
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
// 在范围内查找最近的交付目标
|
||||
currentTarget = FindNearestTarget();
|
||||
if (currentTarget != null)
|
||||
{
|
||||
// 显示交付按钮并高亮目标
|
||||
HighlightTarget(currentTarget, true);
|
||||
deliverButton.gameObject.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 隐藏交付按钮并取消高亮
|
||||
if (currentTarget != null)
|
||||
{
|
||||
HighlightTarget(currentTarget, false);
|
||||
}
|
||||
deliverButton.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
// 初始化模拟物品数据
|
||||
void InitializeItemConfigs(int id)
|
||||
{
|
||||
itemConfigs.Add("1", new EmergencyItem { itemName = "1", isConsumable = true, validTime = -1 });
|
||||
itemConfigs.Add("2", new EmergencyItem { itemName = "2", isConsumable = true, validTime = 30 });
|
||||
itemConfigs.Add("3", new EmergencyItem { itemName = "3", isConsumable = false, validTime = 15 });
|
||||
|
||||
itemConfigs.Add("4", new EmergencyItem { itemName = "4", isConsumable = true, validTime = -1 });
|
||||
itemConfigs.Add("5", new EmergencyItem { itemName = "5", isConsumable = true, validTime = 30 });
|
||||
itemConfigs.Add("6", new EmergencyItem { itemName = "6", isConsumable = false, validTime = 15 });
|
||||
// 添加更多物品配置...
|
||||
foreach (var key in js.matialDictionary)
|
||||
{
|
||||
MatialData matialData = key.Value;
|
||||
if (matialData.ID==id)
|
||||
{
|
||||
//获取物品数据
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 当子物体被点击时
|
||||
void OnChildClicked(GameObject clickedChild)
|
||||
{
|
||||
// 隐藏其他子物体的按钮板和高光框
|
||||
foreach (Transform child in parentObject)
|
||||
{
|
||||
Transform buttonPanel = child.Find("informationImage");
|
||||
Transform highlight = child.Find("Image");
|
||||
if (buttonPanel != null) buttonPanel.gameObject.SetActive(false);
|
||||
if (highlight != null) highlight.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
// 获取当前点击的子物体名称
|
||||
string itemName = clickedChild.name;
|
||||
Debug.Log(itemName);
|
||||
if (!itemConfigs.ContainsKey(itemName))
|
||||
{
|
||||
Debug.LogWarning($"未找到物品 {itemName} 的配置!");
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据配置判断显示按钮
|
||||
EmergencyItem item = itemConfigs[itemName];
|
||||
Transform clickedButtonPanel = clickedChild.transform.Find("informationImage");
|
||||
Transform clickedHighlight = clickedChild.transform.Find("Image");
|
||||
|
||||
if (clickedButtonPanel != null)
|
||||
{
|
||||
//clickedButtonPanel.gameObject.SetActive(true);
|
||||
// 显示对应的按钮
|
||||
UpdateButtonPanel(clickedButtonPanel, item);
|
||||
|
||||
}
|
||||
|
||||
// 显示当前子物体的高光框
|
||||
if (clickedHighlight != null)
|
||||
{
|
||||
clickedHighlight.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
// 根据物品配置更新按钮面板
|
||||
void UpdateButtonPanel(Transform buttonPanel, EmergencyItem item)
|
||||
{
|
||||
// 获取按钮
|
||||
Button viewButton = buttonPanel.Find("LookButton").GetComponent<Button>();
|
||||
Button useButton = buttonPanel.Find("UseButton").GetComponent<Button>();
|
||||
Button discardButton = buttonPanel.Find("ThrowButton").GetComponent<Button>();
|
||||
|
||||
// 按规则显示或隐藏按钮
|
||||
if (item.isConsumable && item.validTime == -1)
|
||||
{
|
||||
// 规则1:直接使用,不弹出按钮
|
||||
buttonPanel.gameObject.SetActive(false);
|
||||
UseItem(item);
|
||||
}
|
||||
else if (item.isConsumable && item.validTime >= 0)
|
||||
{
|
||||
buttonPanel.gameObject.SetActive(true);
|
||||
// 规则2:弹出【查看】【使用】【丢弃】
|
||||
viewButton.gameObject.SetActive(true);
|
||||
useButton.gameObject.SetActive(true);
|
||||
discardButton.gameObject.SetActive(true);
|
||||
|
||||
// 绑定事件
|
||||
viewButton.onClick.AddListener(() => ViewItem(item));
|
||||
useButton.onClick.AddListener(() => UseItem(item));
|
||||
discardButton.onClick.AddListener(() => DiscardItem(item));
|
||||
}
|
||||
else if (!item.isConsumable && item.validTime >= 0)
|
||||
{
|
||||
buttonPanel.gameObject.SetActive(true);
|
||||
// 规则3:弹出【查看】【丢弃】
|
||||
viewButton.gameObject.SetActive(true);
|
||||
useButton.gameObject.SetActive(false);
|
||||
discardButton.gameObject.SetActive(true);
|
||||
|
||||
// 绑定事件
|
||||
viewButton.onClick.AddListener(() => ViewItem(item));
|
||||
discardButton.onClick.AddListener(() => DiscardItem(item));
|
||||
}
|
||||
}
|
||||
|
||||
// 查看物品逻辑
|
||||
void ViewItem(EmergencyItem item)
|
||||
{
|
||||
Debug.Log($"查看物品:{item.itemName}");
|
||||
}
|
||||
|
||||
// 使用物品逻辑
|
||||
void UseItem(EmergencyItem item)
|
||||
{
|
||||
Debug.Log($"使用物品:{item.itemName}");
|
||||
}
|
||||
|
||||
// 丢弃物品逻辑
|
||||
void DiscardItem(EmergencyItem item)
|
||||
{
|
||||
Debug.Log($"丢弃物品:{item.itemName}");
|
||||
}
|
||||
//使用警戒物品
|
||||
void UseCautionaryitems(Vector3 playerPosition,GameObject gameObject)
|
||||
{
|
||||
// 生成警戒类道具(警戒杆,警戒锥)
|
||||
GameObject newWarning = Instantiate(gameObject, playerPosition, Quaternion.identity);
|
||||
warningObjects.Add(newWarning);
|
||||
|
||||
// 判断当前位置是否距离其他警戒类道具10米以内
|
||||
GameObject nearestWarning = FindNearestWarning(newWarning);
|
||||
if (nearestWarning != null)
|
||||
{
|
||||
if (hasTape)
|
||||
{
|
||||
// 如果携带隔离警示带,连接到最近的警戒类道具
|
||||
CreateTape(newWarning, nearestWarning);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 不携带隔离警示带,无连接显示,但有效性记录
|
||||
Debug.Log("未携带隔离警示带,未连接警戒道具!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("当前位置周围10米范围内没有其他警戒类道具!");
|
||||
}
|
||||
}
|
||||
// 找到距离最近的警戒类道具
|
||||
private GameObject FindNearestWarning(GameObject currentWarning)
|
||||
{
|
||||
GameObject nearest = null;
|
||||
float minDistance = maxDistance;
|
||||
|
||||
foreach (GameObject warning in warningObjects)
|
||||
{
|
||||
if (warning == currentWarning) continue; // 跳过当前道具
|
||||
|
||||
float distance = Vector3.Distance(currentWarning.transform.position, warning.transform.position);
|
||||
if (distance < minDistance)
|
||||
{
|
||||
minDistance = distance;
|
||||
nearest = warning;
|
||||
}
|
||||
}
|
||||
return nearest;
|
||||
}
|
||||
|
||||
// 生成隔离警示带
|
||||
private void CreateTape(GameObject start, GameObject end)
|
||||
{
|
||||
// 生成隔离警示带
|
||||
GameObject tape = Instantiate(tapePrefab);
|
||||
|
||||
// 设置隔离警示带的起点和终点
|
||||
LineRenderer lineRenderer = tape.GetComponent<LineRenderer>();
|
||||
if (lineRenderer != null)
|
||||
{
|
||||
lineRenderer.positionCount = 2;
|
||||
lineRenderer.SetPosition(0, start.transform.position);
|
||||
lineRenderer.SetPosition(1, end.transform.position);
|
||||
}
|
||||
|
||||
Debug.Log($"已连接警戒类道具:{start.name} -> {end.name}");
|
||||
}
|
||||
// 交付逻辑中查找范围内最近的目标
|
||||
GameObject FindNearestTarget()
|
||||
{
|
||||
GameObject nearestTarget = null;
|
||||
float nearestDistance = deliveryRange;
|
||||
|
||||
foreach (var target in potentialTargets)
|
||||
{
|
||||
float distance = Vector3.Distance(player.transform.position, target.transform.position);
|
||||
if (distance <= deliveryRange && IsInFront(target))
|
||||
{
|
||||
nearestTarget = target;
|
||||
nearestDistance = distance;
|
||||
}
|
||||
}
|
||||
return nearestTarget;
|
||||
}
|
||||
// 判断目标是否在角色正面 180 度内
|
||||
bool IsInFront(GameObject target)
|
||||
{
|
||||
Vector3 directionToTarget = (target.transform.position - player.transform.position).normalized;
|
||||
float dotProduct = Vector3.Dot(player.transform.forward, directionToTarget);
|
||||
return dotProduct > 0; // 在正面 180 度内
|
||||
}
|
||||
// 高亮目标(例如显示边缘发光效果)
|
||||
void HighlightTarget(GameObject target, bool highlight)
|
||||
{
|
||||
Renderer renderer = target.GetComponent<Renderer>();
|
||||
if (renderer != null)
|
||||
{
|
||||
// 设置高亮效果,比如更改材质或颜色
|
||||
renderer.material.SetColor("_EmissionColor", highlight ? Color.green : Color.black);
|
||||
}
|
||||
}
|
||||
// 处理交付逻辑
|
||||
void HandleDelivery()
|
||||
{
|
||||
if (currentTarget == null)
|
||||
{
|
||||
Debug.LogWarning("没有可交付的目标!");
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查目标职业是否符合条件
|
||||
TargetData targetData = currentTarget.GetComponent<TargetData>();
|
||||
if (targetData == null || targetData.weightCapacity == -1)
|
||||
{
|
||||
Debug.LogWarning("目标不满足交付条件!");
|
||||
return;
|
||||
}
|
||||
|
||||
// 执行交付逻辑:减少玩家道具数量,增加目标道具数量
|
||||
PlayerInventory playerInventory = player.GetComponent<PlayerInventory>();
|
||||
if (playerInventory != null && playerInventory.UseItem("SelectedItem"))
|
||||
{
|
||||
targetData.ReceiveItem("SelectedItem");
|
||||
Debug.Log($"成功交付道具给目标:{currentTarget.name}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("玩家道具不足,无法交付!");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 目标数据类
|
||||
public class TargetData : MonoBehaviour
|
||||
{
|
||||
public int weightCapacity = 10; // 负重能力值
|
||||
private Dictionary<string, int> receivedItems = new Dictionary<string, int>();
|
||||
|
||||
public void ReceiveItem(string itemName)
|
||||
{
|
||||
if (receivedItems.ContainsKey(itemName))
|
||||
{
|
||||
receivedItems[itemName]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
receivedItems[itemName] = 1;
|
||||
}
|
||||
Debug.Log($"{itemName} 接收成功,当前数量:{receivedItems[itemName]}");
|
||||
}
|
||||
}
|
||||
|
||||
// 玩家道具管理类
|
||||
public class PlayerInventory : MonoBehaviour
|
||||
{
|
||||
private Dictionary<string, int> items = new Dictionary<string, int>
|
||||
{
|
||||
{ "SelectedItem", 5 } // 模拟玩家的道具库存
|
||||
};
|
||||
|
||||
public bool UseItem(string itemName)
|
||||
{
|
||||
if (items.ContainsKey(itemName) && items[itemName] > 0)
|
||||
{
|
||||
items[itemName]--;
|
||||
Debug.Log($"{itemName} 使用成功,剩余数量:{items[itemName]}");
|
||||
return true;
|
||||
}
|
||||
Debug.LogWarning($"{itemName} 使用失败,库存不足!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
11
xiaofang/Assets/Res/gsj/scripts/UseObjects.cs.meta
Normal file
11
xiaofang/Assets/Res/gsj/scripts/UseObjects.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 120374d73db9175439dffcbaf8d0efb0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
xiaofang/Assets/Res/host_01/Materials.meta
Normal file
8
xiaofang/Assets/Res/host_01/Materials.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b691da09a118ce94db5bf5085aa79dd0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
80
xiaofang/Assets/Res/host_01/Materials/icn_firehydrant@2x.mat
Normal file
80
xiaofang/Assets/Res/host_01/Materials/icn_firehydrant@2x.mat
Normal file
@ -0,0 +1,80 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: icn_firehydrant@2x
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 2800000, guid: 7507f24c4cc7b604cbcc56eb0ed94dd9, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6fcdb5ee4b716e49ae81b685d9b2aaf
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
1940
xiaofang/Assets/Resources/gsjUI/peopleposition.prefab
Normal file
1940
xiaofang/Assets/Resources/gsjUI/peopleposition.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca1bba5f2257eb9479c0f8bcff0e3af5
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -2856,6 +2856,11 @@ MonoBehaviour:
|
||||
isScheduled: 0
|
||||
isadministrator: 0
|
||||
drill: {fileID: 0}
|
||||
RoomId:
|
||||
status:
|
||||
TemplateId:
|
||||
SceneId:
|
||||
SubjectId:
|
||||
--- !u!1 &506495862
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -6800,6 +6805,11 @@ MonoBehaviour:
|
||||
isScheduled: 0
|
||||
isadministrator: 0
|
||||
drill: {fileID: 0}
|
||||
RoomId:
|
||||
status:
|
||||
TemplateId:
|
||||
SceneId:
|
||||
SubjectId:
|
||||
--- !u!1 &1027828871
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -8323,6 +8333,11 @@ MonoBehaviour:
|
||||
isScheduled: 0
|
||||
isadministrator: 0
|
||||
drill: {fileID: 0}
|
||||
RoomId:
|
||||
status:
|
||||
TemplateId:
|
||||
SceneId:
|
||||
SubjectId:
|
||||
--- !u!1 &1230287495
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -9477,10 +9492,10 @@ RectTransform:
|
||||
m_Father: {fileID: 809548982}
|
||||
m_RootOrder: 0
|
||||
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_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 285.6966, y: -138.3536}
|
||||
m_SizeDelta: {x: 571.3932, y: 276.7072}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1378049913
|
||||
MonoBehaviour:
|
||||
@ -9544,6 +9559,11 @@ MonoBehaviour:
|
||||
isScheduled: 0
|
||||
isadministrator: 0
|
||||
drill: {fileID: 0}
|
||||
RoomId:
|
||||
status:
|
||||
TemplateId:
|
||||
SceneId:
|
||||
SubjectId:
|
||||
--- !u!1 &1408016434
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -9580,10 +9600,10 @@ RectTransform:
|
||||
m_Father: {fileID: 809548982}
|
||||
m_RootOrder: 2
|
||||
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_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 1464.4829, y: -138.3536}
|
||||
m_SizeDelta: {x: 571.3932, y: 276.7072}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1408016436
|
||||
MonoBehaviour:
|
||||
@ -9603,6 +9623,11 @@ MonoBehaviour:
|
||||
isScheduled: 0
|
||||
isadministrator: 0
|
||||
drill: {fileID: 0}
|
||||
RoomId:
|
||||
status:
|
||||
TemplateId:
|
||||
SceneId:
|
||||
SubjectId:
|
||||
--- !u!114 &1408016437
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -12495,6 +12520,11 @@ MonoBehaviour:
|
||||
isScheduled: 0
|
||||
isadministrator: 0
|
||||
drill: {fileID: 0}
|
||||
RoomId:
|
||||
status:
|
||||
TemplateId:
|
||||
SceneId:
|
||||
SubjectId:
|
||||
--- !u!1 &1761055391
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -12920,10 +12950,10 @@ RectTransform:
|
||||
m_Father: {fileID: 809548982}
|
||||
m_RootOrder: 1
|
||||
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_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 875.0898, y: -138.3536}
|
||||
m_SizeDelta: {x: 571.3932, y: 276.7072}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1832855453
|
||||
MonoBehaviour:
|
||||
@ -12987,6 +13017,11 @@ MonoBehaviour:
|
||||
isScheduled: 0
|
||||
isadministrator: 0
|
||||
drill: {fileID: 0}
|
||||
RoomId:
|
||||
status:
|
||||
TemplateId:
|
||||
SceneId:
|
||||
SubjectId:
|
||||
--- !u!1 &1836449004
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -14482,6 +14517,11 @@ MonoBehaviour:
|
||||
isScheduled: 0
|
||||
isadministrator: 0
|
||||
drill: {fileID: 0}
|
||||
RoomId:
|
||||
status:
|
||||
TemplateId:
|
||||
SceneId:
|
||||
SubjectId:
|
||||
--- !u!1 &2031686408
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -14585,6 +14625,11 @@ MonoBehaviour:
|
||||
isScheduled: 0
|
||||
isadministrator: 0
|
||||
drill: {fileID: 0}
|
||||
RoomId:
|
||||
status:
|
||||
TemplateId:
|
||||
SceneId:
|
||||
SubjectId:
|
||||
--- !u!1 &2046454016
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
Loading…
Reference in New Issue
Block a user