背包模块UI和数据部分
This commit is contained in:
parent
c140c0fd5d
commit
1830d9dc02
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
|
@ -0,0 +1,159 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6346632192b53b04d8a62f4e07d4aeb0
|
||||
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: 0
|
||||
aniso: 2
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
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: 1
|
||||
applyGammaDecoding: 0
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 8192
|
||||
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: 8192
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 8192
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 8192
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Windows Store Apps
|
||||
maxTextureSize: 8192
|
||||
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: 8192
|
||||
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:
|
|
@ -1,6 +1,6 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7924161949258944695
|
||||
--- !u!1 &4239231589677207246
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
|
@ -8,9 +8,9 @@ GameObject:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7924161949258944694}
|
||||
- component: {fileID: 7924161949258944712}
|
||||
- component: {fileID: 7924161949258944713}
|
||||
- component: {fileID: 4239231589677207247}
|
||||
- component: {fileID: 4239231589677207217}
|
||||
- component: {fileID: 4239231589677207216}
|
||||
m_Layer: 5
|
||||
m_Name: ToolAndMeterialItem
|
||||
m_TagString: Untagged
|
||||
|
@ -18,18 +18,20 @@ GameObject:
|
|||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7924161949258944694
|
||||
--- !u!224 &4239231589677207247
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7924161949258944695}
|
||||
m_GameObject: {fileID: 4239231589677207246}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 1103842610257818206}
|
||||
- {fileID: 8215525817944585444}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
@ -38,21 +40,21 @@ RectTransform:
|
|||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7924161949258944712
|
||||
--- !u!222 &4239231589677207217
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7924161949258944695}
|
||||
m_GameObject: {fileID: 4239231589677207246}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7924161949258944713
|
||||
--- !u!114 &4239231589677207216
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7924161949258944695}
|
||||
m_GameObject: {fileID: 4239231589677207246}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
|
@ -76,3 +78,204 @@ MonoBehaviour:
|
|||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &4372117883866901743
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1103842610257818206}
|
||||
- component: {fileID: 4678192074515838294}
|
||||
- component: {fileID: 3534060011449287153}
|
||||
m_Layer: 5
|
||||
m_Name: countText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1103842610257818206
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4372117883866901743}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4239231589677207247}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: -10.9, y: 10.5}
|
||||
m_SizeDelta: {x: 20, y: 20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4678192074515838294
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4372117883866901743}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3534060011449287153
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4372117883866901743}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 11
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text:
|
||||
--- !u!1 &7609248286363545378
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8215525817944585444}
|
||||
- component: {fileID: 7822759280540398470}
|
||||
- component: {fileID: 8247131394908315687}
|
||||
- component: {fileID: 9144319166100695387}
|
||||
m_Layer: 5
|
||||
m_Name: deleteBtn
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8215525817944585444
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7609248286363545378}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4239231589677207247}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -10, y: -9.3}
|
||||
m_SizeDelta: {x: 15, y: 15}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7822759280540398470
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7609248286363545378}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8247131394908315687
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7609248286363545378}
|
||||
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: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
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 &9144319166100695387
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7609248286363545378}
|
||||
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: 8247131394908315687}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
|
|
|
@ -439,6 +439,18 @@ PrefabInstance:
|
|||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 664557115506198354, guid: c589cfa8e2c0c004ca8727f8a9546ace, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 664557115506198354, guid: c589cfa8e2c0c004ca8727f8a9546ace, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 664557115506198354, guid: c589cfa8e2c0c004ca8727f8a9546ace, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 781378853607839230, guid: c589cfa8e2c0c004ca8727f8a9546ace, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
public class TB_ToolAndMaterial
|
||||
{
|
||||
public int id;
|
||||
public int systemID;
|
||||
public string objName;
|
||||
public int type;
|
||||
public string prefabName;
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ToolAndMaterialData
|
||||
{
|
||||
public string objName;
|
||||
public int type;
|
||||
public uint count;
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ccf50554da1943a4d8cf8227c01f3097
|
||||
guid: 1312760d4ad36494eae81349ddf0e86d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
|
@ -47,7 +47,6 @@ public class DataManager : BaseManager<DataManager>
|
|||
/// </summary>
|
||||
private Dictionary<int, TB_ToolAndMaterial> toolAndMaterialDic = new Dictionary<int, TB_ToolAndMaterial>();
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化
|
||||
|
@ -67,6 +66,7 @@ public class DataManager : BaseManager<DataManager>
|
|||
{
|
||||
return deviceTypeDic;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前系统所有的方案
|
||||
/// </summary>
|
||||
|
@ -76,12 +76,31 @@ public class DataManager : BaseManager<DataManager>
|
|||
var allSchemeList = new List<TB_Scheme>();
|
||||
foreach (var item in schemeDic.Values)
|
||||
{
|
||||
if (item.systemId==GameManager.ProcessMgr.id)
|
||||
if (item.systemId == GameManager.ProcessMgr.id)
|
||||
allSchemeList.Add(item);
|
||||
}
|
||||
|
||||
return allSchemeList;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前系统全部工器具和材料
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<TB_ToolAndMaterial> GetCurrentSystemToolAndMaterials()
|
||||
{
|
||||
var currentSystemToolAndMaterials = new List<TB_ToolAndMaterial>();
|
||||
foreach (var item in toolAndMaterialDic.Values)
|
||||
{
|
||||
if (item.systemID == GameManager.ProcessMgr.id)
|
||||
{
|
||||
currentSystemToolAndMaterials.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
return currentSystemToolAndMaterials;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取D_Scheme
|
||||
/// </summary>
|
||||
|
|
|
@ -119,7 +119,10 @@ public class GameManager : SingletonAutoMono<GameManager>
|
|||
ReportMgr = ReportManager.Instance;
|
||||
HandsOnTrainingMgr = HandsOnTrainingMgr.Instance;
|
||||
RunModelMgr = RunModelMgr.Instance;
|
||||
ToolAndmaterialMgr = ToolAndmaterialMgr.Instance;
|
||||
PacksackBagMgr = PacksackBagMgr.Instance;
|
||||
DataMgr.Init();
|
||||
ToolAndmaterialMgr.Init();
|
||||
InitData();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,60 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 负责工具材料包管理
|
||||
/// </summary>
|
||||
public class PacksackBagMgr : BaseManager<PacksackBagMgr>
|
||||
{
|
||||
//包里用了哪些工器具
|
||||
private readonly Dictionary<string, ToolAndMaterialData> toolAndMaterialDic =
|
||||
new Dictionary<string, ToolAndMaterialData>();
|
||||
|
||||
private PacksackBagMgr()
|
||||
{
|
||||
}
|
||||
|
||||
public Dictionary<string, ToolAndMaterialData> GetCurrentBagData()
|
||||
{
|
||||
return toolAndMaterialDic;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加一个工器具或材料
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
public void AddOneToolOrMater(string name)
|
||||
{
|
||||
if (toolAndMaterialDic.ContainsKey(name))
|
||||
{
|
||||
toolAndMaterialDic[name].count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
//从配置里得知是tool or Material
|
||||
var tempToolOrMaterType = GameManager.ToolAndmaterialMgr.GetObjType(name);
|
||||
if (tempToolOrMaterType == -1) return;
|
||||
var tempToolAndMaterData = new ToolAndMaterialData()
|
||||
{ count = 1, objName = name, type = tempToolOrMaterType };
|
||||
toolAndMaterialDic.Add(name, tempToolAndMaterData);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除一个工器具或材料
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
public void RemoveOneToolOrMater(string name)
|
||||
{
|
||||
if (toolAndMaterialDic.ContainsKey(name))
|
||||
{
|
||||
var toolAndMaterCount = toolAndMaterialDic[name].count--;
|
||||
if (toolAndMaterCount <= 0)
|
||||
{
|
||||
toolAndMaterialDic.Remove(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,48 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 正在使用的工具/材料管理类
|
||||
/// </summary>
|
||||
public class ToolAndmaterialMgr : BaseManager<ToolAndmaterialMgr>
|
||||
{
|
||||
|
||||
}
|
||||
//该系统所需要使用的全部工器具和材料
|
||||
|
||||
public List<TB_ToolAndMaterial> toolAndMaterialList;
|
||||
|
||||
private ToolAndmaterialMgr()
|
||||
{
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
toolAndMaterialList = GameManager.DataMgr.GetCurrentSystemToolAndMaterials();
|
||||
}
|
||||
|
||||
public string GetIconSpriteName(string objName)
|
||||
{
|
||||
var tempObj= toolAndMaterialList.Find(o => o.objName == objName);
|
||||
if (tempObj!=null)
|
||||
{
|
||||
return tempObj.iconSpriteName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public int GetObjType(string objName)
|
||||
{
|
||||
var tempObj= toolAndMaterialList.Find(o => o.objName == objName);
|
||||
if (tempObj!=null)
|
||||
{
|
||||
return tempObj.type;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UI_DeviceItem : BaseItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备Id
|
||||
/// </summary>
|
||||
public int deviceId;
|
||||
|
||||
protected override void OnClick(string btnName)
|
||||
{
|
||||
switch (btnName)
|
||||
{
|
||||
case "Button_Device":
|
||||
GameManager.RunModelMgr.deviceId = deviceId;
|
||||
GameManager.UIMgr.ShowPanel<UI_LoadingPanel>(E_UI_Layer.System, (panel) =>
|
||||
{
|
||||
panel.Init();
|
||||
GameManager.EventMgr.EventTrigger<float>(Enum_EventType.UpdateProgress, 0.1f);
|
||||
GameManager.ScenesMgr.LoadSceneAsyn("03_OfficeScene", () =>
|
||||
{
|
||||
GameManager.EventMgr.EventTrigger<float>(Enum_EventType.UpdateProgress, 0.4f);
|
||||
GameManager.UIMgr.ShowPanel<UI_MainTitlePanel>(E_UI_Layer.Mid, (panel) =>
|
||||
{
|
||||
panel.Init();
|
||||
GameManager.EventMgr.EventTrigger<float>(Enum_EventType.UpdateProgress, 0.5f);
|
||||
GameManager.UIMgr.HidePanel<UI_SelectDevicePanel>();
|
||||
});
|
||||
});
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
@ -85,4 +86,15 @@ public class UI_MainTitlePanel : BasePanel
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[Button]
|
||||
public void Test1()
|
||||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_ToolAndMaterialPanel>();
|
||||
}
|
||||
[Button]
|
||||
public void Test2()
|
||||
{
|
||||
GameManager.PacksackBagMgr.AddOneToolOrMater("万用表");
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using Sirenix.OdinInspector;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
@ -44,16 +43,16 @@ public class UI_SelectDevicePanel : BasePanel
|
|||
//按钮的父节点是标题的父节点content
|
||||
deviceItemBtn.transform.parent = titleItem.transform.parent;
|
||||
deviceItemBtn.GetComponentInChildren<TextMeshProUGUI>().text = x.schemeName;
|
||||
|
||||
var deviceBtnAComponent = deviceItemBtn.GetComponent<Button>();
|
||||
deviceItemBtn.name = x.id.ToString();
|
||||
AddEventForDeviceBtn(deviceBtnAComponent, x.deviceMap);
|
||||
AddEventForDeviceBtn(deviceBtnAComponent, x.deviceMap, x.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AddEventForDeviceBtn(Button deviceBtnAComponent, string mapName)
|
||||
private void AddEventForDeviceBtn(Button deviceBtnAComponent, string mapName,int schemeID)
|
||||
{
|
||||
GameManager.UIMgr.AddEventTriggerListener(deviceBtnAComponent, EventTriggerType.PointerEnter,
|
||||
_ =>
|
||||
|
@ -71,14 +70,11 @@ public class UI_SelectDevicePanel : BasePanel
|
|||
});
|
||||
deviceBtnAComponent.onClick.AddListener(() =>
|
||||
{
|
||||
GameManager.RunModelMgr.deviceId = int.Parse(deviceBtnAComponent.name);
|
||||
GameManager.RunModelMgr.deviceId = schemeID;
|
||||
GameManager.UIMgr.ShowPanel<UI_LoadingPanel>(E_UI_Layer.System, (panel) =>
|
||||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_MainTitlePanel>(E_UI_Layer.Bot, (panel) =>
|
||||
{
|
||||
panel.Init();
|
||||
});
|
||||
|
||||
GameManager.UIMgr.ShowPanel<UI_MainTitlePanel>(E_UI_Layer.Bot, (panel) => { panel.Init(); });
|
||||
|
||||
panel.Init();
|
||||
GameManager.EventMgr.EventTrigger<float>(Enum_EventType.UpdateProgress, 0.1f);
|
||||
GameManager.ScenesMgr.LoadSceneAsyn("03_OfficeScene", () =>
|
||||
|
@ -103,15 +99,5 @@ public class UI_SelectDevicePanel : BasePanel
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[Button]
|
||||
public void Test1()
|
||||
{
|
||||
foreach (var VARIABLE in allSchemeName)
|
||||
{
|
||||
Debug.LogError(VARIABLE.deviceMap + VARIABLE.schemeName);
|
||||
}
|
||||
|
||||
Debug.LogError(allDeviceTypes.Count);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UI_ToolAndMaterialPanel : BasePanel
|
||||
{
|
||||
|
@ -6,23 +8,56 @@ public class UI_ToolAndMaterialPanel : BasePanel
|
|||
{
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
}
|
||||
|
||||
public override void ShowMe()
|
||||
{
|
||||
CreatItem(0); //默认打开显示工器具
|
||||
}
|
||||
|
||||
public override void HideMe()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
private void CreatItem(int type)
|
||||
{
|
||||
var bagData = GameManager.PacksackBagMgr.GetCurrentBagData();
|
||||
|
||||
foreach (var toolAndMaterialData in bagData.Values)
|
||||
{
|
||||
if (toolAndMaterialData.type != type)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string iconName = GameManager.ToolAndmaterialMgr.GetIconSpriteName(toolAndMaterialData.objName);
|
||||
if (iconName != null)
|
||||
{
|
||||
var toolAndMaterItem = GameManager.ResourcesMgr.Load<GameObject>(Const.UI_Item +
|
||||
"UI_ToolAndMaterialPanel/" +
|
||||
"ToolAndMeterialItem");
|
||||
|
||||
toolAndMaterItem.GetComponent<Image>().sprite =
|
||||
GameManager.ResourcesMgr.Load<Sprite>(Const.TitleSpritePath + iconName);
|
||||
toolAndMaterItem.GetComponentInChildren<Text>().text = toolAndMaterialData.count.ToString();
|
||||
|
||||
toolAndMaterItem.transform.parent = GetControl<ScrollRect>("itemScrollView").content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnClick(string btnName)
|
||||
{
|
||||
switch (btnName)
|
||||
{
|
||||
case "":
|
||||
case "closeBtn":
|
||||
GameManager.UIMgr.HidePanel<UI_ToolAndMaterialPanel>();
|
||||
break;
|
||||
case "toolBtn":
|
||||
CreatItem(0);
|
||||
break;
|
||||
case "deviceBtn":
|
||||
CreatItem(1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue