Add Message Box & TimeLimit Change Button
Add Message Box & TimeLimit Change Button. Start Using XXManager to keep script, now changed in UIManger GameObject.
This commit is contained in:
parent
885dbb92e9
commit
1aaf6c7069
@ -1 +1 @@
|
||||
{"count":1,"self":76.1056064,"total":77.0151326,"children":{"InitializeActuators":{"count":2,"self":0.0010002,"total":0.0010002,"children":null},"InitializeSensors":{"count":2,"self":0.0010006,"total":0.0010006,"children":null},"AgentSendState":{"count":3525,"self":0.020509199999999998,"total":0.045513399999999996,"children":{"CollectObservations":{"count":3525,"self":0.014000199999999999,"total":0.014000199999999999,"children":null},"WriteActionMask":{"count":3525,"self":0.0015004999999999999,"total":0.0015004999999999999,"children":null},"RequestDecision":{"count":3525,"self":0.0095035,"total":0.0095035,"children":null}}},"DecideAction":{"count":3525,"self":0.0245083,"total":0.0245083,"children":null},"AgentAct":{"count":3525,"self":0.83650059999999993,"total":0.83650059999999993,"children":null}},"gauges":{"AKMAgent.CumulativeReward":{"count":2,"max":206.058914,"min":20.96005,"runningAverage":113.509483,"value":206.058914,"weightedAverage":67.2347641}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1662472464","unity_version":"2020.3.19f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2020.3.19f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-PPO\\Aimbot-PPO-MultiScene -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId 209fdf30-2c1f-11ed-916f-33e85f4223cc -accessToken 5GeE0MPO4nIT2FtMaaxUH4hsA72o91Oemjld-dVfVXY00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.0","scene_name":"InGame","end_time_seconds":"1662472541"}}
|
||||
{"count":1,"self":116.3625216,"total":117.6937916,"children":{"InitializeActuators":{"count":2,"self":0.0010000999999999999,"total":0.0010000999999999999,"children":null},"InitializeSensors":{"count":2,"self":0.0010000999999999999,"total":0.0010000999999999999,"children":null},"AgentSendState":{"count":5234,"self":0.0425063,"total":0.074009499999999992,"children":{"CollectObservations":{"count":5234,"self":0.0149973,"total":0.0149973,"children":null},"WriteActionMask":{"count":5234,"self":0.005502,"total":0.005502,"children":null},"RequestDecision":{"count":5234,"self":0.011003899999999999,"total":0.011003899999999999,"children":null}}},"DecideAction":{"count":5234,"self":0.0335113,"total":0.0335113,"children":null},"AgentAct":{"count":5234,"self":1.2207531,"total":1.2207531,"children":null}},"gauges":{"AKMAgent.CumulativeReward":{"count":1,"max":-243.509537,"min":-243.509537,"runningAverage":-243.509537,"value":-243.509537,"weightedAverage":-243.509537}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1662500472","unity_version":"2020.3.19f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2020.3.19f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-PPO\\Aimbot-PPO-MultiScene -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId 209fdf30-2c1f-11ed-916f-33e85f4223cc -accessToken 78EBbrn-dg5kE__h3rNOqQVTDU3b1xUmmwWF1c5sFLc00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.0","scene_name":"InGame","end_time_seconds":"1662500589"}}
|
@ -1 +1 @@
|
||||
{"count":1,"self":5.485704,"total":5.4877040999999993,"children":{"InitializeActuators":{"count":2,"self":0.0010002,"total":0.0010002,"children":null},"InitializeSensors":{"count":2,"self":0.0010000999999999999,"total":0.0010000999999999999,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1662470064","unity_version":"2020.3.19f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2020.3.19f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-PPO\\Aimbot-PPO-MultiScene -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId 209fdf30-2c1f-11ed-916f-33e85f4223cc -accessToken 5GeE0MPO4nIT2FtMaaxUH4hsA72o91Oemjld-dVfVXY00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.0","scene_name":"Start","end_time_seconds":"1662470069"}}
|
||||
{"count":1,"self":114.25904639999999,"total":114.62062499999999,"children":{"InitializeActuators":{"count":2,"self":0.0010000999999999999,"total":0.0010000999999999999,"children":null},"InitializeSensors":{"count":2,"self":0.0010002,"total":0.0010002,"children":null},"AgentSendState":{"count":1382,"self":0.0080028,"total":0.0195053,"children":{"CollectObservations":{"count":1382,"self":0.0070022999999999995,"total":0.0070022999999999995,"children":null},"WriteActionMask":{"count":1382,"self":0.0004994,"total":0.0004994,"children":null},"RequestDecision":{"count":1382,"self":0.0040008,"total":0.0040008,"children":null}}},"DecideAction":{"count":1382,"self":0.0110034,"total":0.0110034,"children":null},"AgentAct":{"count":1382,"self":0.3290731,"total":0.3290731,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1662500099","unity_version":"2020.3.19f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2020.3.19f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-PPO\\Aimbot-PPO-MultiScene -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId 209fdf30-2c1f-11ed-916f-33e85f4223cc -accessToken 78EBbrn-dg5kE__h3rNOqQVTDU3b1xUmmwWF1c5sFLc00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.0","scene_name":"Start","end_time_seconds":"1662500214"}}
|
81
Aimbot-PPO-MultiScene/Assets/Prefeb/MessageContents.prefab
Normal file
81
Aimbot-PPO-MultiScene/Assets/Prefeb/MessageContents.prefab
Normal file
@ -0,0 +1,81 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &6669642163532043162
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 581278746850413839}
|
||||
- component: {fileID: 7135961816703934414}
|
||||
- component: {fileID: 6853888537037025558}
|
||||
m_Layer: 5
|
||||
m_Name: MessageContents
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &581278746850413839
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6669642163532043162}
|
||||
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_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: 993, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7135961816703934414
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6669642163532043162}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6853888537037025558
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6669642163532043162}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 979318e2cdafc0e43bfd56bb63011857, type: 3}
|
||||
m_FontSize: 23
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 2
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 1
|
||||
m_LineSpacing: 1
|
||||
m_Text: MessageContents
|
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8fb23282ce09a84c8d0907986c5189e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@ -202,6 +202,161 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 42682887}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &83479713
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 83479714}
|
||||
- component: {fileID: 83479717}
|
||||
- component: {fileID: 83479716}
|
||||
- component: {fileID: 83479715}
|
||||
m_Layer: 5
|
||||
m_Name: TimeLimitInput
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &83479714
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 83479713}
|
||||
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_Children:
|
||||
- {fileID: 1199381300}
|
||||
- {fileID: 1577094367}
|
||||
m_Father: {fileID: 1544423167}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 80, y: 0}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &83479715
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 83479713}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, 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: 83479716}
|
||||
m_TextComponent: {fileID: 1577094368}
|
||||
m_Placeholder: {fileID: 1199381301}
|
||||
m_ContentType: 2
|
||||
m_InputType: 0
|
||||
m_AsteriskChar: 42
|
||||
m_KeyboardType: 4
|
||||
m_LineType: 0
|
||||
m_HideMobileInput: 0
|
||||
m_CharacterValidation: 1
|
||||
m_CharacterLimit: 0
|
||||
m_OnEndEdit:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 1544423168}
|
||||
m_TargetAssemblyTypeName: StartSceneTimeLimChanger, Assembly-CSharp
|
||||
m_MethodName: onValueTimeChanged
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_CustomCaretColor: 0
|
||||
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
|
||||
m_Text:
|
||||
m_CaretBlinkRate: 0.85
|
||||
m_CaretWidth: 1
|
||||
m_ReadOnly: 0
|
||||
m_ShouldActivateOnSelect: 1
|
||||
--- !u!114 &83479716
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 83479713}
|
||||
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: 10911, 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!222 &83479717
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 83479713}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &112144285
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3838,6 +3993,164 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1086771387}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1165772550
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1165772551}
|
||||
- component: {fileID: 1165772553}
|
||||
- component: {fileID: 1165772552}
|
||||
m_Layer: 5
|
||||
m_Name: TimeLimitText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1165772551
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1165772550}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 1544423167}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -48.5, y: 0}
|
||||
m_SizeDelta: {x: 80, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1165772552
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1165772550}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 979318e2cdafc0e43bfd56bb63011857, type: 3}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 5
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: Time Limit
|
||||
--- !u!222 &1165772553
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1165772550}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1199381299
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1199381300}
|
||||
- component: {fileID: 1199381302}
|
||||
- component: {fileID: 1199381301}
|
||||
m_Layer: 5
|
||||
m_Name: Placeholder
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1199381300
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1199381299}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 83479714}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 5, y: 0}
|
||||
m_SizeDelta: {x: -10, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1199381301
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1199381299}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 979318e2cdafc0e43bfd56bb63011857, type: 3}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 2
|
||||
m_BestFit: 0
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: 30
|
||||
--- !u!222 &1199381302
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1199381299}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1214676943
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -4094,6 +4407,7 @@ RectTransform:
|
||||
- {fileID: 1546066800}
|
||||
- {fileID: 2046915484}
|
||||
- {fileID: 289162992}
|
||||
- {fileID: 1544423167}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@ -4279,7 +4593,6 @@ MonoBehaviour:
|
||||
killRewardDefault: 10
|
||||
winRewardDefault: 20
|
||||
loseRewardDefault: -10
|
||||
EnemyNumDefault: 3
|
||||
--- !u!4 &1483319558
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -4412,6 +4725,59 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: 50, y: -46}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &1544423166
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1544423167}
|
||||
- component: {fileID: 1544423168}
|
||||
m_Layer: 5
|
||||
m_Name: TimeLimit
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1544423167
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1544423166}
|
||||
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_Children:
|
||||
- {fileID: 83479714}
|
||||
- {fileID: 1165772551}
|
||||
m_Father: {fileID: 1375409014}
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 214, y: -320}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1544423168
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1544423166}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7857e2b2e5caf6b4686c4a7d87fa998e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
DataTransfer: {fileID: 1483319556}
|
||||
TimeLimText: {fileID: 1165772552}
|
||||
TimelimInput: {fileID: 83479715}
|
||||
--- !u!1 &1546066799
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -4489,6 +4855,85 @@ MonoBehaviour:
|
||||
killRInputText: {fileID: 350269942}
|
||||
winRInputText: {fileID: 658127038}
|
||||
loseRInputText: {fileID: 1792678410}
|
||||
--- !u!1 &1577094366
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1577094367}
|
||||
- component: {fileID: 1577094369}
|
||||
- component: {fileID: 1577094368}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1577094367
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1577094366}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 83479714}
|
||||
m_RootOrder: 1
|
||||
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.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1577094368
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1577094366}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 0
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 1
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text:
|
||||
--- !u!222 &1577094369
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1577094366}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1633180791
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -5900,7 +6345,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 214, y: -317.9}
|
||||
m_AnchoredPosition: {x: 214, y: -348.5}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2046915485
|
||||
|
@ -90,7 +90,8 @@ public class AgentWithGun : Agent
|
||||
[System.NonSerialized] public float loseReward;
|
||||
[System.NonSerialized] public float killReward;
|
||||
[System.NonSerialized] public float saveNow = 0;
|
||||
|
||||
[System.NonSerialized] public int remainTime;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
@ -102,6 +103,9 @@ public class AgentWithGun : Agent
|
||||
// Enemy Num
|
||||
enemyNum = DataTransfer.EnemyNum;
|
||||
|
||||
// Time Limit
|
||||
timeLimit = DataTransfer.Timelim;
|
||||
|
||||
// get load directory.
|
||||
LoadDirDate = DataTransfer.LoadDirDate;
|
||||
LoadDirTime = DataTransfer.LoadDirTime;
|
||||
@ -129,7 +133,10 @@ public class AgentWithGun : Agent
|
||||
// change Decision Period & Take Actions Between Decisions
|
||||
transform.GetComponent<DecisionRequester>().DecisionPeriod = DataTransfer.DecisionPeriod;
|
||||
transform.GetComponent<DecisionRequester>().TakeActionsBetweenDecisions = DataTransfer.ActionsBetweenDecisions;
|
||||
}
|
||||
|
||||
//initialize remainTime
|
||||
remainTime = (int)(timeLimit - Time.time + startTime);
|
||||
}
|
||||
|
||||
/* ----------此Update用于debug,Build前删除或注释掉!----------*/
|
||||
/*void Update()
|
||||
@ -528,7 +535,7 @@ public class AgentWithGun : Agent
|
||||
// loseRewardIn = actionBuffers.ContinuousActions[6];
|
||||
//float killRewardIn = actionBuffers.ContinuousActions[7];
|
||||
//Rewards Update
|
||||
int remainTime = (int)(timeLimit - Time.time + startTime);
|
||||
remainTime = (int)(timeLimit - Time.time + startTime);
|
||||
|
||||
//应用输入
|
||||
shoot = mouseShoot;
|
||||
|
81
Aimbot-PPO-MultiScene/Assets/Script/InGame/InGameMessages.cs
Normal file
81
Aimbot-PPO-MultiScene/Assets/Script/InGame/InGameMessages.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class InGameMessages : MonoBehaviour
|
||||
{
|
||||
public GameObject MessageBox; // scrollView contents
|
||||
public GameObject TextPrefab; // TextPrefab
|
||||
public int maxMassages = 25;
|
||||
|
||||
public Color infoColor = Color.white;
|
||||
public Color successColor = Color.green;
|
||||
public Color errorColor = Color.red;
|
||||
public Color warningColor = Color.yellow;
|
||||
|
||||
[System.NonSerialized]List<Message> messageList = new List<Message>();
|
||||
|
||||
public void SendMessagetoBox(string text,Message.MessageType messageType = Message.MessageType.info)
|
||||
{
|
||||
if (messageList.Count > maxMassages)
|
||||
{
|
||||
// keep mesages under maxMassages
|
||||
Destroy(messageList[0].textOBJ.gameObject);
|
||||
messageList.Remove(messageList[0]);
|
||||
}
|
||||
// add timestamp
|
||||
string date = "[" + DateTime.Now.ToString("MMdd_hh:mm:ss") + "] ";
|
||||
text = date + text;
|
||||
|
||||
Message newMessage = new Message();
|
||||
newMessage.text = text;
|
||||
|
||||
GameObject newText = Instantiate(TextPrefab, MessageBox.transform);
|
||||
newMessage.textOBJ = newText.GetComponent<Text>();
|
||||
newMessage.textOBJ.text = newMessage.text;
|
||||
newMessage.textOBJ.color = MessageTypeColor(messageType);
|
||||
|
||||
messageList.Add(newMessage);
|
||||
}
|
||||
|
||||
// parse messageType to Color
|
||||
Color MessageTypeColor(Message.MessageType messageType)
|
||||
{
|
||||
Color thisColor = infoColor;
|
||||
switch (messageType)
|
||||
{
|
||||
case Message.MessageType.info:
|
||||
thisColor = infoColor;
|
||||
break;
|
||||
case Message.MessageType.success:
|
||||
thisColor = successColor;
|
||||
break;
|
||||
case Message.MessageType.error:
|
||||
thisColor = errorColor;
|
||||
break;
|
||||
case Message.MessageType.warnning:
|
||||
thisColor = warningColor;
|
||||
break;
|
||||
}
|
||||
return thisColor;
|
||||
}
|
||||
}
|
||||
|
||||
// Message Class
|
||||
[System.Serializable]
|
||||
public class Message
|
||||
{
|
||||
public string text;
|
||||
public Text textOBJ;
|
||||
public MessageType messageType;
|
||||
|
||||
public enum MessageType
|
||||
{
|
||||
info,
|
||||
success,
|
||||
error,
|
||||
warnning
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 414edca99b7a04940a0801ec06c99007
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -8,21 +8,21 @@ public class RealTimeEnemyNumChanger : MonoBehaviour
|
||||
|
||||
public InputField enemyNumInputField;
|
||||
public Text enemyNumPlaceholder;
|
||||
public Text enemyNumAddInfoText;
|
||||
|
||||
private void Start()
|
||||
public void EnemyChangeBTPresses()
|
||||
{
|
||||
enemyNumAddInfoText.text = "";
|
||||
}
|
||||
AgentWithGun agentWithGun = Agent.GetComponent<AgentWithGun>();
|
||||
InGameMessages messenger = gameObject.GetComponent<InGameMessages>();
|
||||
int enemyNum = Math.Abs(int.Parse(enemyNumInputField.GetComponent<InputField>().text));
|
||||
|
||||
|
||||
public void nonRBTPresses()
|
||||
{
|
||||
if (enemyNumInputField.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
// input chara not illegal
|
||||
enemyNumPlaceholder.color = Color.red;
|
||||
enemyNumPlaceholder.text = "Wrong Type!";
|
||||
enemyNumInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Wrong enemyNum Type!", Message.MessageType.error);
|
||||
}
|
||||
else if (enemyNumInputField.GetComponent<InputField>().text == "")
|
||||
{
|
||||
@ -35,10 +35,9 @@ public class RealTimeEnemyNumChanger : MonoBehaviour
|
||||
// good to go~
|
||||
enemyNumPlaceholder.color = Color.gray;
|
||||
enemyNumPlaceholder.text = "nonR";
|
||||
string num = enemyNumInputField.GetComponent<InputField>().text;
|
||||
Agent.GetComponent<AgentWithGun>().enemyNum = Math.Abs(int.Parse(num));
|
||||
agentWithGun.enemyNum = enemyNum;
|
||||
enemyNumInputField.GetComponent<InputField>().text = "";
|
||||
enemyNumAddInfoText.text = $"Enemy Num = {num} add Success. Valid in the next round.";
|
||||
messenger.SendMessagetoBox($"Enemy Num = {enemyNum} add Success. Valid in the next round.", Message.MessageType.success);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,15 +23,23 @@ public class RealTimeRewardChanger : MonoBehaviour
|
||||
public Text winRPlaceholder;
|
||||
public Text loseRPlaceholder;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void nonRBTPresses()
|
||||
{
|
||||
InGameMessages messenger = gameObject.GetComponent<InGameMessages>();
|
||||
if (nonRInputField.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
// input chara not illegal
|
||||
nonRPlaceholder.color = Color.red;
|
||||
nonRPlaceholder.text = "Wrong Type!";
|
||||
nonRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Wrong Reward Type!", Message.MessageType.error);
|
||||
|
||||
}else if (nonRInputField.GetComponent<InputField>().text == "")
|
||||
{
|
||||
// empty chara
|
||||
@ -46,17 +54,20 @@ public class RealTimeRewardChanger : MonoBehaviour
|
||||
string reward = nonRInputField.GetComponent<InputField>().text;
|
||||
Agent.GetComponent<AgentWithGun>().nonReward = float.Parse(reward);
|
||||
nonRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Reward nonR change Success",Message.MessageType.success);
|
||||
}
|
||||
}
|
||||
|
||||
public void shootRBTPresses()
|
||||
{
|
||||
InGameMessages messenger = gameObject.GetComponent<InGameMessages>();
|
||||
if (shootRInputField.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
// input chara not illegal
|
||||
shootRPlaceholder.color = Color.red;
|
||||
shootRPlaceholder.text = "Wrong Type!";
|
||||
shootRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Wrong Reward Type!", Message.MessageType.error);
|
||||
}
|
||||
else if (shootRInputField.GetComponent<InputField>().text == "")
|
||||
{
|
||||
@ -72,17 +83,20 @@ public class RealTimeRewardChanger : MonoBehaviour
|
||||
string reward = shootRInputField.GetComponent<InputField>().text;
|
||||
Agent.GetComponent<AgentWithGun>().shootReward = float.Parse(reward);
|
||||
shootRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Reward shootR change Success",Message.MessageType.success);
|
||||
}
|
||||
}
|
||||
|
||||
public void shootWithoutReadyRBTPresses()
|
||||
{
|
||||
InGameMessages messenger = gameObject.GetComponent<InGameMessages>();
|
||||
if (shootWithoutReadyRInputField.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
// input chara not illegal
|
||||
shootWithoutReadyRPlaceholder.color = Color.red;
|
||||
shootWithoutReadyRPlaceholder.text = "Wrong Type!";
|
||||
shootWithoutReadyRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Wrong Reward Type!", Message.MessageType.error);
|
||||
}
|
||||
else if (shootWithoutReadyRInputField.GetComponent<InputField>().text == "")
|
||||
{
|
||||
@ -98,17 +112,20 @@ public class RealTimeRewardChanger : MonoBehaviour
|
||||
string reward = shootWithoutReadyRInputField.GetComponent<InputField>().text;
|
||||
Agent.GetComponent<AgentWithGun>().shootWithoutReadyReward = float.Parse(reward);
|
||||
shootWithoutReadyRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Reward SWORR change Success",Message.MessageType.success);
|
||||
}
|
||||
}
|
||||
|
||||
public void hitRBTPresses()
|
||||
{
|
||||
InGameMessages messenger = gameObject.GetComponent<InGameMessages>();
|
||||
if (hitRInputField.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
// input chara not illegal
|
||||
hitRPlaceholder.color = Color.red;
|
||||
hitRPlaceholder.text = "Wrong Type!";
|
||||
hitRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Wrong Reward Type!", Message.MessageType.error);
|
||||
}
|
||||
else if (hitRInputField.GetComponent<InputField>().text == "")
|
||||
{
|
||||
@ -124,17 +141,20 @@ public class RealTimeRewardChanger : MonoBehaviour
|
||||
string reward = hitRInputField.GetComponent<InputField>().text;
|
||||
Agent.GetComponent<AgentWithGun>().hitReward = float.Parse(reward);
|
||||
hitRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Reward hitR change Success",Message.MessageType.success);
|
||||
}
|
||||
}
|
||||
|
||||
public void killRBTPresses()
|
||||
{
|
||||
InGameMessages messenger = gameObject.GetComponent<InGameMessages>();
|
||||
if (killRInputField.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
// input chara not illegal
|
||||
killRPlaceholder.color = Color.red;
|
||||
killRPlaceholder.text = "Wrong Type!";
|
||||
killRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Wrong Reward Type!", Message.MessageType.error);
|
||||
}
|
||||
else if (killRInputField.GetComponent<InputField>().text == "")
|
||||
{
|
||||
@ -150,17 +170,20 @@ public class RealTimeRewardChanger : MonoBehaviour
|
||||
string reward = killRInputField.GetComponent<InputField>().text;
|
||||
Agent.GetComponent<AgentWithGun>().killReward = float.Parse(reward);
|
||||
killRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Reward killR change Success",Message.MessageType.success);
|
||||
}
|
||||
}
|
||||
|
||||
public void winRBTPresses()
|
||||
{
|
||||
InGameMessages messenger = gameObject.GetComponent<InGameMessages>();
|
||||
if (winRInputField.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
// input chara not illegal
|
||||
winRPlaceholder.color = Color.red;
|
||||
winRPlaceholder.text = "Wrong Type!";
|
||||
winRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Wrong Reward Type!", Message.MessageType.error);
|
||||
}
|
||||
else if (winRInputField.GetComponent<InputField>().text == "")
|
||||
{
|
||||
@ -176,17 +199,20 @@ public class RealTimeRewardChanger : MonoBehaviour
|
||||
string reward = winRInputField.GetComponent<InputField>().text;
|
||||
Agent.GetComponent<AgentWithGun>().winReward = float.Parse(reward);
|
||||
winRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Reward winR change Success", Message.MessageType.success);
|
||||
}
|
||||
}
|
||||
|
||||
public void loseRBTPresses()
|
||||
{
|
||||
InGameMessages messenger = gameObject.GetComponent<InGameMessages>();
|
||||
if (loseRInputField.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
// input chara not illegal
|
||||
loseRPlaceholder.color = Color.red;
|
||||
loseRPlaceholder.text = "Wrong Type!";
|
||||
loseRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Wrong Reward Type!", Message.MessageType.error);
|
||||
}
|
||||
else if (loseRInputField.GetComponent<InputField>().text == "")
|
||||
{
|
||||
@ -202,6 +228,7 @@ public class RealTimeRewardChanger : MonoBehaviour
|
||||
string reward = loseRInputField.GetComponent<InputField>().text;
|
||||
Agent.GetComponent<AgentWithGun>().loseReward = float.Parse(reward);
|
||||
loseRInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Reward loseR change Success",Message.MessageType.success);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class RealTimeTimeLimitChanger : MonoBehaviour
|
||||
{
|
||||
public GameObject Agent;
|
||||
|
||||
public InputField TimeLimInputField;
|
||||
public Text TimeLimPlaceholder;
|
||||
|
||||
public void BTPressed()
|
||||
{
|
||||
AgentWithGun agentWithGun = Agent.GetComponent<AgentWithGun>();
|
||||
InGameMessages messenger = gameObject.GetComponent<InGameMessages>();
|
||||
int timeLimit = Math.Abs(int.Parse(TimeLimInputField.GetComponent<InputField>().text));
|
||||
|
||||
if (TimeLimInputField.GetComponent<InputField>().text == "-")
|
||||
{
|
||||
// input chara not illegal
|
||||
TimeLimPlaceholder.color = Color.red;
|
||||
TimeLimPlaceholder.text = "Wrong Type!";
|
||||
TimeLimInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox("Wrong timeLimit Type!", Message.MessageType.error);
|
||||
}
|
||||
else if (TimeLimInputField.GetComponent<InputField>().text == "")
|
||||
{
|
||||
// empty chara
|
||||
TimeLimPlaceholder.color = Color.gray;
|
||||
TimeLimPlaceholder.text = "TimeLim";
|
||||
}
|
||||
else
|
||||
{
|
||||
int remainTime = agentWithGun.remainTime;
|
||||
// make sure new timeLimit is greater than remainTime;
|
||||
if (timeLimit <= remainTime)
|
||||
{
|
||||
TimeLimPlaceholder.color = Color.red;
|
||||
TimeLimPlaceholder.text = "Error";
|
||||
messenger.SendMessagetoBox($"New time should greater than remainTime({remainTime})",Message.MessageType.error);
|
||||
}
|
||||
else
|
||||
{
|
||||
// good to go~
|
||||
TimeLimPlaceholder.color = Color.gray;
|
||||
TimeLimPlaceholder.text = "TimeLim";
|
||||
agentWithGun.timeLimit = timeLimit;
|
||||
TimeLimInputField.GetComponent<InputField>().text = "";
|
||||
messenger.SendMessagetoBox($"Time Limit changed to {timeLimit}",Message.MessageType.success);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 604d05168c977c04887a3add62ce34da
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -15,7 +15,6 @@ public class StartSceneEnemyNumChanger : MonoBehaviour
|
||||
if (EnemyNumInput.GetComponent<InputField>().text == "" || EnemyNumInput.GetComponent<InputField>().text.Contains("-"))
|
||||
{
|
||||
EnemyNumText.color = Color.gray;
|
||||
DataTransfer.GetComponent<StartSeneData>().nonReward = DataTransfer.GetComponent<StartSeneData>().EnemyNumDefault;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class StartSceneTimeLimChanger : MonoBehaviour
|
||||
{
|
||||
public GameObject DataTransfer;
|
||||
public Text TimeLimText;
|
||||
public InputField TimelimInput;
|
||||
|
||||
public void onValueTimeChanged()
|
||||
{
|
||||
if (TimelimInput.GetComponent<InputField>().text == "" || TimelimInput.GetComponent<InputField>().text.Contains("-"))
|
||||
{
|
||||
TimeLimText.color = Color.gray;
|
||||
}
|
||||
else
|
||||
{
|
||||
TimeLimText.color = Color.yellow;
|
||||
DataTransfer.GetComponent<StartSeneData>().Timelim = Math.Abs(int.Parse(TimelimInput.GetComponent<InputField>().text));
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7857e2b2e5caf6b4686c4a7d87fa998e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -19,21 +19,23 @@ public class StartSeneData : MonoBehaviour
|
||||
[System.NonSerialized]public string LoadDirTime = "0";
|
||||
|
||||
// Rewards
|
||||
[System.NonSerialized]public float nonReward;
|
||||
[System.NonSerialized] public float nonReward;
|
||||
[System.NonSerialized] public float shootReward;
|
||||
[System.NonSerialized]public float shootWithoutReadyReward;
|
||||
[System.NonSerialized]public float hitReward;
|
||||
[System.NonSerialized]public float killReward;
|
||||
[System.NonSerialized]public float winReward;
|
||||
[System.NonSerialized]public float loseReward;
|
||||
[System.NonSerialized] public float shootWithoutReadyReward;
|
||||
[System.NonSerialized] public float hitReward;
|
||||
[System.NonSerialized] public float killReward;
|
||||
[System.NonSerialized] public float winReward;
|
||||
[System.NonSerialized] public float loseReward;
|
||||
|
||||
// DecisionPeriod
|
||||
[System.NonSerialized]public int DecisionPeriod = 1;
|
||||
[System.NonSerialized]public bool ActionsBetweenDecisions = true;
|
||||
[System.NonSerialized] public int DecisionPeriod = 1;
|
||||
[System.NonSerialized] public bool ActionsBetweenDecisions = true;
|
||||
|
||||
// EnemyNum
|
||||
public int EnemyNumDefault = 3;
|
||||
[System.NonSerialized]public int EnemyNum = 3;
|
||||
[System.NonSerialized] public int EnemyNum = 3;
|
||||
|
||||
// TimeLimit
|
||||
[System.NonSerialized] public int Timelim = 30;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user