From ae48180b8d40e781d506cb08924fec6b7de6e765 Mon Sep 17 00:00:00 2001 From: Koha9 Date: Thu, 14 Sep 2023 20:13:53 +0900 Subject: [PATCH] =?UTF-8?q?V3.3.2=20LevelProbabilityPanel=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LevelProbabilityPanel初始化完成 独立Target enum类 --- .../ML-Agents/Timers/StartScene_timers.json | 2 +- Assets/ML-Agents/Timers/Train_timers.json | 2 +- Assets/Prefeb/ProbabilityPanel.meta | 8 + .../SingleLevelProbabilityPanel.prefab | 788 ++++++++++++++++++ .../SingleLevelProbabilityPanel.prefab.meta | 7 + .../SingleTargetLevelProbabilityPanel.prefab | 120 +++ ...gleTargetLevelProbabilityPanel.prefab.meta | 7 + .../ProbabilityPanel/TargetLevelTitle.prefab | 137 +++ .../TargetLevelTitle.prefab.meta | 7 + Assets/Prefeb/Scene Blocks Set.asset | 1 + Assets/Scenes/StartScene.unity | 153 ++++ Assets/Script/Extensions.meta | 8 + .../Script/Extensions/targetTypeExtensions.cs | 38 + .../Extensions/targetTypeExtensions.cs.meta | 11 + Assets/Script/InGame/AgentController.cs | 6 +- Assets/Script/InGame/EnvironmentUIControl.cs | 10 +- .../Script/InGame/MLAgentsCustomController.cs | 2 +- Assets/Script/InGame/ParameterContainer.cs | 2 +- Assets/Script/InGame/SceneBlockContainer.cs | 6 +- Assets/Script/InGame/TargetController.cs | 64 +- Assets/Script/InGame/WorldUIController.cs | 12 +- Assets/Script/MessageBoxController.cs | 18 +- Assets/Script/Play/MouseInMap.cs | 18 +- Assets/Script/SceneBlocksSet.cs | 175 ++-- Assets/Script/SingleLevelProbabilityPanel.cs | 70 ++ .../SingleLevelProbabilityPanel.cs.meta | 11 + Assets/Script/TargetTypesEnum.cs | 4 + Assets/Script/TargetTypesEnum.cs.meta | 11 + Assets/StartMenuProbabilityPanel.cs | 20 + Assets/StartMenuProbabilityPanel.cs.meta | 11 + Assets/TargetLevelProbabilityPanel.cs | 30 + Assets/TargetLevelProbabilityPanel.cs.meta | 11 + UserSettings/Layouts/default-2021.dwlt | 134 +-- 33 files changed, 1715 insertions(+), 189 deletions(-) create mode 100644 Assets/Prefeb/ProbabilityPanel.meta create mode 100644 Assets/Prefeb/ProbabilityPanel/SingleLevelProbabilityPanel.prefab create mode 100644 Assets/Prefeb/ProbabilityPanel/SingleLevelProbabilityPanel.prefab.meta create mode 100644 Assets/Prefeb/ProbabilityPanel/SingleTargetLevelProbabilityPanel.prefab create mode 100644 Assets/Prefeb/ProbabilityPanel/SingleTargetLevelProbabilityPanel.prefab.meta create mode 100644 Assets/Prefeb/ProbabilityPanel/TargetLevelTitle.prefab create mode 100644 Assets/Prefeb/ProbabilityPanel/TargetLevelTitle.prefab.meta create mode 100644 Assets/Script/Extensions.meta create mode 100644 Assets/Script/Extensions/targetTypeExtensions.cs create mode 100644 Assets/Script/Extensions/targetTypeExtensions.cs.meta create mode 100644 Assets/Script/SingleLevelProbabilityPanel.cs create mode 100644 Assets/Script/SingleLevelProbabilityPanel.cs.meta create mode 100644 Assets/Script/TargetTypesEnum.cs create mode 100644 Assets/Script/TargetTypesEnum.cs.meta create mode 100644 Assets/StartMenuProbabilityPanel.cs create mode 100644 Assets/StartMenuProbabilityPanel.cs.meta create mode 100644 Assets/TargetLevelProbabilityPanel.cs create mode 100644 Assets/TargetLevelProbabilityPanel.cs.meta diff --git a/Assets/ML-Agents/Timers/StartScene_timers.json b/Assets/ML-Agents/Timers/StartScene_timers.json index b25b790..ebe250c 100644 --- a/Assets/ML-Agents/Timers/StartScene_timers.json +++ b/Assets/ML-Agents/Timers/StartScene_timers.json @@ -1 +1 @@ -{"count":1,"self":77.1179712,"total":77.1915004,"children":{"InitializeActuators":{"count":2,"self":0.001501,"total":0.001501,"children":null},"InitializeSensors":{"count":2,"self":0.001,"total":0.001,"children":null},"AgentSendState":{"count":237,"self":0.0004998,"total":0.010502899999999999,"children":{"CollectObservations":{"count":237,"self":0.0080024,"total":0.0080024,"children":null},"WriteActionMask":{"count":237,"self":0,"total":0,"children":null},"RequestDecision":{"count":237,"self":0.0020007,"total":0.0020007,"children":null}}},"DecideAction":{"count":237,"self":0.0025017999999999998,"total":0.0025017999999999998,"children":null},"AgentAct":{"count":237,"self":0.0580262,"total":0.0580262,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1694254130","unity_version":"2021.3.14f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.14f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-ParallelEnv -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId 0aed42b0-3d5b-4374-942e-adccfa3e50fe -accessToken aawsLEtFkETWUEFg_3rpvdklhlZ5L56OYvt6FrHl5do00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"StartScene","end_time_seconds":"1694254207"}} \ No newline at end of file +{"count":1,"self":29.9088864,"total":29.9213861,"children":{"InitializeActuators":{"count":2,"self":0.0009981,"total":0.0009981,"children":null},"InitializeSensors":{"count":2,"self":0.0010019,"total":0.0010019,"children":null},"AgentSendState":{"count":1,"self":0.0015002,"total":0.0040000999999999995,"children":{"CollectObservations":{"count":1,"self":0.0009999,"total":0.0009999,"children":null},"WriteActionMask":{"count":1,"self":0.0005002,"total":0.0005002,"children":null},"RequestDecision":{"count":1,"self":0.0009998,"total":0.0009998,"children":null}}},"DecideAction":{"count":1,"self":0.0014995,"total":0.0014995,"children":null},"AgentAct":{"count":1,"self":0.0049999,"total":0.0049999,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1694689371","unity_version":"2021.3.14f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.14f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-ParallelEnv -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId fcd0a8c0-08c6-43d8-b172-6358343f3090 -accessToken HxBLJ_hoIReyv0zHRTXX4Ggo582o0WSYsQCComtJYHw00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"StartScene","end_time_seconds":"1694689401"}} \ No newline at end of file diff --git a/Assets/ML-Agents/Timers/Train_timers.json b/Assets/ML-Agents/Timers/Train_timers.json index bdf9f2b..58f2e55 100644 --- a/Assets/ML-Agents/Timers/Train_timers.json +++ b/Assets/ML-Agents/Timers/Train_timers.json @@ -1 +1 @@ -{"count":1,"self":8.9594696,"total":9.033501,"children":{"InitializeActuators":{"count":2,"self":0.001501,"total":0.001501,"children":null},"InitializeSensors":{"count":2,"self":0.001,"total":0.001,"children":null},"AgentSendState":{"count":237,"self":0.0004998,"total":0.010502899999999999,"children":{"CollectObservations":{"count":237,"self":0.0080024,"total":0.0080024,"children":null},"WriteActionMask":{"count":237,"self":0,"total":0,"children":null},"RequestDecision":{"count":237,"self":0.0020007,"total":0.0020007,"children":null}}},"DecideAction":{"count":237,"self":0.0025017999999999998,"total":0.0025017999999999998,"children":null},"AgentAct":{"count":237,"self":0.0580262,"total":0.0580262,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1694254130","unity_version":"2021.3.14f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.14f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-ParallelEnv -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId 0aed42b0-3d5b-4374-942e-adccfa3e50fe -accessToken aawsLEtFkETWUEFg_3rpvdklhlZ5L56OYvt6FrHl5do00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Train","end_time_seconds":"1694254139"}} \ No newline at end of file +{"count":1,"self":4.6485908,"total":4.6615886,"children":{"InitializeActuators":{"count":2,"self":0.0009981,"total":0.0009981,"children":null},"InitializeSensors":{"count":2,"self":0.0010019,"total":0.0010019,"children":null},"AgentSendState":{"count":1,"self":0.0015002,"total":0.0040000999999999995,"children":{"CollectObservations":{"count":1,"self":0.0009999,"total":0.0009999,"children":null},"WriteActionMask":{"count":1,"self":0.0005002,"total":0.0005002,"children":null},"RequestDecision":{"count":1,"self":0.0009998,"total":0.0009998,"children":null}}},"DecideAction":{"count":1,"self":0.0014995,"total":0.0014995,"children":null},"AgentAct":{"count":1,"self":0.0049999,"total":0.0049999,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1694689371","unity_version":"2021.3.14f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.14f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-ParallelEnv -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId fcd0a8c0-08c6-43d8-b172-6358343f3090 -accessToken HxBLJ_hoIReyv0zHRTXX4Ggo582o0WSYsQCComtJYHw00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Train","end_time_seconds":"1694689376"}} \ No newline at end of file diff --git a/Assets/Prefeb/ProbabilityPanel.meta b/Assets/Prefeb/ProbabilityPanel.meta new file mode 100644 index 0000000..4254aed --- /dev/null +++ b/Assets/Prefeb/ProbabilityPanel.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bed76ca72efe5b043a9f1a9c49965c99 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefeb/ProbabilityPanel/SingleLevelProbabilityPanel.prefab b/Assets/Prefeb/ProbabilityPanel/SingleLevelProbabilityPanel.prefab new file mode 100644 index 0000000..768d1ad --- /dev/null +++ b/Assets/Prefeb/ProbabilityPanel/SingleLevelProbabilityPanel.prefab @@ -0,0 +1,788 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1693634938881364460 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3748219629971124590} + - component: {fileID: 2237638637685423040} + m_Layer: 5 + m_Name: Slider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3748219629971124590 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1693634938881364460} + 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: + - {fileID: 4309273840935310008} + - {fileID: 988985003519551963} + - {fileID: 5310057321044942877} + m_Father: {fileID: 6142694097565525175} + 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: 110, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2237638637685423040 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1693634938881364460} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, 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: 2084417098938402335} + m_FillRect: {fileID: 8595048222422624147} + m_HandleRect: {fileID: 8946890828766323230} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!1 &2948841547428935891 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3351622314346807340} + - component: {fileID: 8130016478661155968} + - component: {fileID: 1173579214889807190} + m_Layer: 5 + m_Name: LevelTitle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3351622314346807340 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2948841547428935891} + 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: 6142694097565525175} + 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: 90, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8130016478661155968 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2948841547428935891} + m_CullTransparentMesh: 1 +--- !u!114 &1173579214889807190 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2948841547428935891} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: Level 0 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: f653ac5b85a721e4c9383008e6a565a7, type: 2} + m_sharedMaterial: {fileID: -4662725986004701985, guid: f653ac5b85a721e4c9383008e6a565a7, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 20 + m_fontSizeBase: 20 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &5814157604178447024 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4309273840935310008} + - component: {fileID: 4645935163599883039} + - component: {fileID: 6100537545799630444} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4309273840935310008 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5814157604178447024} + 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: 3748219629971124590} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4645935163599883039 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5814157604178447024} + m_CullTransparentMesh: 1 +--- !u!114 &6100537545799630444 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5814157604178447024} + 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: 10907, 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!1 &6536015492050286218 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6142694097565525175} + - component: {fileID: 9167363828671812255} + - component: {fileID: 8859056760562667354} + - component: {fileID: 5835000671358985704} + - component: {fileID: 2504318542466755443} + m_Layer: 5 + m_Name: SingleLevelProbabilityPanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6142694097565525175 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6536015492050286218} + 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: + - {fileID: 3351622314346807340} + - {fileID: 3748219629971124590} + - {fileID: 8207180036347771743} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 150, y: -39.4} + m_SizeDelta: {x: 260, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &9167363828671812255 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6536015492050286218} + m_CullTransparentMesh: 1 +--- !u!114 &8859056760562667354 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6536015492050286218} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: f6d46f1e916b3486c90a448a441fac6a, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 0.392} + 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: 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 &5835000671358985704 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6536015492050286218} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 3 + m_Spacing: 0 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!114 &2504318542466755443 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6536015492050286218} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 650649b0f68385646ba7f21566945d1a, type: 3} + m_Name: + m_EditorClassIdentifier: + levelNameText: {fileID: 1173579214889807190} + probabilityText: {fileID: 4996346509787936795} + probabilitySlider: {fileID: 2237638637685423040} + probabilityValue: 0 +--- !u!1 &6883838559566756852 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5310057321044942877} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5310057321044942877 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6883838559566756852} + 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: + - {fileID: 8946890828766323230} + m_Father: {fileID: 3748219629971124590} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &7047601740991657380 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 988985003519551963} + m_Layer: 5 + m_Name: Fill Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &988985003519551963 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7047601740991657380} + 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: + - {fileID: 8595048222422624147} + m_Father: {fileID: 3748219629971124590} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: -5, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &8137820397246397267 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8207180036347771743} + - component: {fileID: 8687037427136242914} + - component: {fileID: 4996346509787936795} + m_Layer: 5 + m_Name: Probability + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8207180036347771743 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8137820397246397267} + 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: 6142694097565525175} + 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: 60, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8687037427136242914 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8137820397246397267} + m_CullTransparentMesh: 1 +--- !u!114 &4996346509787936795 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8137820397246397267} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: 0.00 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: f653ac5b85a721e4c9383008e6a565a7, type: 2} + m_sharedMaterial: {fileID: -4662725986004701985, guid: f653ac5b85a721e4c9383008e6a565a7, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 20 + m_fontSizeBase: 20 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &8662849576362711138 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8946890828766323230} + - component: {fileID: 6929668190819277294} + - component: {fileID: 2084417098938402335} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8946890828766323230 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662849576362711138} + 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: 5310057321044942877} + 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: 20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6929668190819277294 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662849576362711138} + m_CullTransparentMesh: 1 +--- !u!114 &2084417098938402335 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8662849576362711138} + 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: 10913, guid: 0000000000000000f000000000000000, type: 0} + 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 &9170470002168152568 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8595048222422624147} + - component: {fileID: 265240603436177248} + - component: {fileID: 2425573218447282340} + m_Layer: 5 + m_Name: Fill + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8595048222422624147 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9170470002168152568} + 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: 988985003519551963} + 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: 10, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &265240603436177248 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9170470002168152568} + m_CullTransparentMesh: 1 +--- !u!114 &2425573218447282340 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9170470002168152568} + 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 diff --git a/Assets/Prefeb/ProbabilityPanel/SingleLevelProbabilityPanel.prefab.meta b/Assets/Prefeb/ProbabilityPanel/SingleLevelProbabilityPanel.prefab.meta new file mode 100644 index 0000000..cbdea69 --- /dev/null +++ b/Assets/Prefeb/ProbabilityPanel/SingleLevelProbabilityPanel.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 81d4d787c82b5174caf00af00e9a3cd1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefeb/ProbabilityPanel/SingleTargetLevelProbabilityPanel.prefab b/Assets/Prefeb/ProbabilityPanel/SingleTargetLevelProbabilityPanel.prefab new file mode 100644 index 0000000..e14088c --- /dev/null +++ b/Assets/Prefeb/ProbabilityPanel/SingleTargetLevelProbabilityPanel.prefab @@ -0,0 +1,120 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5589415219770305710 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5589415219770305709} + - component: {fileID: 5589415219770305698} + - component: {fileID: 5589415219770305699} + - component: {fileID: 5589415219770305708} + - component: {fileID: 5589415219770305697} + m_Layer: 5 + m_Name: SingleTargetLevelProbabilityPanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5589415219770305709 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5589415219770305710} + 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: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 176.75958, y: -92.08249} + m_SizeDelta: {x: 260, y: 127.3568} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5589415219770305698 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5589415219770305710} + m_CullTransparentMesh: 1 +--- !u!114 &5589415219770305699 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5589415219770305710} + 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: 0.392} + 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: 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 &5589415219770305708 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5589415219770305710} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 44de9c40b3fc56046a490c8c47631d4d, type: 3} + m_Name: + m_EditorClassIdentifier: + singleLevelProbabilityPanel: {fileID: 6536015492050286218, guid: 81d4d787c82b5174caf00af00e9a3cd1, type: 3} + targetTitleText: {fileID: 8396012208200061614, guid: 8a180acb9a0ba8b4aacd888419f082ed, type: 3} +--- !u!114 &5589415219770305697 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5589415219770305710} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 1 + m_ReverseArrangement: 0 diff --git a/Assets/Prefeb/ProbabilityPanel/SingleTargetLevelProbabilityPanel.prefab.meta b/Assets/Prefeb/ProbabilityPanel/SingleTargetLevelProbabilityPanel.prefab.meta new file mode 100644 index 0000000..1f990e0 --- /dev/null +++ b/Assets/Prefeb/ProbabilityPanel/SingleTargetLevelProbabilityPanel.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 324d8e84c24cdd04ba087763705db1d0 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefeb/ProbabilityPanel/TargetLevelTitle.prefab b/Assets/Prefeb/ProbabilityPanel/TargetLevelTitle.prefab new file mode 100644 index 0000000..75a3957 --- /dev/null +++ b/Assets/Prefeb/ProbabilityPanel/TargetLevelTitle.prefab @@ -0,0 +1,137 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &8396012208200061614 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6700971498414720989} + - component: {fileID: 4960457373510201701} + - component: {fileID: 4489288096752744326} + m_Layer: 5 + m_Name: TargetLevelTitle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6700971498414720989 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8396012208200061614} + 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: 0} + 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: 260, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &4960457373510201701 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8396012208200061614} + m_CullTransparentMesh: 1 +--- !u!114 &4489288096752744326 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8396012208200061614} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: TargetName + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: f653ac5b85a721e4c9383008e6a565a7, type: 2} + m_sharedMaterial: {fileID: -4662725986004701985, guid: f653ac5b85a721e4c9383008e6a565a7, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} diff --git a/Assets/Prefeb/ProbabilityPanel/TargetLevelTitle.prefab.meta b/Assets/Prefeb/ProbabilityPanel/TargetLevelTitle.prefab.meta new file mode 100644 index 0000000..1e560fb --- /dev/null +++ b/Assets/Prefeb/ProbabilityPanel/TargetLevelTitle.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8a180acb9a0ba8b4aacd888419f082ed +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefeb/Scene Blocks Set.asset b/Assets/Prefeb/Scene Blocks Set.asset index bc3573e..257ff91 100644 --- a/Assets/Prefeb/Scene Blocks Set.asset +++ b/Assets/Prefeb/Scene Blocks Set.asset @@ -15,3 +15,4 @@ MonoBehaviour: levels: - {fileID: 11400000, guid: e9f031290ad88b1479c80e7adfd6d5fd, type: 2} - {fileID: 11400000, guid: bf3f37e7f498fad4d8640226f4b70374, type: 2} + targets: 0100000002000000 diff --git a/Assets/Scenes/StartScene.unity b/Assets/Scenes/StartScene.unity index 74005d8..9a68306 100644 --- a/Assets/Scenes/StartScene.unity +++ b/Assets/Scenes/StartScene.unity @@ -134,6 +134,7 @@ GameObject: - component: {fileID: 49128671} - component: {fileID: 49128670} - component: {fileID: 49128669} + - component: {fileID: 49128672} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -207,6 +208,39 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &49128672 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 49128668} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_VolumeFrameworkUpdateModeOption: 2 + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 --- !u!1 &163375063 GameObject: m_ObjectHideFlags: 0 @@ -341,6 +375,124 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 163375063} m_CullTransparentMesh: 1 +--- !u!1 &237721381 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 237721382} + - component: {fileID: 237721385} + - component: {fileID: 237721384} + - component: {fileID: 237721386} + - component: {fileID: 237721387} + m_Layer: 5 + m_Name: TargetLevelProbabilityPanel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &237721382 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 237721381} + 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: 1144208399} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 219, y: -89} + m_SizeDelta: {x: 384.1805, y: 127.3568} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &237721384 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 237721381} + 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: 0} + 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: 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!222 &237721385 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 237721381} + m_CullTransparentMesh: 1 +--- !u!114 &237721386 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 237721381} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 1 + m_ReverseArrangement: 0 +--- !u!114 &237721387 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 237721381} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0195eb0e734c7e747bb7f8b669c80fe5, type: 3} + m_Name: + m_EditorClassIdentifier: + singleTargetLevelProbabilityPanel: {fileID: 5589415219770305710, guid: 324d8e84c24cdd04ba087763705db1d0, type: 3} + scenePrefabSet: {fileID: 11400000, guid: 6ebbd27eb466c4a41bd2584c1b9c2e1f, type: 2} --- !u!1 &294404779 GameObject: m_ObjectHideFlags: 0 @@ -2043,6 +2195,7 @@ RectTransform: - {fileID: 320870612} - {fileID: 1614969824} - {fileID: 1899537997} + - {fileID: 237721382} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Script/Extensions.meta b/Assets/Script/Extensions.meta new file mode 100644 index 0000000..75b5dcf --- /dev/null +++ b/Assets/Script/Extensions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bb7e12204e0f2e34cbe9674b4927beac +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/Extensions/targetTypeExtensions.cs b/Assets/Script/Extensions/targetTypeExtensions.cs new file mode 100644 index 0000000..665be2c --- /dev/null +++ b/Assets/Script/Extensions/targetTypeExtensions.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public static class targetTypeExtensions +{ + public static int ToIndex(this Targets targetType) + { + switch (targetType) + { + case Targets.Go: + return 0; + case Targets.Attack: + return 1; + case Targets.Defence: + return 2; + default: + Debug.LogError("ToIndex:targetType not found!"); + return -1; + } + } + + public static Targets ToTargetType(this int index) + { + switch (index) + { + case 0: + return Targets.Go; + case 1: + return Targets.Attack; + case 2: + return Targets.Defence; + default: + Debug.LogError("ToTargetType:index out of range!"); + return Targets.Go; + } + } +} diff --git a/Assets/Script/Extensions/targetTypeExtensions.cs.meta b/Assets/Script/Extensions/targetTypeExtensions.cs.meta new file mode 100644 index 0000000..73a1073 --- /dev/null +++ b/Assets/Script/Extensions/targetTypeExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb4bd090287d8da47959d417e9234626 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/InGame/AgentController.cs b/Assets/Script/InGame/AgentController.cs index 43d94de..d40b4f8 100644 --- a/Assets/Script/InGame/AgentController.cs +++ b/Assets/Script/InGame/AgentController.cs @@ -215,7 +215,7 @@ private float Ballistic(int shootState) return targetCon.HitEnemyReward(gotHitObj.transform.position); } } - if (targetCon.targetTypeInt == (int)SceneBlockContainer.Targets.Attack) + if (targetCon.targetTypeInt == (int)Targets.Attack) { // while if attack mode float targetDis = Vector3.Distance(blockContainer.nowBlock.transform.position, transform.position); @@ -253,7 +253,7 @@ private float FacingReward() bool isFacingtoEnemy = false; float enemyFacingDistance = 0f; Ray ray = fpsCam.ScreenPointToRay(new Vector3(fpsCam.pixelWidth / 2, fpsCam.pixelHeight / 2, 0)); - if (targetCon.targetTypeInt == (int)SceneBlockContainer.Targets.Free) + if (targetCon.targetTypeInt == (int)Targets.Free) { //free mode RaycastHit hit; @@ -299,7 +299,7 @@ private float FacingReward() // Debug.Log("ninimum = " + nowReward); } } - else if (targetCon.targetTypeInt == (int)SceneBlockContainer.Targets.Attack) + else if (targetCon.targetTypeInt == (int)Targets.Attack) { // attack mode // Target to Agent distance diff --git a/Assets/Script/InGame/EnvironmentUIControl.cs b/Assets/Script/InGame/EnvironmentUIControl.cs index 5740e01..a3a8940 100644 --- a/Assets/Script/InGame/EnvironmentUIControl.cs +++ b/Assets/Script/InGame/EnvironmentUIControl.cs @@ -135,27 +135,27 @@ public void UpdateTargetType(int targetInt) { switch (targetInt) { - case (int)SceneBlockContainer.Targets.Go: + case (int)Targets.Go: targetTypeText.text = "GOTO"; targetTypeText.color = Color.blue; break; - case (int)SceneBlockContainer.Targets.Attack: + case (int)Targets.Attack: targetTypeText.text = "Attack!"; targetTypeText.color = Color.red; break; - case (int)SceneBlockContainer.Targets.Defence: + case (int)Targets.Defence: targetTypeText.text = "Defence"; targetTypeText.color = Color.green; break; - case (int)SceneBlockContainer.Targets.Free: + case (int)Targets.Free: targetTypeText.text = "Free"; targetTypeText.color = Color.yellow; break; - case (int)SceneBlockContainer.Targets.Stay: + case (int)Targets.Stay: targetTypeText.text = "Stay"; targetTypeText.color = Color.white; break; diff --git a/Assets/Script/InGame/MLAgentsCustomController.cs b/Assets/Script/InGame/MLAgentsCustomController.cs index 15e7ad4..5b5b2b5 100644 --- a/Assets/Script/InGame/MLAgentsCustomController.cs +++ b/Assets/Script/InGame/MLAgentsCustomController.cs @@ -171,7 +171,7 @@ public override void OnActionReceived(ActionBuffers actionBuffers) // Win or lose Finished Debug.Log("Finish reward = " + nowRoundReward); EP += 1; - string targetString = Enum.GetName(typeof(SceneBlockContainer.Targets), targetController.targetTypeInt); + string targetString = Enum.GetName(typeof(Targets), targetController.targetTypeInt); switch (finishedState) { case (int)TargetController.EndType.Win: diff --git a/Assets/Script/InGame/ParameterContainer.cs b/Assets/Script/InGame/ParameterContainer.cs index 117ce6f..4804a92 100644 --- a/Assets/Script/InGame/ParameterContainer.cs +++ b/Assets/Script/InGame/ParameterContainer.cs @@ -180,7 +180,7 @@ private void Start() private void Update() { // get target distance and in area - if (targetCon.targetTypeInt is (int)SceneBlockContainer.Targets.Go or (int)SceneBlockContainer.Targets.Attack) + if (targetCon.targetTypeInt is (int)Targets.Go or (int)Targets.Attack) { (agentDistance, agentInArea) = blockCont.GetAgentTargetDistanceAndInside(agentObj.transform.position); // attack goto or defence target diff --git a/Assets/Script/InGame/SceneBlockContainer.cs b/Assets/Script/InGame/SceneBlockContainer.cs index 0959e12..7f77191 100644 --- a/Assets/Script/InGame/SceneBlockContainer.cs +++ b/Assets/Script/InGame/SceneBlockContainer.cs @@ -2,12 +2,10 @@ public class SceneBlockContainer : MonoBehaviour { - public enum Targets - { Free, Go, Attack, Defence, Stay, Num };// Num is use for get total target bumber - public float sceneSize = 10f; public GameObject environmentObj; public GameObject hudObj; + // public GameObject[] attackBlockPrefabs = new GameObject[1]; // public GameObject[] goBlockPrefabs = new GameObject[1]; // public GameObject[] defencePrefabs = new GameObject[1]; @@ -42,7 +40,7 @@ public void CreateNewBlock(Targets targetType, int level, int blockType, Vector3 DestroyBlock(); } // choose target type - nowBlockObj = Instantiate(scenePrefabSet.GetPrefab(targetType, level, blockType), blockPosition + environmentObj.transform.position, Quaternion.identity, transform); + nowBlockObj = Instantiate(scenePrefabSet.GetPrefab(level, blockType, targetType), blockPosition + environmentObj.transform.position, Quaternion.identity, transform); nowBlock = nowBlockObj.GetComponent(); nowBlock.group1Tag = tag1; nowBlock.group2Tag = tag2; diff --git a/Assets/Script/InGame/TargetController.cs b/Assets/Script/InGame/TargetController.cs index ff9a85e..e070854 100644 --- a/Assets/Script/InGame/TargetController.cs +++ b/Assets/Script/InGame/TargetController.cs @@ -104,9 +104,9 @@ private void Start() maxAgentAreaZ = edgeAgent_Enemy.transform.localPosition.z - 1.0f; freeProb = 1 - attackProb - gotoProb - defenceProb; - targetNum = (int)SceneBlockContainer.Targets.Num; - gotoLevelNum = sceneBlockCon.scenePrefabSet.GetLevelNumber(SceneBlockContainer.Targets.Go); - attackLevelNum = sceneBlockCon.scenePrefabSet.GetLevelNumber(SceneBlockContainer.Targets.Attack); + targetNum = (int)Targets.Num; + gotoLevelNum = sceneBlockCon.scenePrefabSet.GetLevelNumber(Targets.Go); + attackLevelNum = sceneBlockCon.scenePrefabSet.GetLevelNumber(Targets.Attack); if (freeProb < 0) { Debug.LogError("TargetController.Start: target percentage wrong"); @@ -158,8 +158,8 @@ public void RollNewScene() { // goto target spawn Debug.Log("GOTO THIS TARGET!"); - targetTypeInt = (int)SceneBlockContainer.Targets.Go; - RandomSpawnSceneBlock(SceneBlockContainer.Targets.Go); + targetTypeInt = (int)Targets.Go; + RandomSpawnSceneBlock(Targets.Go); // set startDistance firstRewardFlag = true; } @@ -167,8 +167,8 @@ public void RollNewScene() { // attack target spawn Debug.Log("ATTACK!"); - targetTypeInt = (int)SceneBlockContainer.Targets.Attack; - RandomSpawnSceneBlock(SceneBlockContainer.Targets.Attack); + targetTypeInt = (int)Targets.Attack; + RandomSpawnSceneBlock(Targets.Attack); // set startDistance firstRewardFlag = true; targetEnemySpawnFinish = false; @@ -177,15 +177,15 @@ public void RollNewScene() { // defence target spawn Debug.Log("DEFENCE!"); - targetTypeInt = (int)SceneBlockContainer.Targets.Defence; - RandomSpawnSceneBlock(SceneBlockContainer.Targets.Defence); + targetTypeInt = (int)Targets.Defence; + RandomSpawnSceneBlock(Targets.Defence); // set startDistance firstRewardFlag = true; } else { Debug.Log("Free"); - targetTypeInt = (int)SceneBlockContainer.Targets.Free; + targetTypeInt = (int)Targets.Free; enemyCon.DestroyAllEnemys(); enemyCon.RandomInitEnemys(hudCon.enemyNum); MoveAgentToSpwanArea(); @@ -254,11 +254,11 @@ public void MoveAgentTo(Vector3 position) /// This method generates a random scene block based on the target type and spawns enemies at the specified location. /// 此方法根据目标类型生成一个随机场景块,并在指定位置生成敌人。 /// - private void RandomSpawnSceneBlock(SceneBlockContainer.Targets targetType) + private void RandomSpawnSceneBlock(Targets targetType) { randLevel = RollRandomLevelIndex(targetType); - randBlockType = Random.Range(0, sceneBlockCon.scenePrefabSet.GetBlockNumber(targetType,randLevel)); - sceneBlockSize = sceneBlockCon.scenePrefabSet.GetBlockSize(targetType, randLevel, randBlockType); + randBlockType = Random.Range(0, sceneBlockCon.scenePrefabSet.GetBlockNumber(randLevel,targetType)); + sceneBlockSize = sceneBlockCon.scenePrefabSet.GetBlockSize(randLevel, randBlockType, targetType); float randX = UnityEngine.Random.Range(minEnemyAreaX + sceneBlockSize / 2 + 1f, maxEnemyAreaX - sceneBlockSize / 2 - 1f); float randZ = UnityEngine.Random.Range(minEnemyAreaZ + sceneBlockSize / 2 + 1f, maxEnemyAreaZ - sceneBlockSize / 2 - 1f); @@ -289,7 +289,7 @@ private void RandomSpawnSceneBlock(SceneBlockContainer.Targets targetType) float nowDistance = 0f; switch (targetTypeInt) { - case (int)SceneBlockContainer.Targets.Go: + case (int)Targets.Go: // goto (nowDistance, inArea) = sceneBlockCon.GetAgentTargetDistanceAndInside(agentObj.transform.position); envUICon.UpdateTargetGauge(sceneBlockCon.nowBlock.firebasesBelong, sceneBlockCon.nowBlock.belongMaxPoint); @@ -320,7 +320,7 @@ private void RandomSpawnSceneBlock(SceneBlockContainer.Targets targetType) } break; - case (int)SceneBlockContainer.Targets.Attack: + case (int)Targets.Attack: // attack (nowDistance, inArea) = sceneBlockCon.GetAgentTargetDistanceAndInside(agentObj.transform.position); envUICon.UpdateTargetGauge(sceneBlockCon.nowBlock.firebasesBelong, sceneBlockCon.nowBlock.belongMaxPoint); @@ -354,7 +354,7 @@ private void RandomSpawnSceneBlock(SceneBlockContainer.Targets targetType) } break; - case (int)SceneBlockContainer.Targets.Defence: + case (int)Targets.Defence: //defence // !!! DIDN't FINISH!!! (nowDistance, inArea) = sceneBlockCon.GetAgentTargetDistanceAndInside(agentObj.transform.position); @@ -382,7 +382,7 @@ private void RandomSpawnSceneBlock(SceneBlockContainer.Targets targetType) } break; - case (int)SceneBlockContainer.Targets.Stay: + case (int)Targets.Stay: // Stay // endless nowReward = 0; @@ -462,7 +462,7 @@ private float GetDistanceReward(float nowDistance, int inarea) public float KillReward(Vector3 enemyPosition) { float nowKillReward = 0f; - if (targetTypeInt == (int)SceneBlockContainer.Targets.Attack) + if (targetTypeInt == (int)Targets.Attack) { // attack mode (_, int isInArea) = sceneBlockCon.nowBlock.GetDistInArea(enemyPosition); @@ -476,7 +476,7 @@ public float KillReward(Vector3 enemyPosition) nowKillReward = paramCon.killNonTargetReward; } } - else if (targetTypeInt == (int)SceneBlockContainer.Targets.Free) + else if (targetTypeInt == (int)Targets.Free) { // free mode hit nowKillReward = paramCon.killTargetEnemyReward; @@ -498,7 +498,7 @@ public float KillReward(Vector3 enemyPosition) public float HitEnemyReward(Vector3 enemyPosition) { float nowHitReward = 0f; - if (targetTypeInt == (int)SceneBlockContainer.Targets.Attack) + if (targetTypeInt == (int)Targets.Attack) { // attack mode (_, int isInArea) = sceneBlockCon.nowBlock.GetDistInArea(enemyPosition); @@ -513,7 +513,7 @@ public float HitEnemyReward(Vector3 enemyPosition) nowHitReward = paramCon.hitNonTargetReward; } } - else if (targetTypeInt == (int)SceneBlockContainer.Targets.Free) + else if (targetTypeInt == (int)Targets.Free) { // free mode hit nowHitReward = paramCon.hitTargetReward; @@ -544,7 +544,7 @@ public float HitEnemyReward(Vector3 enemyPosition) /// public void PlayInitialize() { - targetTypeInt = (int)SceneBlockContainer.Targets.Stay; + targetTypeInt = (int)Targets.Stay; UpdateTargetStates(); envUICon.UpdateTargetType(targetTypeInt); MoveAgentToSpwanArea(); @@ -555,7 +555,7 @@ public void PlayInitialize() // change to attack mode public void AttackModeChange(Vector3 targetPosition) { - targetTypeInt = (int)SceneBlockContainer.Targets.Attack; + targetTypeInt = (int)Targets.Attack; UpdateTargetStates(targetPosition); envUICon.UpdateTargetType(targetTypeInt); } @@ -563,7 +563,7 @@ public void AttackModeChange(Vector3 targetPosition) // change to free mode public void FreeModeChange() { - targetTypeInt = (int)SceneBlockContainer.Targets.Free; + targetTypeInt = (int)Targets.Free; UpdateTargetStates(); envUICon.UpdateTargetType(targetTypeInt); } @@ -571,7 +571,7 @@ public void FreeModeChange() // change to goto mode public void GotoModeChange(Vector3 targetPosition) { - targetTypeInt = (int)SceneBlockContainer.Targets.Go; + targetTypeInt = (int)Targets.Go; UpdateTargetStates(targetPosition); envUICon.UpdateTargetType(targetTypeInt); } @@ -579,7 +579,7 @@ public void GotoModeChange(Vector3 targetPosition) // change to stay mode public void StayModeChange() { - targetTypeInt = (int)SceneBlockContainer.Targets.Stay; + targetTypeInt = (int)Targets.Stay; UpdateTargetStates(); envUICon.UpdateTargetType(targetTypeInt); } @@ -599,7 +599,7 @@ private void UpdateTargetStates(Vector3? targetPosition = null) { this.targetPosition = (Vector3)targetPosition; } - if (targetTypeInt == (int)SceneBlockContainer.Targets.Free || targetTypeInt == (int)SceneBlockContainer.Targets.Stay) + if (targetTypeInt == (int)Targets.Free || targetTypeInt == (int)Targets.Stay) { for (int i = 1; i < targetState.Length; i++) // set target position state to 0 @@ -622,7 +622,7 @@ private void UpdateTargetStates(Vector3? targetPosition = null) /// The in-area state. public int GetInAreaState() { - if (targetTypeInt == (int)SceneBlockContainer.Targets.Go) + if (targetTypeInt == (int)Targets.Go) { return inArea; } @@ -638,19 +638,19 @@ public int GetInAreaState() /// /// The target type. /// A random level index. - public int RollRandomLevelIndex(SceneBlockContainer.Targets target) + public int RollRandomLevelIndex(Targets target) { List targetProbs; switch (target) { - case SceneBlockContainer.Targets.Attack: + case Targets.Attack: targetProbs = paramCon.attackLevelProbs; break; - case SceneBlockContainer.Targets.Go: + case Targets.Go: targetProbs = paramCon.gotoLevelProbs; break; - case SceneBlockContainer.Targets.Defence: + case Targets.Defence: targetProbs = paramCon.defenceLevelProbs; break; default: diff --git a/Assets/Script/InGame/WorldUIController.cs b/Assets/Script/InGame/WorldUIController.cs index 5b3462d..bf59f72 100644 --- a/Assets/Script/InGame/WorldUIController.cs +++ b/Assets/Script/InGame/WorldUIController.cs @@ -13,15 +13,15 @@ public class WorldUIController : MonoBehaviour // Start is called before the first frame update private void Start() { - totalGames = new int[(int)SceneBlockContainer.Targets.Num]; - winGames = new int[(int)SceneBlockContainer.Targets.Num]; - Array.Clear(totalGames, 0, (int)SceneBlockContainer.Targets.Num); - Array.Clear(winGames, 0, (int)SceneBlockContainer.Targets.Num); + totalGames = new int[(int)Targets.Num]; + winGames = new int[(int)Targets.Num]; + Array.Clear(totalGames, 0, (int)Targets.Num); + Array.Clear(winGames, 0, (int)Targets.Num); //WinChart.Init(); winChart.RemoveData(); - for (int i = 0; i < (int)SceneBlockContainer.Targets.Num; i++) + for (int i = 0; i < (int)Targets.Num; i++) { - string lineName = Enum.GetName(typeof(SceneBlockContainer.Targets), i); + string lineName = Enum.GetName(typeof(Targets), i); winChart.AddSerie(lineName); } } diff --git a/Assets/Script/MessageBoxController.cs b/Assets/Script/MessageBoxController.cs index 3961c35..ec1563b 100644 --- a/Assets/Script/MessageBoxController.cs +++ b/Assets/Script/MessageBoxController.cs @@ -14,7 +14,13 @@ public class MessageBoxController : MonoBehaviour [SerializeField] private List messages = new List(); - + /// + /// Pushes a simple message to the message list. + /// + /// The message text. + /// + /// This method pushes a simple text message to the message list and handles message overflow to ensure that the message list does not grow indefinitely. + /// public void PushMessage(string text) { // push simple message to message list @@ -29,7 +35,15 @@ public void PushMessage(string text) messages.Add(newMessage); } - // push multi color message to message list + /// + /// Pushes multi-color messages to the message list. + /// + /// The list of message texts. + /// The list of colors. + /// + /// This method pushes multi-color text messages to the message list and handles message overflow to ensure that the message list does not grow indefinitely. + /// If the lengths of the message text list and the color list do not match, it either removes excess colors or adds white color to the extra messages. + /// public void PushMessage(List messageList,List colorList) { // check messages and colors list length match diff --git a/Assets/Script/Play/MouseInMap.cs b/Assets/Script/Play/MouseInMap.cs index 2b2069f..92d00ad 100644 --- a/Assets/Script/Play/MouseInMap.cs +++ b/Assets/Script/Play/MouseInMap.cs @@ -77,7 +77,7 @@ private void Update() else { // if agent or enemy is not nearby, create new block - sceneBlockCon.CreateNewBlock(SceneBlockContainer.Targets.Attack, blockLevel, blockNum, nowHitPositionRelative); + sceneBlockCon.CreateNewBlock(Targets.Attack, blockLevel, blockNum, nowHitPositionRelative); sceneBlockCon.InitializeBlock(environmentObj); targetCon.AttackModeChange(nowHitPositionRelative); ChangeMouseMode(MouseMode.Default); @@ -94,7 +94,7 @@ private void Update() else { // if agent or enemy is not nearby, create new block - sceneBlockCon.CreateNewBlock(SceneBlockContainer.Targets.Go, blockLevel, blockNum, nowHitPositionRelative); + sceneBlockCon.CreateNewBlock(Targets.Go, blockLevel, blockNum, nowHitPositionRelative); sceneBlockCon.InitializeBlock(environmentObj); targetCon.GotoModeChange(nowHitPositionRelative); ChangeMouseMode(MouseMode.Default); @@ -124,7 +124,7 @@ private void Update() public void ChangeMouseMode(MouseMode mouseMode, int level = -1, int blockNum = -1) { this.mouseMode = mouseMode; - SceneBlockContainer.Targets nowTargetType; + Targets nowTargetType; switch (mouseMode) { case MouseMode.AttackSet: @@ -149,7 +149,7 @@ public void ChangeMouseMode(MouseMode mouseMode, int level = -1, int blockNum = if (blockNum < 0) { // while blockNum is not set, random choose block type - this.blockNum = Random.Range(0, sceneBlockCon.scenePrefabSet.GetBlockNumber(nowTargetType, blockLevel)); + this.blockNum = Random.Range(0, sceneBlockCon.scenePrefabSet.GetBlockNumber(blockLevel, nowTargetType)); } else { @@ -157,7 +157,7 @@ public void ChangeMouseMode(MouseMode mouseMode, int level = -1, int blockNum = this.blockNum = blockNum; } // set previewModel - previewModel = sceneBlockCon.scenePrefabSet.GetPrefab(nowTargetType, blockLevel, this.blockNum); + previewModel = sceneBlockCon.scenePrefabSet.GetPrefab(blockLevel, this.blockNum, nowTargetType); mousePreviewCon.ChangePreviewTo(previewModel); break; @@ -223,20 +223,20 @@ private bool IsAgentorEnemyWithinDistance(float distance) } // change to TargetType from MouseMode - private SceneBlockContainer.Targets GetTargetTypeByMouseMode(MouseMode mode) + private Targets GetTargetTypeByMouseMode(MouseMode mode) { switch (mode) { case MouseMode.AttackSet: - return SceneBlockContainer.Targets.Attack; + return Targets.Attack; case MouseMode.GotoSet: - return SceneBlockContainer.Targets.Go; + return Targets.Go; default: messageCon.PushMessage(new List { "[Error]MouseInMap:GetTargetTypeByMouseMode:", "Mouse Mode not found!", "mode=", mode.ToString() }, new List { messageCon.errorColor }); - return SceneBlockContainer.Targets.Num; + return Targets.Num; } } } \ No newline at end of file diff --git a/Assets/Script/SceneBlocksSet.cs b/Assets/Script/SceneBlocksSet.cs index 81c2acf..2623a9d 100644 --- a/Assets/Script/SceneBlocksSet.cs +++ b/Assets/Script/SceneBlocksSet.cs @@ -1,5 +1,5 @@ +using System; using System.Collections.Generic; -using UnityEditor.PackageManager; using UnityEngine; /// @@ -13,18 +13,24 @@ public class SceneBlocksSet : ScriptableObject { public LevelsSet[] levels = new LevelsSet[3]; + public Targets[] targets = new Targets[3]; private GameObject hudObj; private MessageBoxController messageBoxController; + private bool isHudEnabled = false; /// /// Initialize the scene block set. /// /// The HUD object used to access the message box controller. - public void InitializeSceneBlocksSet(GameObject hudObj) + public void InitializeSceneBlocksSet(GameObject hudObj = null) { - this.hudObj = hudObj; - messageBoxController = this.hudObj.GetComponent(); + if (hudObj != null) + { + isHudEnabled = true; + this.hudObj = hudObj; + messageBoxController = this.hudObj.GetComponent(); + } for (int i = 0; i < levels.Length; i++) { // initialize all level prefab set @@ -33,101 +39,156 @@ public void InitializeSceneBlocksSet(GameObject hudObj) } /// - /// Get all level prefab sets based on the target type. + /// Gets all level prefab sets. /// - /// The target type to retrieve all level prefab sets for. - /// All level prefab sets for the specified target type. - public LevelsSet GetAllLevlePrefabSet(SceneBlockContainer.Targets targetType) + /// The target type (optional). + /// The index (optional). + /// The level prefab sets. + /// + /// If the target type (targetType) or index (index) is provided, it returns the corresponding level prefab set. + /// If neither the target type (targetType) nor the index (index) is provided, an exception will be thrown, and an error message will be logged. + /// + public LevelsSet GetAllLevlePrefabSet(Targets? targetType = null, int? index = null) { - switch (targetType) + if (targetType == null && index == null) { - case SceneBlockContainer.Targets.Go: - return levels[0]; + PushSceneBlockMessages(new List { "[ERROR]ScenePrefabSet.GetAllLevlePrefabSet:", " targetType or index not found!" }, + new List { messageBoxController.errorColor }); + throw new ArgumentNullException("Both targetType and index cannot be null."); + } + int levelIndex = 0; + switch (targetType, index) + { + case (Targets type, null): + levelIndex = type.ToIndex(); + break; - case SceneBlockContainer.Targets.Attack: - return levels[1]; + case (null, int i): + levelIndex = i; + break; - case SceneBlockContainer.Targets.Defence: - messageBoxController.PushMessage(new List { "[ERROR]ScenePrefabSet.GetAllLevlePrefabSet:", " Defence Mode not ready!" }, - new List { messageBoxController.errorColor }); - Debug.LogError("ScenePrefabSet.GetAllLevlePrefabSet:Defence Mode not ready!"); - return levels[2]; + case (Targets type, int i): + levelIndex = type.ToIndex(); + break; default: - messageBoxController.PushMessage(new List { "[ERROR]ScenePrefabSet.GetAllLevlePrefabSet:", " targetType not found!","tagetType = ",targetType.ToString() }, - new List { messageBoxController.errorColor }); - Debug.LogError("ScenePrefabSet.GetAllLevlePrefabSet:targetType not found!"); - return null; + PushSceneBlockMessages(new List { "[ERROR]ScenePrefabSet.GetAllLevlePrefabSet:", " targetType or index not found!" }, + new List { messageBoxController.errorColor }); + break; } + return levels[levelIndex]; } /// - /// Get a single level prefab set based on the target type and level. + /// Gets the prefab set for a single level. /// - /// The target type to retrieve the level prefab set for. - /// The level to retrieve the level prefab set for. - /// The single level prefab set for the specified target type and level. - public BlocksSet GetSingleLevelPrefabSet(SceneBlockContainer.Targets targetType, int level) + /// The level index. + /// The target type (optional). + /// The index (optional). + /// The prefab set for a single level. + /// + /// If the target type (targetType) or index (index) is provided, it returns the prefab set for the corresponding level. + /// If the level index is out of range, an exception will be thrown, and an error message will be logged. + /// + public BlocksSet GetSingleLevelPrefabSet(int level, Targets? targetType = null, int? index = null) { - if(level >= GetAllLevlePrefabSet(targetType).singleLevelSet.Length) + if (level >= GetAllLevlePrefabSet(targetType, index).singleLevelSet.Length) { - messageBoxController.PushMessage(new List { "[ERROR]ScenePrefabSet.GetSingleLevelPrefabSet:", " level out of range!","targetType = ",targetType.ToString(), "level = ",level.ToString()}, + PushSceneBlockMessages(new List { "[ERROR]ScenePrefabSet.GetSingleLevelPrefabSet:", " level out of range!", "targetType = ", targetType.ToString(), "level = ", level.ToString() }, new List { messageBoxController.errorColor }); Debug.LogError("ScenePrefabSet.GetSingleLevelPrefabSet:level out of range!"); return null; } - return GetAllLevlePrefabSet(targetType).singleLevelSet[level]; + return GetAllLevlePrefabSet(targetType, index).singleLevelSet[level]; } /// - /// Get a prefab based on the target type, level, and block type. + /// Gets a specific prefab for a given level, block type, target type, and index. /// - /// The target type to retrieve the prefab for. - /// The level to retrieve the prefab for. - /// The block type to retrieve the size information for. - /// The prefab for the specified block. - public GameObject GetPrefab(SceneBlockContainer.Targets targetType, int level, int blockType) + /// The level index. + /// The block type index. + /// The target type (optional). + /// The index (optional). + /// The prefab object. + /// + /// If the target type (targetType) or index (index) is provided, it returns the specific prefab for the given level, block type, target type, and index. + /// If the block type index is out of range, an exception will be thrown, and an error message will be logged. + /// + public GameObject GetPrefab(int level, int blockType, Targets? targetType = null, int? index = null) { - if(blockType >= GetSingleLevelPrefabSet(targetType, level).prefabs.Length) + if (blockType >= GetSingleLevelPrefabSet(level, targetType, index).prefabs.Length) { - messageBoxController.PushMessage(new List { "[ERROR]ScenePrefabSet.GetPrefab:", " blockType out of range!","targetType = ",targetType.ToString(), "level = ",level.ToString(), "blockType = ",blockType.ToString()}, + PushSceneBlockMessages(new List { "[ERROR]ScenePrefabSet.GetPrefab:", " blockType out of range!", "targetType = ", targetType.ToString(), "level = ", level.ToString(), "blockType = ", blockType.ToString() }, new List { messageBoxController.errorColor }); Debug.LogError("ScenePrefabSet.GetPrefab:blockType out of range!"); return null; } - return GetSingleLevelPrefabSet(targetType, level).prefabs[blockType]; + return GetSingleLevelPrefabSet(level, targetType, index).prefabs[blockType]; } /// - /// Get the number of levels associated with a specific target type. + /// Gets the number of levels for a specific target type and index. /// - /// The target type to retrieve level information for. - /// The number of levels for the specified target type. - public int GetLevelNumber(SceneBlockContainer.Targets targetType) + /// The target type (optional). + /// The index (optional). + /// The number of levels. + /// + /// If the target type (targetType) or index (index) is provided, it returns the number of levels for the corresponding target type and index. + /// + public int GetLevelNumber(Targets? targetType = null, int? index = null) { - return GetAllLevlePrefabSet(targetType).singleLevelSet.Length; + return GetAllLevlePrefabSet(targetType, index).singleLevelSet.Length; } /// - /// Get the number of blocks associated with a specific target type and level. + /// Gets the number of blocks for a specific level, target type, and index. /// - /// The target type to retrieve block information for. - /// The level to retrieve block information for. - /// The number of blocks for the specified target type and level. - public int GetBlockNumber(SceneBlockContainer.Targets targetType, int level) + /// The level index. + /// The target type (optional). + /// The index (optional). + /// The number of blocks. + /// + /// If the target type (targetType) or index (index) is provided, it returns the number of blocks for the corresponding level, target type, and index. + /// + public int GetBlockNumber(int level, Targets? targetType = null, int? index = null) { - return GetSingleLevelPrefabSet(targetType, level).prefabs.Length; + return GetSingleLevelPrefabSet(level, targetType, index).prefabs.Length; } /// - /// Get the size of a block associated with a specific target type, level, and block type. + /// Gets the size of a specific block for a given level, block type, target type, and index. /// - /// The target type to retrieve block size information for. - /// The level to retrieve block size information for. - /// The type of block to retrieve size information for. - /// The size of the specified block. - public float GetBlockSize(SceneBlockContainer.Targets targetType, int level, int blockType) + /// The level index. + /// The block type index. + /// The target type (optional). + /// The index (optional). + /// The block size. + /// + /// If the target type (targetType) or index (index) is provided, it returns the size of the block for the specified level, block type, target type, and index. + /// + public float GetBlockSize(int level, int blockType, Targets? targetType = null, int? index = null) { - return GetPrefab(targetType, level, blockType).GetComponent().blockSize; + return GetPrefab(level, blockType, targetType, index).GetComponent().blockSize; + } + + /// + /// Pushes a message to the message box or debug log.推送消息到消息框或调试日志中。 + /// + /// The list of messages. + /// The list of colors. + /// + /// If the message box is enabled (isHudEnabled is true), the message will be pushed to the message box, and the messages will be colored according to the provided color list. + /// If the message box is not enabled (isHudEnabled is false), the messages will be logged as plain text in the debug log. + /// + private void PushSceneBlockMessages(List messageList, List colorList) + { + if (isHudEnabled) + { + messageBoxController.PushMessage(messageList, colorList); + } + else + { + Debug.Log(string.Join(" ", messageList)); + } } } \ No newline at end of file diff --git a/Assets/Script/SingleLevelProbabilityPanel.cs b/Assets/Script/SingleLevelProbabilityPanel.cs new file mode 100644 index 0000000..b382277 --- /dev/null +++ b/Assets/Script/SingleLevelProbabilityPanel.cs @@ -0,0 +1,70 @@ +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +public class SingleLevelProbabilityPanel : MonoBehaviour +{ + public TextMeshProUGUI levelNameText; + public TextMeshProUGUI probabilityText; + + public Slider probabilitySlider; + public float probabilityValue = 0; + + /// + /// Initialize the level probability panel, setting the level name and probability value. + /// + /// The level name. + /// The probability value. + public void InitializeLevelProbabilityPanel(string levelName, float probability) + { + SetLevelName(levelName); + SetProbability(probability); + } + + /// + /// Initialize the level probability panel, setting the level number and probability value. + /// + /// The level number. + /// The probability value. + public void InitializeLevelProbabilityPanel(int levelName, float probability) + { + SetLevelName(levelName); + SetProbability(probability); + } + + /// + /// Set the level name. + /// + /// The level name. + public void SetLevelName(string levelName) + { + levelNameText.text = levelName; + } + + /// + /// Set the level name. + /// + /// The level number. + public void SetLevelName(int levelName) + { + levelNameText.text = "Level" + levelName.ToString(); + } + + /// + /// Set the probability value. + /// + /// The probability value. + public void SetProbability(float prob) + { + probabilitySlider.value = prob; + UpdateProbabilityText(); + } + + /// + /// Update the probability text display. + /// + public void UpdateProbabilityText() + { + probabilityText.text = (probabilitySlider.value * 100).ToString("0.00") + "%"; + } +} \ No newline at end of file diff --git a/Assets/Script/SingleLevelProbabilityPanel.cs.meta b/Assets/Script/SingleLevelProbabilityPanel.cs.meta new file mode 100644 index 0000000..ac536be --- /dev/null +++ b/Assets/Script/SingleLevelProbabilityPanel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 650649b0f68385646ba7f21566945d1a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/TargetTypesEnum.cs b/Assets/Script/TargetTypesEnum.cs new file mode 100644 index 0000000..ad3aaf3 --- /dev/null +++ b/Assets/Script/TargetTypesEnum.cs @@ -0,0 +1,4 @@ +public enum Targets +{ + Free, Go, Attack, Defence, Stay, Num +}// Num is use for get total target bumber diff --git a/Assets/Script/TargetTypesEnum.cs.meta b/Assets/Script/TargetTypesEnum.cs.meta new file mode 100644 index 0000000..47013b9 --- /dev/null +++ b/Assets/Script/TargetTypesEnum.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17d9008070d061944815e4ee376ddb46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StartMenuProbabilityPanel.cs b/Assets/StartMenuProbabilityPanel.cs new file mode 100644 index 0000000..dbc3ab7 --- /dev/null +++ b/Assets/StartMenuProbabilityPanel.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using UnityEngine; + +public class StartMenuProbabilityPanel : MonoBehaviour +{ + public GameObject singleTargetLevelProbabilityPanel; + public SceneBlocksSet scenePrefabSet; + + private List targetLevelProbabilityPanel = new List(); + + private void Start() + { + for (int i = 0; i < scenePrefabSet.levels.Length; i++) + { + Targets nowTarget = scenePrefabSet.targets[i]; + targetLevelProbabilityPanel.Add(Instantiate(singleTargetLevelProbabilityPanel, transform).GetComponent()); + targetLevelProbabilityPanel[i].IntializePanels(scenePrefabSet.GetLevelNumber(nowTarget), nowTarget.ToString()); + } + } +} \ No newline at end of file diff --git a/Assets/StartMenuProbabilityPanel.cs.meta b/Assets/StartMenuProbabilityPanel.cs.meta new file mode 100644 index 0000000..e5bdee3 --- /dev/null +++ b/Assets/StartMenuProbabilityPanel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0195eb0e734c7e747bb7f8b669c80fe5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/TargetLevelProbabilityPanel.cs b/Assets/TargetLevelProbabilityPanel.cs new file mode 100644 index 0000000..b1462a2 --- /dev/null +++ b/Assets/TargetLevelProbabilityPanel.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using TMPro; +using UnityEngine; + +public class TargetLevelProbabilityPanel : MonoBehaviour +{ + public GameObject singleLevelProbabilityPanel; + public GameObject targetTitleText; + + private GameObject titleText; + private List singleLevelPanelsObjs = new List(); + private List singleLevelPanels = new List(); + + public void IntializePanels(int levelNum, string titleName) + { + // initialize target level probability panel size + float defaultWidth = singleLevelProbabilityPanel.GetComponent().sizeDelta.x; + float defaultLevelHeight = singleLevelProbabilityPanel.GetComponent().sizeDelta.y; + float titleHeight = targetTitleText.GetComponent().sizeDelta.y; + transform.GetComponent().sizeDelta = new Vector2(defaultWidth, (defaultLevelHeight * levelNum) + titleHeight); + // create title text + titleText = Instantiate(targetTitleText, transform); + titleText.GetComponent().text = titleName; + for (int i = 0; i < levelNum; i++) + { + singleLevelPanelsObjs.Add(Instantiate(singleLevelProbabilityPanel, transform)); + singleLevelPanels.Add(singleLevelPanelsObjs[i].GetComponent()); + } + } +} \ No newline at end of file diff --git a/Assets/TargetLevelProbabilityPanel.cs.meta b/Assets/TargetLevelProbabilityPanel.cs.meta new file mode 100644 index 0000000..39ec597 --- /dev/null +++ b/Assets/TargetLevelProbabilityPanel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44de9c40b3fc56046a490c8c47631d4d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UserSettings/Layouts/default-2021.dwlt b/UserSettings/Layouts/default-2021.dwlt index c59c863..e95f43a 100644 --- a/UserSettings/Layouts/default-2021.dwlt +++ b/UserSettings/Layouts/default-2021.dwlt @@ -14,12 +14,12 @@ MonoBehaviour: m_EditorClassIdentifier: m_PixelRect: serializedVersion: 2 - x: 73 - y: 51 + x: -87 + y: 118 width: 1791 height: 1021 m_ShowMode: 4 - m_Title: Console + m_Title: Hierarchy m_RootView: {fileID: 9} m_MinSize: {x: 875, y: 300} m_MaxSize: {x: 10000, y: 10000} @@ -41,7 +41,7 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 605 - width: 1054 + width: 1053 height: 366 m_MinSize: {x: 231, y: 271} m_MaxSize: {x: 10001, y: 10021} @@ -70,12 +70,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 1054 + width: 1053 height: 971 m_MinSize: {x: 100, y: 200} m_MaxSize: {x: 8096, y: 16192} vertical: 1 - controlID: 132 + controlID: 89 --- !u!114 &4 MonoBehaviour: m_ObjectHideFlags: 52 @@ -93,7 +93,7 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 436 - width: 315 + width: 313 height: 535 m_MinSize: {x: 102, y: 121} m_MaxSize: {x: 4002, y: 4021} @@ -120,14 +120,14 @@ MonoBehaviour: - {fileID: 4} m_Position: serializedVersion: 2 - x: 1054 + x: 1053 y: 0 - width: 315 + width: 313 height: 971 m_MinSize: {x: 100, y: 200} m_MaxSize: {x: 8096, y: 16192} vertical: 1 - controlID: 56 + controlID: 39 --- !u!114 &6 MonoBehaviour: m_ObjectHideFlags: 52 @@ -145,7 +145,7 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 315 + width: 313 height: 436 m_MinSize: {x: 202, y: 221} m_MaxSize: {x: 4002, y: 4021} @@ -179,7 +179,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 200} m_MaxSize: {x: 24288, y: 16192} vertical: 0 - controlID: 50 + controlID: 88 --- !u!114 &8 MonoBehaviour: m_ObjectHideFlags: 52 @@ -195,9 +195,9 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 1369 + x: 1366 y: 0 - width: 422 + width: 425 height: 971 m_MinSize: {x: 276, y: 71} m_MaxSize: {x: 4001, y: 4021} @@ -294,7 +294,7 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 1054 + width: 1053 height: 605 m_MinSize: {x: 201, y: 221} m_MaxSize: {x: 4001, y: 4021} @@ -352,10 +352,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 73 - y: 81 - width: 1053 - height: 584 + x: 65 + y: 73 + width: 1090 + height: 594 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -366,7 +366,7 @@ MonoBehaviour: m_ShowGizmos: 0 m_TargetDisplay: 0 m_ClearColor: {r: 0, g: 0, b: 0, a: 0} - m_TargetSize: {x: 1053, y: 563} + m_TargetSize: {x: 1090, y: 573} m_TextureFilterMode: 0 m_TextureHideFlags: 61 m_RenderIMGUI: 1 @@ -381,10 +381,10 @@ MonoBehaviour: m_VRangeLocked: 0 hZoomLockedByDefault: 0 vZoomLockedByDefault: 0 - m_HBaseRangeMin: -526.5 - m_HBaseRangeMax: 526.5 - m_VBaseRangeMin: -281.5 - m_VBaseRangeMax: 281.5 + m_HBaseRangeMin: -545 + m_HBaseRangeMax: 545 + m_VBaseRangeMin: -286.5 + m_VBaseRangeMax: 286.5 m_HAllowExceedBaseRangeMin: 1 m_HAllowExceedBaseRangeMax: 1 m_VAllowExceedBaseRangeMin: 1 @@ -402,23 +402,23 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 21 - width: 1053 - height: 563 + width: 1090 + height: 573 m_Scale: {x: 1, y: 1} - m_Translation: {x: 526.5, y: 281.5} + m_Translation: {x: 545, y: 286.5} m_MarginLeft: 0 m_MarginRight: 0 m_MarginTop: 0 m_MarginBottom: 0 m_LastShownAreaInsideMargins: serializedVersion: 2 - x: -526.5 - y: -281.5 - width: 1053 - height: 563 + x: -545 + y: -286.5 + width: 1090 + height: 573 m_MinimalGUI: 1 m_defaultScale: 1 - m_LastWindowPixelSize: {x: 1053, y: 584} + m_LastWindowPixelSize: {x: 1090, y: 594} m_ClearInEditMode: 1 m_NoCameraWarning: 1 m_LowResolutionForAspectRatios: 01000000000000000000 @@ -472,9 +472,9 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 73 - y: 686 - width: 1053 + x: -87 + y: 753 + width: 1052 height: 345 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: @@ -493,22 +493,22 @@ MonoBehaviour: m_SkipHidden: 0 m_SearchArea: 1 m_Folders: - - Assets/Shader + - Assets/Script m_Globs: [] m_OriginalText: m_ViewMode: 1 m_StartGridSize: 16 m_LastFolders: - - Assets/Shader + - Assets/Script m_LastFoldersGridSize: 16 m_LastProjectPath: C:\Users\UCUNI\OneDrive\Unity\ML-Agents\Aimbot-ParallelEnv m_LockTracker: m_IsLocked: 0 m_FolderTreeState: - scrollPos: {x: 0, y: 187} - m_SelectedIDs: aa7c0000 - m_LastClickedID: 31914 - m_ExpandedIDs: 00000000647c0000667c0000687c00006a7c00006c7c00006e7c0000707c0000727c0000747c0000767c0000787c00007a7c00007c7c00007e7c0000807c0000827c0000847c00008c7c000000ca9a3b + scrollPos: {x: 0, y: 277} + m_SelectedIDs: 4e680000 + m_LastClickedID: 26702 + m_ExpandedIDs: 000000003a6800003c6800003e68000040680000426800004468000046680000486800004a6800004c6800004e68000050680000526800005468000056680000586800005a6800005c6800007668000000ca9a3bffffff7f m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -536,7 +536,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 00000000647c0000667c0000687c00006a7c00006c7c00006e7c0000707c0000727c0000747c0000767c0000787c00007a7c00007c7c00007e7c0000807c0000827c0000847c0000 + m_ExpandedIDs: 000000003a6800003c6800003e68000040680000426800004468000046680000486800004a6800004c6800004e68000050680000526800005468000056680000586800005a6800005c680000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -567,18 +567,18 @@ MonoBehaviour: m_ExpandedInstanceIDs: c62300008a5c000000000000 m_RenameOverlay: m_UserAcceptedRename: 0 - m_Name: - m_OriginalName: + m_Name: SingleLevelProbabilityPanel + m_OriginalName: SingleLevelProbabilityPanel m_EditFieldRect: serializedVersion: 2 x: 0 y: 0 width: 0 height: 0 - m_UserData: 0 + m_UserData: 26964 m_IsWaitingForDelay: 0 m_IsRenaming: 0 - m_OriginalEventType: 11 + m_OriginalEventType: 0 m_IsRenamingFilename: 1 m_ClientGUIView: {fileID: 2} m_CreateAssetUtility: @@ -612,9 +612,9 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 1442 - y: 81 - width: 421 + x: 1279 + y: 148 + width: 424 height: 950 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: @@ -627,7 +627,7 @@ MonoBehaviour: m_ControlHash: -371814159 m_PrefName: Preview_InspectorPreview m_LastInspectedObjectInstanceID: -1 - m_LastVerticalScrollValue: 0 + m_LastVerticalScrollValue: 136 m_GlobalObjectId: m_InspectorMode: 0 m_LockTracker: @@ -653,9 +653,9 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 1127 - y: 81 - width: 313 + x: 966 + y: 148 + width: 311 height: 415 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: @@ -664,9 +664,9 @@ MonoBehaviour: m_SceneHierarchy: m_TreeViewState: scrollPos: {x: 0, y: 0} - m_SelectedIDs: 909c0000 - m_LastClickedID: 40080 - m_ExpandedIDs: f4dcfffffaddffff3adfffffb0efffff32fbffffa880000040820000329c0000 + m_SelectedIDs: + m_LastClickedID: 0 + m_ExpandedIDs: 32fbffffbc660000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -710,9 +710,9 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 73 - y: 81 - width: 1053 + x: -87 + y: 148 + width: 1052 height: 584 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: @@ -948,9 +948,9 @@ MonoBehaviour: m_PlayAudio: 0 m_AudioPlay: 0 m_Position: - m_Target: {x: 439.49188, y: 302.87244, z: -4.527011} + m_Target: {x: 309, y: 406.5, z: 0} speed: 2 - m_Value: {x: 439.49188, y: 302.87244, z: -4.527011} + m_Value: {x: 174.87366, y: 516.551, z: 0.7980051} m_RenderMode: 0 m_CameraMode: drawMode: 0 @@ -1001,9 +1001,9 @@ MonoBehaviour: speed: 2 m_Value: {x: 0, y: 0, z: 0, w: 1} m_Size: - m_Target: 364.57574 + m_Target: 332.71008 speed: 2 - m_Value: 364.57574 + m_Value: 76.217804 m_Ortho: m_Target: 1 speed: 2 @@ -1021,7 +1021,7 @@ MonoBehaviour: m_FarClip: 10000 m_DynamicClip: 1 m_OcclusionCulling: 0 - m_LastSceneViewRotation: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226} + m_LastSceneViewRotation: {x: -0.19993632, y: -0.012642198, z: 0.0025799773, w: -0.97972375} m_LastSceneViewOrtho: 0 m_ReplacementShader: {fileID: 0} m_ReplacementString: @@ -1048,9 +1048,9 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 1127 - y: 517 - width: 313 + x: 966 + y: 584 + width: 311 height: 514 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: