分离Parameter为Common Parameter和会随着游戏State改变的Parameter。

将不需要public的一些变量改为private。
This commit is contained in:
Koha9 2023-10-23 01:54:30 +09:00
parent 6603b23eb2
commit 6091dca65d
33 changed files with 834 additions and 43747 deletions

View File

@ -1 +1 @@
{"count":1,"self":6.6978924,"total":6.7403838,"children":{"InitializeActuators":{"count":2,"self":0.002,"total":0.002,"children":null},"InitializeSensors":{"count":2,"self":0.001,"total":0.001,"children":null},"AgentSendState":{"count":96,"self":0.0014992999999999999,"total":0.010006899999999999,"children":{"CollectObservations":{"count":96,"self":0.0050103,"total":0.0050103,"children":null},"WriteActionMask":{"count":96,"self":0.0014992,"total":0.0014992,"children":null},"RequestDecision":{"count":96,"self":0.0019981,"total":0.0019981,"children":null}}},"DecideAction":{"count":96,"self":0.0029998,"total":0.0029998,"children":null},"AgentAct":{"count":96,"self":0.0259858,"total":0.0259858,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1696776760","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-XEerV7kYNt9lW-ScfLTdo -hubSessionId d21180ac-2b2e-4464-bc29-90cd6d320fc3 -accessToken FUlk05mLlb2dcwVANd09HxpJmsCNwwFXO6GIY0FY5_c00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Play","end_time_seconds":"1696776767"}}
{"count":1,"self":6.87364,"total":6.9109843,"children":{"InitializeActuators":{"count":2,"self":0.0010012999999999999,"total":0.0010012999999999999,"children":null},"InitializeSensors":{"count":2,"self":0.0010003,"total":0.0010003,"children":null},"AgentSendState":{"count":99,"self":0.00050139999999999994,"total":0.0069993,"children":{"CollectObservations":{"count":99,"self":0.0049989,"total":0.0049989,"children":null},"WriteActionMask":{"count":99,"self":0,"total":0,"children":null},"RequestDecision":{"count":99,"self":0.001499,"total":0.001499,"children":null}}},"DecideAction":{"count":99,"self":0.0019998999999999998,"total":0.0019998999999999998,"children":null},"AgentAct":{"count":99,"self":0.025844,"total":0.025844,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1697993466","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-3RTM9hQ6yJRZGQKZx8Slg -hubSessionId a9694f1b-42f4-414c-9f3a-decdfec467f4 -accessToken _-EoIL8F11LvGF_SbanmzPmRWk7d3mJZ66R4Zf61pY400ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Play","end_time_seconds":"1697993473"}}

View File

@ -1 +1 @@
{"count":1,"self":165.6871296,"total":169.0971951,"children":{"InitializeActuators":{"count":16,"self":0.00099859999999999988,"total":0.00099859999999999988,"children":null},"InitializeSensors":{"count":16,"self":0.0004997,"total":0.0004997,"children":null},"AgentSendState":{"count":6284,"self":0.08416549999999999,"total":0.87303159999999991,"children":{"CollectObservations":{"count":50272,"self":0.7153004,"total":0.7153004,"children":null},"WriteActionMask":{"count":50272,"self":0.0220018,"total":0.0220018,"children":null},"RequestDecision":{"count":50272,"self":0.051563899999999996,"total":0.051563899999999996,"children":null}}},"DecideAction":{"count":6284,"self":0.1001521,"total":0.1001521,"children":null},"AgentAct":{"count":6284,"self":2.4353849999999997,"total":2.4353849999999997,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1697829167","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-M0b7qtNNiWSON4XAp_iL2 -hubSessionId 2e5314ca-a4fa-4b7b-b736-755d2bd8b319 -accessToken ssCXQThs6ymBJJ5mKPBKm_froyZ-ddlXWkrjBDwnhZw00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"StartScene","end_time_seconds":"1697829337"}}
{"count":1,"self":65.1525952,"total":65.6026151,"children":{"InitializeActuators":{"count":2,"self":0.0015,"total":0.0015,"children":null},"InitializeSensors":{"count":2,"self":0.0005001,"total":0.0005001,"children":null},"AgentSendState":{"count":1994,"self":0.0115036,"total":0.073176999999999992,"children":{"CollectObservations":{"count":1994,"self":0.0546691,"total":0.0546691,"children":null},"WriteActionMask":{"count":1994,"self":0.0005,"total":0.0005,"children":null},"RequestDecision":{"count":1994,"self":0.0065042999999999993,"total":0.0065042999999999993,"children":null}}},"DecideAction":{"count":1994,"self":0.0091503,"total":0.0091503,"children":null},"AgentAct":{"count":1994,"self":0.36569229999999997,"total":0.36569229999999997,"children":null}},"gauges":{"AKMAgent.CumulativeReward":{"count":1,"max":-2512.52466,"min":-2512.52466,"runningAverage":-2512.52466,"value":-2512.52466,"weightedAverage":-2512.52466}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1697992942","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-3RTM9hQ6yJRZGQKZx8Slg -hubSessionId a9694f1b-42f4-414c-9f3a-decdfec467f4 -accessToken _-EoIL8F11LvGF_SbanmzPmRWk7d3mJZ66R4Zf61pY400ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"StartScene","end_time_seconds":"1697993008"}}

View File

@ -1 +1 @@
{"count":1,"self":155.8538496,"total":164.5160273,"children":{"InitializeActuators":{"count":16,"self":0.0009985,"total":0.0009985,"children":null},"InitializeSensors":{"count":16,"self":0.001,"total":0.001,"children":null},"AgentSendState":{"count":7148,"self":0.097526099999999991,"total":1.0346207,"children":{"CollectObservations":{"count":57184,"self":0.8580802,"total":0.8580802,"children":null},"WriteActionMask":{"count":57184,"self":0.020496499999999997,"total":0.020496499999999997,"children":null},"RequestDecision":{"count":57184,"self":0.0585179,"total":0.0585179,"children":null}}},"DecideAction":{"count":7148,"self":0.10903289999999999,"total":0.10903289999999999,"children":null},"AgentAct":{"count":7148,"self":7.5160247999999994,"total":7.5160247,"children":null}},"gauges":{"AKMAgent.CumulativeReward":{"count":32,"max":4010,"min":-7125.913,"runningAverage":-2807.06714,"value":4010,"weightedAverage":3303.63574}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1697829961","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-M0b7qtNNiWSON4XAp_iL2 -hubSessionId 2e5314ca-a4fa-4b7b-b736-755d2bd8b319 -accessToken ssCXQThs6ymBJJ5mKPBKm_froyZ-ddlXWkrjBDwnhZw00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Train","end_time_seconds":"1697830125"}}
{"count":1,"self":44.2918592,"total":44.7423777,"children":{"InitializeActuators":{"count":2,"self":0.0015,"total":0.0015,"children":null},"InitializeSensors":{"count":2,"self":0.0005001,"total":0.0005001,"children":null},"AgentSendState":{"count":1994,"self":0.0115036,"total":0.073176999999999992,"children":{"CollectObservations":{"count":1994,"self":0.0546691,"total":0.0546691,"children":null},"WriteActionMask":{"count":1994,"self":0.0005,"total":0.0005,"children":null},"RequestDecision":{"count":1994,"self":0.0065042999999999993,"total":0.0065042999999999993,"children":null}}},"DecideAction":{"count":1994,"self":0.0091503,"total":0.0091503,"children":null},"AgentAct":{"count":1994,"self":0.36569229999999997,"total":0.36569229999999997,"children":null}},"gauges":{"AKMAgent.CumulativeReward":{"count":1,"max":-2512.52466,"min":-2512.52466,"runningAverage":-2512.52466,"value":-2512.52466,"weightedAverage":-2512.52466}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1697992942","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-3RTM9hQ6yJRZGQKZx8Slg -hubSessionId a9694f1b-42f4-414c-9f3a-decdfec467f4 -accessToken _-EoIL8F11LvGF_SbanmzPmRWk7d3mJZ66R4Zf61pY400ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Train","end_time_seconds":"1697992987"}}

View File

@ -1726,6 +1726,85 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 180706344}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &220347584
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 220347586}
- component: {fileID: 220347585}
m_Layer: 0
m_Name: CommonParameterContainer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &220347585
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 220347584}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 34839c2831b759d4a8347ab655b00f36, type: 3}
m_Name:
m_EditorClassIdentifier:
hudObj: {fileID: 2082200184}
lockMouse: 0
damage: 50
fireRate: 0.5
timeLimit: 30
lockCameraX: 0
lockCameraY: 1
spawnAgentInAllMap: 1
spinRecordMax: 40
spinPenaltyThreshold: 10
facingInviewEnemyDisCOEF: 0.5
hitTargetRewardDefault: 25
killTargetEnemyRewardDefault: 25
inAreaRewardDefault: 12
freeTimeBonusPerSec: 1
targetTimeBonusPerSec: 0.5
areaTimeBonusPerSec: 0.2
distanceReward: 50
facingTargetReward: 10
goWinRewardDefault: 999
attackWinRewardDefault: 999
defenceWinRewardDefault: 999
freeWinRewardDefault: 999
nonReward: -1
loseReward: -999
shootReward: -0.5
hitNonTargetReward: -5
killNonTargetReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 5
shootTargetAreaReward: 10
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06
--- !u!4 &220347586
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 220347584}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -121.2, y: 1.149992, z: -130.00002}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &223227756
GameObject:
m_ObjectHideFlags: 0
@ -3221,7 +3300,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0.000030517578, y: -246.20206}
m_AnchoredPosition: {x: 0.000030517578, y: -246.20204}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &324069808
@ -7182,8 +7261,10 @@ MonoBehaviour:
hasUpgradedFromAgentParameters: 1
MaxStep: 0
paramContainerObj: {fileID: 707336050}
CommonParameterContainer: {fileID: 220347584}
targetControllerObj: {fileID: 1692325237}
environmentUIObj: {fileID: 156390936}
sideChannelObj: {fileID: 0}
hudUIObj: {fileID: 2082200184}
oneHotRayTag: 1
--- !u!114 &629870347
@ -7198,7 +7279,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a899ce3efe4b8384a8cc2e43cc761b71, type: 3}
m_Name:
m_EditorClassIdentifier:
parameterContainerObj: {fileID: 707336050}
commonParameterContainerObj: {fileID: 220347584}
environmentObj: {fileID: 749443372}
enemyContainerObj: {fileID: 891195334}
sceneBlockContainerObj: {fileID: 1811162388}
@ -8250,40 +8331,7 @@ MonoBehaviour:
blockConObj: {fileID: 1811162388}
agentObj: {fileID: 629870337}
hudObj: {fileID: 2082200184}
lockMouse: 0
damage: 50
fireRate: 0.5
timeLimit: 30
lockCameraX: 0
lockCameraY: 1
spawnAgentInAllMap: 1
spinRecordMax: 40
spinPenaltyThreshold: 10
facingInviewEnemyDisCOEF: 0.5
hitTargetRewardDefault: 25
killTargetEnemyRewardDefault: 25
inAreaRewardDefault: 12
freeTimeBonusPerSec: 1
targetTimeBonusPerSec: 0.5
areaTimeBonusPerSec: 0.2
distanceReward: 50
facingTargetReward: 10
goWinRewardDefault: 999
attackWinRewardDefault: 999
defenceWinRewardDefault: 999
freeWinRewardDefault: 999
nonReward: -1
loseReward: -999
shootReward: -0.5
hitNonTargetReward: -5
killNonTargetReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 5
shootTargetAreaReward: 10
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06
CommonParamObj: {fileID: 220347584}
hitTargetReward: 60
killTargetEnemyReward: 80
inAreaReward: 5
@ -8291,7 +8339,6 @@ MonoBehaviour:
attackWinReward: 50
defenceWinReward: 50
freeWinReward: 50
scenePrefabSet: {fileID: 0}
--- !u!4 &707336052
Transform:
m_ObjectHideFlags: 0
@ -12726,7 +12773,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 538300382}
m_Direction: 2
m_Value: 0
m_Size: 0.9998472
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
@ -16004,6 +16051,7 @@ MonoBehaviour:
sceneBlockContainerObj: {fileID: 1811162388}
enemyContainerObj: {fileID: 891195334}
parameterContainerObj: {fileID: 707336050}
commonParameterContainerObj: {fileID: 220347584}
environmentUIObj: {fileID: 156390936}
worldUIObj: {fileID: 1052251813}
edgeUp: {fileID: 1352953080}
@ -17749,7 +17797,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
sceneSize: 10
environmentObj: {fileID: 749443372}
parameterContainerObj: {fileID: 707336050}
commonParameterContainerObj: {fileID: 220347584}
hudObj: {fileID: 2082200184}
nowBlock: {fileID: 0}
--- !u!1 &1817420688
@ -21440,7 +21488,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
chartOn: 0
sideChannelObj: {fileID: 0}
chartOnToggleObj: {fileID: 269417898}
saveModelButton: {fileID: 0}
chartOnTimeOutInputObj: {fileID: 149218411}
enemyNumInputObj: {fileID: 427803071}
chartOnTimeOut: 60
@ -21576,6 +21626,7 @@ MonoBehaviour:
defaultColor: white
warningColor: '#ffa500ff'
errorColor: '#800000ff'
goodColor: '#00ff00ff'
messagePanelObj: {fileID: 324069806}
messageTextPrefab: {fileID: 7800828413105135976, guid: bdd79ceda95d4bd44a402c80049df6e8, type: 3}
messages: []
@ -21599,32 +21650,9 @@ MonoBehaviour:
unclickableButton:
- {fileID: 371362500}
- {fileID: 320729027}
normalTextColor:
serializedVersion: 2
rgba: 4293717228
normalBGColor:
serializedVersion: 2
rgba: 16777215
highLightTextColor:
serializedVersion: 2
rgba: 3861457193
highLightBGColor:
serializedVersion: 2
rgba: 1744830463
pressedTextColor:
serializedVersion: 2
rgba: 4026531840
pressedBGColor:
serializedVersion: 2
rgba: 2701131775
disableTextColor:
serializedVersion: 2
rgba: 1354020020
disableBGColor:
serializedVersion: 2
rgba: 16777215
colorChangeSpeed: 0.1
clickable: 1
uiColor: {fileID: 11400000, guid: c75edf08eba25eb40896936387c07e89, type: 2}
--- !u!1 &2099230616
GameObject:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@ -5,14 +5,22 @@
public class AgentController : MonoBehaviour
{
public GameObject parameterContainerObj;
public GameObject environmentObj;
public GameObject enemyContainerObj;
public GameObject sceneBlockContainerObj;
public GameObject environmentUIControlObj;
public GameObject targetControllerObj;
public GameObject HUDObj;
public Camera fpsCam;
[SerializeField]
private GameObject commonParameterContainerObj;
[SerializeField]
private GameObject environmentObj;
[SerializeField]
private GameObject enemyContainerObj;
[SerializeField]
private GameObject sceneBlockContainerObj;
[SerializeField]
private GameObject environmentUIControlObj;
[SerializeField]
private GameObject targetControllerObj;
[SerializeField]
private GameObject HUDObj;
[SerializeField]
private Camera fpsCam;
[Header("GetAxis() Simulate")]
public float moveSpeed = 9.0f;
@ -48,25 +56,25 @@ public class AgentController : MonoBehaviour
private RaySensors raySensors;
private CharacterController playerController;
private ParameterContainer paramContainer;
private CommonParameterContainer commonPramCon;
private SceneBlockContainer blockContainer;
private TargetController targetCon;
private void Start()
{
// initialize scripts
paramContainer = parameterContainerObj.GetComponent<ParameterContainer>();
commonPramCon = commonParameterContainerObj.GetComponent<CommonParameterContainer>();
blockContainer = sceneBlockContainerObj.GetComponent<SceneBlockContainer>();
targetCon = targetControllerObj.GetComponent<TargetController>();
raySensors = GetComponent<RaySensors>();
playerController = this.transform.GetComponent<CharacterController>();
// initialize Environment parameters
lockMouse = paramContainer.lockMouse;
damage = paramContainer.damage;
fireRate = paramContainer.fireRate;
lockCameraX = paramContainer.lockCameraX;
lockCameraY = paramContainer.lockCameraY;
lockMouse = commonPramCon.lockMouse;
damage = commonPramCon.damage;
fireRate = commonPramCon.fireRate;
lockCameraX = commonPramCon.lockCameraX;
lockCameraY = commonPramCon.lockCameraY;
// initialize remainTime
// this agent's tag
@ -226,24 +234,24 @@ private float Ballistic(int shootState)
{
// im shooting at target but didn't hit enemy
// Debug.DrawRay(centerRay.origin, viewPoint-centerRay.origin, Color.blue);
return paramContainer.shootTargetAreaReward;
return commonPramCon.shootTargetAreaReward;
}
}
}
shootState = 0;
return paramContainer.shootReward;
return commonPramCon.shootReward;
}
else if (shootState != 0 && gunReadyToggle == false)
{
// shoot without ready
shootState = 0;
return paramContainer.shootWithoutReadyReward;
return commonPramCon.shootWithoutReadyReward;
}
else
{
// do not shoot
shootState = 0;
return paramContainer.nonReward;
return commonPramCon.nonReward;
}
}
@ -294,7 +302,7 @@ private float FacingReward()
// facing to an enemy
if (hit.collider.tag != myTag && hit.collider.tag != "Wall")
{
nowReward = paramContainer.facingReward;
nowReward = commonPramCon.facingReward;
isFacingtoEnemy = true;
}
}
@ -318,7 +326,7 @@ private float FacingReward()
if (enemyFacingDistance <= lastEnemyFacingDistance)
{
// closing to enemy
nowReward = 1 / MathF.Sqrt(paramContainer.facingInviewEnemyDisCOEF * enemyFacingDistance + 0.00001f);
nowReward = 1 / MathF.Sqrt(commonPramCon.facingInviewEnemyDisCOEF * enemyFacingDistance + 0.00001f);
}
else
{
@ -326,8 +334,8 @@ private float FacingReward()
}
// enemy in view Reward
lastEnemyFacingDistance = enemyFacingDistance;
if (nowReward >= paramContainer.facingReward) nowReward = paramContainer.facingReward; // limit
if (nowReward <= -paramContainer.facingReward) nowReward = -paramContainer.facingReward; // limit
if (nowReward >= commonPramCon.facingReward) nowReward = commonPramCon.facingReward; // limit
if (nowReward <= -commonPramCon.facingReward) nowReward = -commonPramCon.facingReward; // limit
// Debug.Log("ninimum = " + nowReward);
}
break;
@ -341,12 +349,12 @@ private float FacingReward()
if (camCenterToTarget <= blockContainer.nowBlock.firebasesAreaDiameter / 2)
{
// Debug.DrawRay(centerRay.origin, viewPoint-centerRay.origin, Color.blue);
nowReward = paramContainer.facingReward;
nowReward = commonPramCon.facingReward;
}
else
{
// while not facing to target
nowReward = (lastTargetFacingDistance - camCenterToTarget) * paramContainer.facingTargetReward;
nowReward = (lastTargetFacingDistance - camCenterToTarget) * commonPramCon.facingTargetReward;
}
}
// update lastTargetFacingDistance
@ -357,7 +365,7 @@ private float FacingReward()
if (camCenterToTarget <= camCenterToViewEdge)
{
// fireArea is in view
nowReward = paramContainer.facingReward;
nowReward = commonPramCon.facingReward;
}
else
{
@ -395,23 +403,23 @@ public float RewardCalculate(float sceneReward, float mouseX, float movement, in
// Penalty
// spin penalty
spinRecord.Add(mouseX);
if (spinRecord.Count >= paramContainer.spinRecordMax)
if (spinRecord.Count >= commonPramCon.spinRecordMax)
{
spinRecord.RemoveAt(0);
}
float spinPenaltyReward = Math.Abs(spinRecord.ToArray().Sum() * paramContainer.spinPenalty);
if (spinPenaltyReward >= paramContainer.spinPenaltyThreshold)
float spinPenaltyReward = Math.Abs(spinRecord.ToArray().Sum() * commonPramCon.spinPenalty);
if (spinPenaltyReward >= commonPramCon.spinPenaltyThreshold)
{
epreward -= spinPenaltyReward;
}
else
{
epreward -= Math.Abs(mouseX) * paramContainer.mousePenalty;
epreward -= Math.Abs(mouseX) * commonPramCon.mousePenalty;
}
// move penalty
if (movement != 0)
{
epreward -= paramContainer.movePenalty;
epreward -= commonPramCon.movePenalty;
}
return epreward;
}

View File

@ -2,9 +2,9 @@
public class EnemyContainer : MonoBehaviour
{
public GameObject enemyPrefab;
public GameObject environmentObj;
public GameObject targetControllerObj;
[SerializeField] public GameObject enemyPrefab;
[SerializeField] private GameObject environmentObj;
[SerializeField] private GameObject targetControllerObj;
private TargetController targetCon;

View File

@ -0,0 +1,123 @@
using System;
using System.Collections.Generic;
using UnityEngine;
public class CommonParameterContainer : MonoBehaviour
{
[SerializeField] private GameObject hudObj;
private StartSeneData startSceneData;
private MessageBoxController messageCon;
[Header("Env")]
public bool lockMouse = false;
public float damage = 50; // damage to enemy
public float fireRate = 0.5f;
public int timeLimit = 30;
public bool lockCameraX = false;
public bool lockCameraY = true;
public bool spawnAgentInAllMap = true;
public int spinRecordMax = 40;
public float spinPenaltyThreshold = 10;
public float facingInviewEnemyDisCOEF = 0.5f;
[Header("Dynamic Defaut Rewards")]
//[Tooltip("Hit Enemy reward")]
//public float hitRewardDefault = 60.0f;
[Tooltip("Free mode Hit Enemy reward")]
public float hitTargetRewardDefault = 25f;
//[Tooltip("Enemy down reward")]
//public float killRewardDefault = 60.0f;
[Tooltip("Enemy down in area Reward")]
public float killTargetEnemyRewardDefault = 25f;
[Tooltip("stay in firebasesArea reward")]
public float inAreaRewardDefault = 12f;
[Tooltip("free left time bonus reward. ALLR + leftTime * r")]
public float freeTimeBonusPerSec = 1.0f;
[Tooltip("target left time bonus reward. ALLR + leftTime * r")]
public float targetTimeBonusPerSec = 0.5f;
[Tooltip("in area left time bonus reward. ALLR + leftTime * r")]
public float areaTimeBonusPerSec = 0.2f;
[Tooltip("distance reward reward = r*(1-(nowDis/startDis))")]
public float distanceReward = 50.0f;
[Tooltip("facing to Target distance reward reward = r*(1-(nowDis/startDis))")]
public float facingTargetReward = 10.0f;
[Space(10)]
[Tooltip("Goto Win reward")]
public float goWinRewardDefault = 999f;
[Tooltip("Attack Win reward")]
public float attackWinRewardDefault = 999f;
[Tooltip("Defence Win reward")]
public float defenceWinRewardDefault = 999f;
[Tooltip("free Win reward")]
public float freeWinRewardDefault = 999f;
[Header("Static Rewards")]
[Tooltip("Nothing happened reward")]
public float nonReward = -1f;
[Tooltip("Episode Lose reward")]
public float loseReward = -999f;
[Tooltip("Agent Do shoot action reward")]
public float shootReward = -0.5f;
[Tooltip("Hit Not target Enemy reward")]
public float hitNonTargetReward = -5f;
[Tooltip("Not Target Enemy down reward")]
public float killNonTargetReward = -5f;
[Tooltip("Agent Do shoot action but gun is not read")]
public float shootWithoutReadyReward = -1.15f;
[Tooltip("Kill bonus reward stack to nothing happend reward")]
public float killBonusReward = 0.0f;
[Tooltip("Facing to enemy's reward")]
public float facingReward = 5f;
[Tooltip("Shoot at target area but didn't hit enemy")]
public float shootTargetAreaReward = 10f;
[Header("Penalty Rewards")]
[Tooltip("move Penalty Reward")]
public float movePenalty = 0.1f;
[Tooltip("spiiiiiiin Panalty Reward")]
public float spinPenalty = 0.08f;
[Tooltip("while move mouse a little bit's penalty")]
public float mousePenalty = 0.06f;
[NonSerialized] public SceneBlocksSet scenePrefabSet;
[NonSerialized] public int gameMode; // 0 = trainning mode, 1 = play mode
[NonSerialized] public float attackProb = 0f;
[NonSerialized] public List<float> attackLevelProbs = new List<float>();
[NonSerialized] public float gotoProb = 0f;
[NonSerialized] public List<float> gotoLevelProbs = new List<float>();
[NonSerialized] public float defenceProb = 0f;
[NonSerialized] public List<float> defenceLevelProbs = new List<float>();
private void Start()
{
messageCon = hudObj.GetComponent<MessageBoxController>();
try
{
// try get start scene data
startSceneData = GameObject.Find("StartSceneDataTransfer").GetComponent<StartSeneData>();
messageCon.PushMessage(
new List<string> { "ParameterContainer:", "StartSceneDataTransfer found!" },
new List<string> { "green", "white" });
}
catch
{
// if not found, find dummy StartSeneData
startSceneData = GameObject.Find("StartSceneDataTransferDummy").GetComponent<StartSeneData>();
messageCon.PushMessage(
new List<string> { "ParameterContainer:", "StartSceneDataTransfer not found!Use Dummy." },
new List<string> { "orange" });
}
gameMode = startSceneData.gameMode;
attackProb = startSceneData.attackProb;
attackLevelProbs = startSceneData.attackLevelProbs;
gotoProb = startSceneData.gotoProb;
gotoLevelProbs = startSceneData.gotoLevelProbs;
defenceProb = startSceneData.defenceProb;
defenceLevelProbs = startSceneData.defenceLevelProbs;
scenePrefabSet = startSceneData.scenePrefabSet;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 34839c2831b759d4a8347ab655b00f36
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -7,11 +7,12 @@
public class MLAgentsCustomController : Agent
{
public GameObject paramContainerObj;
public GameObject targetControllerObj;
public GameObject environmentUIObj;
public GameObject sideChannelObj;
public GameObject hudUIObj;
[SerializeField] private GameObject paramContainerObj;
[SerializeField] private GameObject CommonParameterContainer;
[SerializeField] private GameObject targetControllerObj;
[SerializeField] private GameObject environmentUIObj;
[SerializeField] private GameObject sideChannelObj;
[SerializeField] private GameObject hudUIObj;
[Header("Env")]
public bool oneHotRayTag = true;
@ -20,6 +21,7 @@ public class MLAgentsCustomController : Agent
private AgentController agentController;
private ParameterContainer paramContainer;
private CommonParameterContainer commonParamCon;
private TargetController targetController;
private EnvironmentUIControl envUIController;
private HUDController hudController;
@ -47,6 +49,7 @@ private void Start()
agentController = transform.GetComponent<AgentController>();
raySensors = transform.GetComponent<RaySensors>();
paramContainer = paramContainerObj.GetComponent<ParameterContainer>();
commonParamCon = CommonParameterContainer.GetComponent<CommonParameterContainer>();
targetController = targetControllerObj.GetComponent<TargetController>();
envUIController = environmentUIObj.GetComponent<EnvironmentUIControl>();
hudController = hudUIObj.GetComponent<HUDController>();
@ -62,7 +65,7 @@ public override void OnEpisodeBegin()
step = 0;
agentController.UpdateLockMouse();
paramContainer.ResetTimeBonusReward();
if (paramContainer.gameMode == 0)
if (commonParamCon.gameMode == 0)
{
// train mode
Debug.Log("MLAgentCustomController.OnEpisodeBegin: train mode start");
@ -178,7 +181,7 @@ public override void OnActionReceived(ActionBuffers actionBuffers)
switch (finishedState)
{
case (int)TargetController.EndType.Win:
sideChannelController.SendSideChannelMessage("Result",targetString+ "|Win");
sideChannelController.SendSideChannelMessage("Result", targetString + "|Win");
messageBoxController.PushMessage(
new List<string> { "Game Win" },
new List<string> { "green" });

View File

@ -3,110 +3,20 @@
public class ParameterContainer : MonoBehaviour
{
public GameObject targetConObj;
public GameObject blockConObj;
public GameObject agentObj;
public GameObject hudObj;
[SerializeField] private GameObject targetConObj;
[SerializeField] private GameObject blockConObj;
[SerializeField] private GameObject agentObj;
[SerializeField] private GameObject hudObj;
[SerializeField] private GameObject CommonParamObj;
private TargetController targetCon;
private SceneBlockContainer blockCont;
private StartSeneData startSceneData;
private MessageBoxController messageCon;
private CommonParameterContainer commonParamCont;
private float agentDistance;
private int agentInArea;
[Header("Env")]
public bool lockMouse = false;
public float damage = 50; // damage to enemy
public float fireRate = 0.5f;
public int timeLimit = 30;
public bool lockCameraX = false;
public bool lockCameraY = true;
public bool spawnAgentInAllMap = true;
public int spinRecordMax = 40;
public float spinPenaltyThreshold = 10;
public float facingInviewEnemyDisCOEF = 0.5f;
[Header("Dynamic Defaut Rewards")]
//[Tooltip("Hit Enemy reward")]
//public float hitRewardDefault = 60.0f;
[Tooltip("Free mode Hit Enemy reward")]
public float hitTargetRewardDefault = 25f;
//[Tooltip("Enemy down reward")]
//public float killRewardDefault = 60.0f;
[Tooltip("Enemy down in area Reward")]
public float killTargetEnemyRewardDefault = 25f;
[Tooltip("stay in firebasesArea reward")]
public float inAreaRewardDefault = 12f;
[Tooltip("free left time bonus reward. ALLR + leftTime * r")]
public float freeTimeBonusPerSec = 1.0f;
[Tooltip("target left time bonus reward. ALLR + leftTime * r")]
public float targetTimeBonusPerSec = 0.5f;
[Tooltip("in area left time bonus reward. ALLR + leftTime * r")]
public float areaTimeBonusPerSec = 0.2f;
[Tooltip("distance reward reward = r*(1-(nowDis/startDis))")]
public float distanceReward = 50.0f;
[Tooltip("facing to Target distance reward reward = r*(1-(nowDis/startDis))")]
public float facingTargetReward = 10.0f;
[Space(10)]
[Tooltip("Goto Win reward")]
public float goWinRewardDefault = 999f;
[Tooltip("Attack Win reward")]
public float attackWinRewardDefault = 999f;
[Tooltip("Defence Win reward")]
public float defenceWinRewardDefault = 999f;
[Tooltip("free Win reward")]
public float freeWinRewardDefault = 999f;
[Header("Static Rewards")]
[Tooltip("Nothing happened reward")]
public float nonReward = -1f;
[Tooltip("Episode Lose reward")]
public float loseReward = -999f;
[Tooltip("Agent Do shoot action reward")]
public float shootReward = -0.5f;
[Tooltip("Hit Not target Enemy reward")]
public float hitNonTargetReward = -5f;
[Tooltip("Not Target Enemy down reward")]
public float killNonTargetReward = -5f;
[Tooltip("Agent Do shoot action but gun is not read")]
public float shootWithoutReadyReward = -1.15f;
[Tooltip("Kill bonus reward stack to nothing happend reward")]
public float killBonusReward = 0.0f;
[Tooltip("Facing to enemy's reward")]
public float facingReward = 5f;
[Tooltip("Shoot at target area but didn't hit enemy")]
public float shootTargetAreaReward = 10f;
[Header("Penalty Rewards")]
[Tooltip("move Penalty Reward")]
public float movePenalty = 0.1f;
[Tooltip("spiiiiiiin Panalty Reward")]
public float spinPenalty = 0.08f;
[Tooltip("while move mouse a little bit's penalty")]
public float mousePenalty = 0.06f;
[Header("Dynamic Rewards")]
[Tooltip("Free mode Hit Enemy reward")]
public float hitTargetReward = 60.0f;
@ -130,28 +40,29 @@ public class ParameterContainer : MonoBehaviour
[Tooltip("free Win reward")]
public float freeWinReward = 50.0f;
[Tooltip("Scene Prefab Set")]
public SceneBlocksSet scenePrefabSet;
private float targetTimeBonus = 0f;
private float areaTimeBonus = 0f;
private float freeTimeBonus = 0f;
private float targetInAreaTime = 0f;
private float lastFrameTime = 0f;
[System.NonSerialized] public int gameMode; // 0 = trainning mode, 1 = play mode
[System.NonSerialized] public float attackProb = 0f;
[System.NonSerialized] public List<float> attackLevelProbs = new List<float>();
[System.NonSerialized] public float gotoProb = 0f;
[System.NonSerialized] public List<float> gotoLevelProbs = new List<float>();
[System.NonSerialized] public float defenceProb = 0f;
[System.NonSerialized] public List<float> defenceLevelProbs = new List<float>();
private float areaTimeBonusPerSec;
private float freeTimeBonusPerSec;
private float targetTimeBonusPerSec;
private int timeLimit = 30;
private void Start()
{
targetCon = targetConObj.GetComponent<TargetController>();
blockCont = blockConObj.GetComponent<SceneBlockContainer>();
messageCon = hudObj.GetComponent<MessageBoxController>();
commonParamCont = CommonParamObj.GetComponent<CommonParameterContainer>();
areaTimeBonusPerSec = commonParamCont.areaTimeBonusPerSec;
freeTimeBonusPerSec = commonParamCont.freeTimeBonusPerSec;
targetTimeBonusPerSec = commonParamCont.targetTimeBonusPerSec;
timeLimit = commonParamCont.timeLimit;
areaTimeBonus = areaTimeBonusPerSec * timeLimit;
freeTimeBonus = freeTimeBonusPerSec * timeLimit;
targetTimeBonus = targetTimeBonusPerSec * timeLimit;
@ -171,14 +82,12 @@ private void Start()
new List<string> { "ParameterContainer:", "StartSceneDataTransfer not found!Use Dummy." },
new List<string> { "orange" });
}
gameMode = startSceneData.gameMode;
attackProb = startSceneData.attackProb;
attackLevelProbs = startSceneData.attackLevelProbs;
gotoProb = startSceneData.gotoProb;
gotoLevelProbs = startSceneData.gotoLevelProbs;
defenceProb = startSceneData.defenceProb;
defenceLevelProbs = startSceneData.defenceLevelProbs;
scenePrefabSet = startSceneData.scenePrefabSet;
// Win Rewards
goWinReward = commonParamCont.goWinRewardDefault;
attackWinReward = commonParamCont.attackWinRewardDefault;
defenceWinReward = commonParamCont.defenceWinRewardDefault;
freeWinReward = commonParamCont.freeWinRewardDefault;
}
private void Update()
@ -206,15 +115,9 @@ private void Update()
targetTimeBonus = targetTimeBonusPerSec * targetCon.leftTime;
}
hitTargetReward = hitTargetRewardDefault + targetTimeBonus;
killTargetEnemyReward = killTargetEnemyRewardDefault + targetTimeBonus;
inAreaReward = inAreaRewardDefault + areaTimeBonus;
// Win Rewards
goWinReward = goWinRewardDefault;
attackWinReward = attackWinRewardDefault;
defenceWinReward = defenceWinRewardDefault;
freeWinReward = freeWinRewardDefault;
hitTargetReward = commonParamCont.hitTargetRewardDefault + targetTimeBonus;
killTargetEnemyReward = commonParamCont.killTargetEnemyRewardDefault + targetTimeBonus;
inAreaReward = commonParamCont.inAreaRewardDefault + areaTimeBonus;
}
public void ResetTimeBonusReward()

View File

@ -6,11 +6,11 @@
public class RaySensors : MonoBehaviour
{
public Camera agentCam;
public Camera TPSCam;
public Material lineMeterial;
public GameObject rayInfoPrefab;
public GameObject agentCanvas;
[SerializeField] private Camera agentCam;
[SerializeField] private Camera TPSCam;
[SerializeField] private Material lineMeterial;
[SerializeField] private GameObject rayInfoPrefab;
[SerializeField] private GameObject agentCanvas;
[SerializeField, Range(0, 500)] public float viewDistance = 100; // how long the ray can detect

View File

@ -2,10 +2,14 @@
public class SceneBlockContainer : MonoBehaviour
{
public float sceneSize = 10f;
public GameObject environmentObj;
public GameObject parameterContainerObj;
public GameObject hudObj;
[SerializeField]
private float sceneSize = 10f;
[SerializeField]
private GameObject environmentObj;
[SerializeField]
private GameObject commonParameterContainerObj;
[SerializeField]
private GameObject hudObj;
// public GameObject[] attackBlockPrefabs = new GameObject[1];
// public GameObject[] goBlockPrefabs = new GameObject[1];
@ -13,11 +17,11 @@ public class SceneBlockContainer : MonoBehaviour
public SceneBlock nowBlock;
private GameObject nowBlockObj;
private ParameterContainer paramCon;
private CommonParameterContainer commonParamCon;
private void Start()
{
paramCon = parameterContainerObj.GetComponent<ParameterContainer>();
commonParamCon = commonParameterContainerObj.GetComponent<CommonParameterContainer>();
}
/// <summary>
@ -40,7 +44,7 @@ public void CreateNewBlock(Targets targetType, int level, int blockType, Vector3
DestroyBlock();
}
// choose target type
nowBlockObj = Instantiate(paramCon.scenePrefabSet.GetPrefab(level, blockType, targetType), blockPosition + environmentObj.transform.position, Quaternion.identity, transform);
nowBlockObj = Instantiate(commonParamCon.scenePrefabSet.GetPrefab(level, blockType, targetType), blockPosition + environmentObj.transform.position, Quaternion.identity, transform);
nowBlock = nowBlockObj.GetComponent<SceneBlock>();
nowBlock.group1Tag = tag1;
nowBlock.group2Tag = tag2;

View File

@ -5,14 +5,24 @@
public class TargetController : MonoBehaviour
{
public GameObject environmentObj;
public GameObject agentObj;
public GameObject HUDObj;
public GameObject sceneBlockContainerObj;
public GameObject enemyContainerObj;
public GameObject parameterContainerObj;
public GameObject environmentUIObj;
public GameObject worldUIObj;
[SerializeField]
private GameObject environmentObj;
[SerializeField]
private GameObject agentObj;
[SerializeField]
private GameObject HUDObj;
[SerializeField]
private GameObject sceneBlockContainerObj;
[SerializeField]
private GameObject enemyContainerObj;
[SerializeField]
private GameObject parameterContainerObj;
[SerializeField]
private GameObject commonParameterContainerObj;
[SerializeField]
private GameObject environmentUIObj;
[SerializeField]
private GameObject worldUIObj;
// area
public GameObject edgeUp;
@ -62,10 +72,12 @@ public enum EndType
public Vector3 targetPosition;
private bool firstRewardFlag = true;
private bool targetEnemySpawnFinish = false;
private SceneBlockContainer sceneBlockCon;
private EnemyContainer enemyCon;
private EnvironmentUIControl envUICon;
private ParameterContainer paramCon;
private CommonParameterContainer commonParamCon;
private CharacterController agentCharaCon;
private WorldUIController worldUICon;
private HUDController hudCon;
@ -77,6 +89,7 @@ public enum EndType
// Start is called before the first frame update
private void Start()
{
commonParamCon = commonParameterContainerObj.GetComponent<CommonParameterContainer>();
sceneBlockCon = sceneBlockContainerObj.GetComponent<SceneBlockContainer>();
envUICon = environmentUIObj.GetComponent<EnvironmentUIControl>();
enemyCon = enemyContainerObj.GetComponent<EnemyContainer>();
@ -87,10 +100,10 @@ private void Start()
messageBoxCon = HUDObj.GetComponent<MessageBoxController>();
// get parameter from ParameterContainer
gamemode = paramCon.gameMode;
attackProb = paramCon.attackProb;
gotoProb = paramCon.gotoProb;
defenceProb = paramCon.defenceProb;
gamemode = commonParamCon.gameMode;
attackProb = commonParamCon.attackProb;
gotoProb = commonParamCon.gotoProb;
defenceProb = commonParamCon.defenceProb;
// initialize spawn area
minEnemyAreaX = edgeLeft.transform.localPosition.x + 1.0f;
@ -105,8 +118,8 @@ private void Start()
freeProb = 1 - attackProb - gotoProb - defenceProb;
targetNum = (int)Targets.Num;
gotoLevelNum = paramCon.scenePrefabSet.GetLevelNumber(Targets.Go);
attackLevelNum = paramCon.scenePrefabSet.GetLevelNumber(Targets.Attack);
gotoLevelNum = commonParamCon.scenePrefabSet.GetLevelNumber(Targets.Go);
attackLevelNum = commonParamCon.scenePrefabSet.GetLevelNumber(Targets.Attack);
if (freeProb < 0)
{
Debug.LogError("TargetController.Start: target percentage wrong");
@ -130,13 +143,13 @@ private void Update()
// if gamemode is play, then time will keep paramCon.timeLimit
if (gamemode == 1)
{
leftTime = paramCon.timeLimit;
leftTime = commonParamCon.timeLimit;
// print out time
// Debug.Log("Playing Time: " + leftTime);
}
else
{
leftTime = paramCon.timeLimit - Time.time + startTime;
leftTime = commonParamCon.timeLimit - Time.time + startTime;
}
}
@ -152,7 +165,7 @@ private void Update()
public void RollNewScene()
{
startTime = Time.time;// Reset StartTime as now time
leftTime = paramCon.timeLimit - Time.time + startTime;
leftTime = commonParamCon.timeLimit - Time.time + startTime;
float randTargetType = UnityEngine.Random.Range(0f, 1f);
if (randTargetType <= gotoProb)
{
@ -205,7 +218,7 @@ private void MoveAgentToSpwanArea()
{
float randX = UnityEngine.Random.Range(minAgentAreaX, maxAgentAreaX); ;
float randZ = 0f;
if (paramCon.spawnAgentInAllMap)
if (commonParamCon.spawnAgentInAllMap)
{
// spawn agent in all around map
randZ = UnityEngine.Random.Range(minAgentAreaZ, maxEnemyAreaZ);
@ -257,8 +270,8 @@ public void MoveAgentTo(Vector3 position)
private void RandomSpawnSceneBlock(Targets targetType)
{
randLevel = RollRandomLevelIndex(targetType);
randBlockType = Random.Range(0, paramCon.scenePrefabSet.GetBlockNumber(randLevel,targetType));
sceneBlockSize = paramCon.scenePrefabSet.GetBlockSize(randLevel, randBlockType, targetType);
randBlockType = Random.Range(0, commonParamCon.scenePrefabSet.GetBlockNumber(randLevel,targetType));
sceneBlockSize = commonParamCon.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);
@ -308,7 +321,7 @@ private void RandomSpawnSceneBlock(Targets targetType)
{
// time out lose
nowReward = areaTargetReward;
endReward = paramCon.loseReward;
endReward = commonParamCon.loseReward;
endTypeInt = (int)EndType.Lose;
}
else
@ -338,7 +351,7 @@ private void RandomSpawnSceneBlock(Targets targetType)
{
// time out lose
nowReward = 0;
endReward = paramCon.loseReward;
endReward = commonParamCon.loseReward;
//nowReward = (paramCon.inAreaReward * inArea) + getSceneReward(nowDistance);
endTypeInt = (int)EndType.Lose;
targetEnemySpawnFinish = false;
@ -370,7 +383,7 @@ private void RandomSpawnSceneBlock(Targets targetType)
else if (sceneBlockCon.nowBlock.firebasesBelong <= sceneBlockCon.nowBlock.belongMaxPoint)
{
// lost area lose
nowReward = paramCon.loseReward;
nowReward = commonParamCon.loseReward;
//nowReward = (paramCon.inAreaReward * inArea) + getSceneReward(nowDistance);
endTypeInt = (int)EndType.Lose;
}
@ -405,7 +418,7 @@ private void RandomSpawnSceneBlock(Targets targetType)
// lose
//nowReward = paramCon.loseReward;
nowReward = 0;
endReward = paramCon.loseReward;
endReward = commonParamCon.loseReward;
endTypeInt = (int)EndType.Lose;
}
else
@ -447,7 +460,7 @@ private float GetDistanceReward(float nowDistance, int inarea)
{
// out of area
// nowSeneReward = paramCon.distanceReward * Math.Clamp(lastDistance - nowDistance, 0, 100);
nowSeneReward = paramCon.distanceReward * (lastDistance - nowDistance);
nowSeneReward = commonParamCon.distanceReward * (lastDistance - nowDistance);
}
lastDistance = nowDistance;
return nowSeneReward;
@ -473,7 +486,7 @@ public float KillReward(Vector3 enemyPosition)
}
else
{
nowKillReward = paramCon.killNonTargetReward;
nowKillReward = commonParamCon.killNonTargetReward;
}
}
else if (targetTypeInt == (int)Targets.Free)
@ -484,7 +497,7 @@ public float KillReward(Vector3 enemyPosition)
else
{
// goto & defence
nowKillReward = paramCon.killNonTargetReward;
nowKillReward = commonParamCon.killNonTargetReward;
}
return nowKillReward;
}
@ -510,7 +523,7 @@ public float HitEnemyReward(Vector3 enemyPosition)
else
{
// hit not in area enemy
nowHitReward = paramCon.hitNonTargetReward;
nowHitReward = commonParamCon.hitNonTargetReward;
}
}
else if (targetTypeInt == (int)Targets.Free)
@ -521,7 +534,7 @@ public float HitEnemyReward(Vector3 enemyPosition)
else
{
// goto & defence
nowHitReward = paramCon.hitNonTargetReward;
nowHitReward = commonParamCon.hitNonTargetReward;
}
return nowHitReward;
}
@ -645,13 +658,13 @@ public int RollRandomLevelIndex(Targets target)
switch (target)
{
case Targets.Attack:
targetProbs = paramCon.attackLevelProbs;
targetProbs = commonParamCon.attackLevelProbs;
break;
case Targets.Go:
targetProbs = paramCon.gotoLevelProbs;
targetProbs = commonParamCon.gotoLevelProbs;
break;
case Targets.Defence:
targetProbs = paramCon.defenceLevelProbs;
targetProbs = commonParamCon.defenceLevelProbs;
break;
default:
messageBoxCon.PushMessage(

View File

@ -6,21 +6,30 @@ public class MouseInMap : MonoBehaviour
public float targetDistanceThreshold = 6f;
public float enemyDistanceThreshold = 1f;
public Camera playCamera;
public GameObject AgentObj;
public GameObject environmentObj;
public GameObject mousePreviewObj;
public GameObject enemyContainerObj;
public GameObject sceneBlockContainerObj;
public GameObject targetControllerObj;
public GameObject parameterContainerObj;
public GameObject HUDObj;
[SerializeField]
private Camera playCamera;
[SerializeField]
private GameObject AgentObj;
[SerializeField]
private GameObject environmentObj;
[SerializeField]
private GameObject mousePreviewObj;
[SerializeField]
private GameObject enemyContainerObj;
[SerializeField]
private GameObject sceneBlockContainerObj;
[SerializeField]
private GameObject targetControllerObj;
[SerializeField]
private GameObject parameterContainerObj;
[SerializeField]
private GameObject HUDObj;
private Vector3 nowHitPosition = Vector3.zero;
private Vector3 nowHitPositionRelative = Vector3.zero;
private LayerMask groundMask;
private int blockNum;
private ParameterContainer paramCon;
private CommonParameterContainer commonParamCon;
private GameObject previewModel;
private TargetController targetCon;
private MousePreview mousePreviewCon;
@ -47,7 +56,7 @@ public enum MouseMode
private void Start()
{
paramCon = parameterContainerObj.GetComponent<ParameterContainer>();
commonParamCon = parameterContainerObj.GetComponent<CommonParameterContainer>();
groundMask = LayerMask.GetMask("Ground");
targetCon = targetControllerObj.GetComponent<TargetController>();
mousePreviewCon = mousePreviewObj.GetComponent<MousePreview>();
@ -140,7 +149,7 @@ public void ChangeMouseMode(MouseMode mouseMode, int level = -1, int blockNum =
// while blockLevel is not set, send error message
messageCon.PushMessage(new List<string> { "[ERROR]MouseInMap:ChangeMouseMode:", "Level not set!", "mouseMode=", mouseMode.ToString() },
new List<string> { messageCon.errorColor });
blockLevel = paramCon.scenePrefabSet.GetLevelNumber(nowTargetType);
blockLevel = commonParamCon.scenePrefabSet.GetLevelNumber(nowTargetType);
}
else
{
@ -152,7 +161,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, paramCon.scenePrefabSet.GetBlockNumber(blockLevel, nowTargetType));
this.blockNum = Random.Range(0, commonParamCon.scenePrefabSet.GetBlockNumber(blockLevel, nowTargetType));
}
else
{
@ -160,7 +169,7 @@ public void ChangeMouseMode(MouseMode mouseMode, int level = -1, int blockNum =
this.blockNum = blockNum;
}
// set previewModel
previewModel = paramCon.scenePrefabSet.GetPrefab(blockLevel, this.blockNum, nowTargetType);
previewModel = commonParamCon.scenePrefabSet.GetPrefab(blockLevel, this.blockNum, nowTargetType);
mousePreviewCon.ChangePreviewTo(previewModel);
break;

View File

@ -7,10 +7,10 @@
public class ButtonActivateColorChanger : MonoBehaviour
{
public List<Button> clickableButton = new List<Button>();
public List<Button> unclickableButton = new List<Button>();
[SerializeField] private List<Button> clickableButton = new List<Button>();
[SerializeField] private List<Button> unclickableButton = new List<Button>();
public float colorChangeSpeed = 0.1f;
[SerializeField] private float colorChangeSpeed = 0.1f;
public bool clickable = true;

View File

@ -7,17 +7,17 @@
public class EnvironmentUIControl : MonoBehaviour
{
public GameObject targetControllerObj;
public GameObject parameterContainerObj;
public GameObject groundCanvasObj;
public GameObject chartObj;
public GameObject HUDObj;
public TextMeshProUGUI remainTimeText;
public TextMeshProUGUI targetTypeText;
public TextMeshProUGUI winLoseText;
public TextMeshProUGUI stateText;
public float resultTimeout = 1f;
public GameObject gaugeImgObj;
[SerializeField] private GameObject targetControllerObj;
[SerializeField] private GameObject parameterContainerObj;
[SerializeField] private GameObject groundCanvasObj;
[SerializeField] private GameObject chartObj;
[SerializeField] private GameObject HUDObj;
[SerializeField] private TextMeshProUGUI remainTimeText;
[SerializeField] private TextMeshProUGUI targetTypeText;
[SerializeField] private TextMeshProUGUI winLoseText;
[SerializeField] private TextMeshProUGUI stateText;
[SerializeField] private float resultTimeout = 1f;
[SerializeField] private GameObject gaugeImgObj;
private StringBuilder stateBuilder = new StringBuilder();
private LineChart realTimeRewardChart = null;

View File

@ -7,11 +7,11 @@
public class HUDController : MonoBehaviour
{
public bool chartOn = false;
public GameObject sideChannelObj;
public Toggle chartOnToggleObj;
public Button saveModelButton;
public TMP_InputField chartOnTimeOutInputObj;
public TMP_InputField enemyNumInputObj;
[SerializeField] private GameObject sideChannelObj;
[SerializeField] private Toggle chartOnToggleObj;
[SerializeField] private Button saveModelButton;
[SerializeField] private TMP_InputField chartOnTimeOutInputObj;
[SerializeField] private TMP_InputField enemyNumInputObj;
public float chartOnTimeOut = 1;
public int enemyNum = 3;
public float chartOnTimeOutDefault = 120f;

View File

@ -6,7 +6,7 @@
public class LevelButton : MonoBehaviour
{
public int level;
public TextMeshProUGUI levelText;
[SerializeField] private TextMeshProUGUI levelText;
public void Initialization(int level)
{
this.level = level;

View File

@ -8,9 +8,9 @@ public class LevelPanel : MonoBehaviour
{
private int levelNum = 0;
private float buttonHeight = 30;
public TargetUIController.PrimaryButtonType primaryButtonType;
public GameObject levelButtonPrefab;
public GameObject hudObj;
[SerializeField] private TargetUIController.PrimaryButtonType primaryButtonType;
[SerializeField] private GameObject levelButtonPrefab;
[SerializeField] private GameObject hudObj;
private TargetUIController targetUIController;
public Vector2 defaultPosition = Vector2.zero;
public Vector2 targetPosition = Vector2.zero;

View File

@ -4,8 +4,8 @@
public class LevelProbabilityPanel : MonoBehaviour
{
public GameObject singleTargetLevelProbabilityPanel;
public GameObject startSceneData;
[SerializeField] private GameObject singleTargetLevelProbabilityPanel;
[SerializeField] private GameObject startSceneData;
private SceneBlocksSet scenePrefabSet;
public List<TargetLevelProbabilityPanel> targetLevelProbabilityPanel = new List<TargetLevelProbabilityPanel>();

View File

@ -9,11 +9,10 @@ public class MessageBoxController : MonoBehaviour
public string warningColor = "#ffa500ff";
public string errorColor = "#800000ff";
public string goodColor = "#00ff00ff";
public GameObject messagePanelObj;
public GameObject messageTextPrefab;
[SerializeField] private GameObject messagePanelObj;
[SerializeField] private GameObject messageTextPrefab;
[SerializeField]
private List<Message> messages = new List<Message>();
[SerializeField] private List<Message> messages = new List<Message>();
/// <summary>
/// Pushes a simple message to the message list.
@ -45,7 +44,7 @@ public void PushMessage(string text)
/// 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.
/// </remarks>
public void PushMessage(List<string> messageList,List<string> colorList)
public void PushMessage(List<string> messageList, List<string> colorList)
{
// check messages and colors list length match
if (messageList.Count != colorList.Count)
@ -53,7 +52,7 @@ public void PushMessage(List<string> messageList,List<string> colorList)
// delete extra colors or add white color to extra messages
if (messageList.Count > colorList.Count)
{
while(messageList.Count > colorList.Count)
while (messageList.Count > colorList.Count)
{
colorList.Add(defaultColor);
}
@ -62,7 +61,6 @@ public void PushMessage(List<string> messageList,List<string> colorList)
{
colorList.RemoveRange(messageList.Count, colorList.Count - messageList.Count);
}
}
MessageOverflowHandler();
Message newMessage = new Message();

View File

@ -5,11 +5,11 @@
public class SingleLevelProbabilityPanel : MonoBehaviour
{
public TextMeshProUGUI levelNameText;
public TMP_InputField inputField;
public Button lockButton;
public Image lockImg;
public Image unlockImg;
[SerializeField] private TextMeshProUGUI levelNameText;
[SerializeField] private Button lockButton;
[SerializeField] private Image lockImg;
[SerializeField] private Image unlockImg;
public Slider probabilitySlider;

View File

@ -3,22 +3,23 @@
public class StartMenuAnimations : MonoBehaviour
{
public GameObject maskObj;
public GameObject mixButton;
public GameObject attackButton;
public GameObject gotoButton;
public GameObject freeButton;
[SerializeField] private GameObject maskObj;
[SerializeField] private GameObject mixButton;
[SerializeField] private GameObject attackButton;
[SerializeField] private GameObject gotoButton;
[SerializeField] private GameObject freeButton;
public float animeDuration = 0.2f;
[Header("Animation Parameter")]
[SerializeField] private float animeDuration = 0.2f;
public float animeMoveXDistance = 20f;
public float animeMoveYDistance = 20f;
[SerializeField] private float animeMoveXDistance = 20f;
[SerializeField] private float animeMoveYDistance = 20f;
public float animeScaleX = 1.2f;
public float animeScaleY = 1.2f;
[SerializeField] private float animeScaleX = 1.2f;
[SerializeField] private float animeScaleY = 1.2f;
public float maskScaleX = 1;
public float maskScaleY = 0.4f;
[SerializeField] private float maskScaleX = 1;
[SerializeField] private float maskScaleY = 0.4f;
private Vector3 mixOriginDestination;
private Vector3 attackOriginDestination;
@ -109,6 +110,6 @@ private void MaximizeMaskObj()
private Vector3 fixCanvas(Vector3 vector)
{
// fix position of button while canvas is changed
return vector.FixCanvas(originalCanvas,transform.parent.position);
return vector.FixCanvas(originalCanvas, transform.parent.position);
}
}

View File

@ -3,8 +3,8 @@
public class StartMenuProbabilityPanel : MonoBehaviour
{
public GameObject singleTargetLevelProbabilityPanel;
public GameObject startSceneData;
[SerializeField] private GameObject singleTargetLevelProbabilityPanel;
[SerializeField] private GameObject startSceneData;
private SceneBlocksSet scenePrefabSet;
public List<TargetLevelProbabilityPanel> targetLevelProbabilityPanel = new List<TargetLevelProbabilityPanel>();

View File

@ -5,12 +5,12 @@
public class StartUIManager : MonoBehaviour
{
public int waitTimeLimit = 45;
public GameObject sceneLoaderObj;
public GameObject startSceneDataObj;
public GameObject targetLevelProbabilityPanelOBJ;
public TextMeshProUGUI messageTextObj;
public TextMeshProUGUI waitTimeTextObj;
[SerializeField] private int waitTimeLimit = 45;
[SerializeField] private GameObject sceneLoaderObj;
[SerializeField] private GameObject startSceneDataObj;
[SerializeField] private GameObject targetLevelProbabilityPanelOBJ;
[SerializeField] private TextMeshProUGUI messageTextObj;
[SerializeField] private TextMeshProUGUI waitTimeTextObj;
private SceneLoader sceneLoader;
private StartSeneData startSceneData;

View File

@ -3,12 +3,11 @@
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
public class TargetLevelProbabilityPanel : MonoBehaviour
{
public GameObject singleLevelProbabilityPanel;
public GameObject targetTitleText;
[SerializeField] private GameObject singleLevelProbabilityPanel;
[SerializeField] private GameObject targetTitleText;
private GameObject titleText;
public List<GameObject> singleLevelPanelsObjs = new List<GameObject>();
@ -43,25 +42,6 @@ public void IntializePanels(int levelNum, string titleName)
panelNum = levelNum;
}
/// <summary>
/// Adds an event trigger entry to an event trigger.
/// </summary>
/// <param name="trigger">The event trigger object.</param>
/// <param name="type">The event trigger type.</param>
/// <param name="action">The event handler method to execute.</param>
private void AddEventTrigger(GameObject gameObject, EventTriggerType triggerType, System.Action<BaseEventData> action)
{
EventTrigger eventTrigger = gameObject.GetComponent<EventTrigger>();
if (eventTrigger == null)
{
eventTrigger = gameObject.AddComponent<EventTrigger>();
}
EventTrigger.Entry entry = new EventTrigger.Entry();
entry.eventID = triggerType;
entry.callback.AddListener(new UnityEngine.Events.UnityAction<BaseEventData>(action));
eventTrigger.triggers.Add(entry);
}
/// <summary>
/// On Probability Slider Value Change.Adjust other sliders' value to make sure the total value is 1.
/// </summary>
@ -75,17 +55,20 @@ private void OnProbabilityValueChange<T>(T value, int exceptedIndex)
case float floatValue:
changedValue = floatValue;
break;
case string stringValue:
changedValue = float.Parse(stringValue);
// limit the value between 0 and 1
if(changedValue>1 && changedValue <=100)
if (changedValue > 1 && changedValue <= 100)
{
changedValue /= 100;
}else if(changedValue>100)
}
else if (changedValue > 100)
{
changedValue = 1;
}
break;
default:
Debug.LogError("Invalid value type!");
throw new ArgumentException("Unsupported value type");
@ -164,8 +147,19 @@ private void enableSliderListener()
}
/// <summary>
/// calculate the correction value to each panel,while the total value is not equal to 1
/// Recalculates correction values.
/// </summary>
/// <param name="correctionValues">The current array of correction values.</param>
/// <param name="exceptedIndex">The index of the panel that is expected not to change.</param>
/// <param name="value">The expected probability value.</param>
/// <param name="extraValue">Additional correction value.</param>
/// <param name="maxLimitValue">The maximum limit for the probability value.</param>
/// <returns>Returns a tuple containing a float array and an integer.
/// The float array is the new correction values, and the integer is the number of panels that need to be corrected in the next iteration.</returns>
/// <remarks>
/// This method calculates new correction values based on the provided parameters.
/// During the iteration, some panels might exceed set limits, and their values will need to be corrected in the next iteration.
/// </remarks>
private (float[], int) reCalculateCorrectionValues(float[] correctionValues, int exceptedIndex, float value, float extraValue, float maxLimitValue)
{
// the number of panels which need to be corrected in next iteration

View File

@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
@ -8,27 +7,28 @@ public class TargetUIController : MonoBehaviour
{
// Controller to control the UI of the target,
// select target type, select prefeb to set or sth.
public GameObject targetControllerObj;
public GameObject mouseSelectorObj;
public GameObject environmentUIObj;
[SerializeField] private GameObject targetControllerObj;
[SerializeField] private GameObject mouseSelectorObj;
[SerializeField] private GameObject environmentUIObj;
public float levelButtonHeight = 30;
[SerializeField] private float levelButtonHeight = 30;
[Header("PrimaryButton")]
public Button clearGameButton;
public Button setEnemyButton;
public Button setAttackButton;
public Button setGotoButton;
public Button setFreeButton;
public Button setStayButton;
public int primaryButtonNumber = 6;
[SerializeField] private Button clearGameButton;
[SerializeField] private Button setEnemyButton;
[SerializeField] private Button setAttackButton;
[SerializeField] private Button setGotoButton;
[SerializeField] private Button setFreeButton;
[SerializeField] private Button setStayButton;
[SerializeField] private int primaryButtonNumber = 6;
[Header("LevelPanel")]
public GameObject gotoLevelPanel;
[SerializeField] private GameObject gotoLevelPanel;
public GameObject attackLevelPanel;
public float levelPanelAnimeTime = 0.2f;
[SerializeField] private GameObject attackLevelPanel;
[SerializeField] private float levelPanelAnimeTime = 0.2f;
private MouseInMap mouseInMapCon;
private EnvironmentUIControl envUICon;
@ -162,9 +162,9 @@ private void SetAttackPressed(int level)
/// <param name="levelPanel">The level panel object containing the level buttons.</param>
private void AddLevelButtonToColorChanger(GameObject levelPanel)
{
foreach(Button btn in levelPanel.GetComponent<LevelPanel>().LevelButtonList)
foreach (Button btn in levelPanel.GetComponent<LevelPanel>().LevelButtonList)
{
buttonColorChanger.AddButtonToColorChangerButtonList(btn,true);
buttonColorChanger.AddButtonToColorChangerButtonList(btn, true);
}
}

View File

@ -4,7 +4,7 @@
public class WorldUIController : MonoBehaviour
{
public LineChart winChart;
[SerializeField] private LineChart winChart;
public int[] totalGames;
public int[] winGames;

View File

@ -9,13 +9,13 @@ EditorUserSettings:
value: 55090405535008090b5608764626074415151c79747c74602b7c1861e4b96c6c
flags: 0
RecentlyUsedSceneGuid-1:
value: 5703025650035e5d090f087148715d4443161e2c7e2c20357b281b31b0e43060
value: 06570c0704040b0e5a575520137b5e44154f192e292d22367c2c4866b7b3376f
flags: 0
RecentlyUsedSceneGuid-2:
value: 5453565f53020f085f5d0e72157a0844454f4c2b757d7265757a4f64b7b4313c
value: 5703025650035e5d090f087148715d4443161e2c7e2c20357b281b31b0e43060
flags: 0
RecentlyUsedSceneGuid-3:
value: 06570c0704040b0e5a575520137b5e44154f192e292d22367c2c4866b7b3376f
value: 5453565f53020f085f5d0e72157a0844454f4c2b757d7265757a4f64b7b4313c
flags: 0
RecentlyUsedScenePath-0:
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d

View File

@ -14,16 +14,16 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_PixelRect:
serializedVersion: 2
x: -21
y: 128
x: 65
y: 43
width: 1855
height: 1037
m_ShowMode: 4
m_Title: Game
m_Title: Inspector
m_RootView: {fileID: 2}
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
m_Maximized: 0
m_Maximized: 1
--- !u!114 &2
MonoBehaviour:
m_ObjectHideFlags: 52
@ -120,7 +120,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 28
controlID: 65
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
@ -140,12 +140,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1038
width: 991
height: 987
m_MinSize: {x: 100, y: 200}
m_MaxSize: {x: 8096, y: 16192}
vertical: 1
controlID: 16
controlID: 22
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
@ -156,23 +156,23 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name: GameView
m_Name: SceneView
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 1038
height: 594
m_MinSize: {x: 101, y: 121}
width: 991
height: 707
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 14}
m_ActualView: {fileID: 13}
m_Panes:
- {fileID: 14}
- {fileID: 13}
m_Selected: 0
m_LastSelected: 1
m_Selected: 1
m_LastSelected: 0
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@ -189,9 +189,9 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 594
width: 1038
height: 393
y: 707
width: 991
height: 280
m_MinSize: {x: 231, y: 271}
m_MaxSize: {x: 10001, y: 10021}
m_ActualView: {fileID: 15}
@ -217,14 +217,14 @@ MonoBehaviour:
- {fileID: 11}
m_Position:
serializedVersion: 2
x: 1038
x: 991
y: 0
width: 405
width: 513
height: 987
m_MinSize: {x: 100, y: 200}
m_MaxSize: {x: 8096, y: 16192}
vertical: 1
controlID: 29
controlID: 66
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 52
@ -242,10 +242,10 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 405
height: 611
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
width: 513
height: 486
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 17}
m_Panes:
- {fileID: 17}
@ -267,11 +267,11 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 611
width: 405
height: 376
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 4000, y: 4000}
y: 486
width: 513
height: 501
m_MinSize: {x: 102, y: 121}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 18}
m_Panes:
- {fileID: 18}
@ -293,9 +293,9 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 1443
x: 1504
y: 0
width: 412
width: 351
height: 987
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
@ -326,8 +326,8 @@ MonoBehaviour:
serializedVersion: 2
x: 65
y: 73
width: 1037
height: 573
width: 990
height: 686
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -348,9 +348,9 @@ MonoBehaviour:
floating: 0
collapsed: 0
displayed: 1
snapOffset: {x: -141, y: 149}
snapOffset: {x: 0, y: 149}
snapOffsetDelta: {x: 0, y: 0}
snapCorner: 1
snapCorner: 0
id: unity-grid-and-snap-toolbar
index: 1
layout: 1
@ -424,7 +424,7 @@ MonoBehaviour:
containerId: overlay-container--right
floating: 0
collapsed: 0
displayed: 1
displayed: 0
snapOffset: {x: 0, y: 0}
snapOffsetDelta: {x: 0, y: 0}
snapCorner: 0
@ -557,14 +557,14 @@ MonoBehaviour:
m_OverrideSceneCullingMask: 6917529027641081856
m_SceneIsLit: 1
m_SceneLighting: 1
m_2DMode: 0
m_2DMode: 1
m_isRotationLocked: 0
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: -93.190475, y: 4.007041, z: -23.907015}
m_Target: {x: 55.10534, y: 48.328194, z: -133.0123}
speed: 2
m_Value: {x: -93.190475, y: 4.007041, z: -23.907015}
m_Value: {x: 55.10534, y: 48.328194, z: -133.0123}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@ -611,17 +611,17 @@ MonoBehaviour:
m_GridAxis: 1
m_gridOpacity: 0.529
m_Rotation:
m_Target: {x: -0.04341376, y: 0.5871053, z: 0.031550582, w: 0.80778545}
m_Target: {x: 0, y: 0, z: 0, w: 1}
speed: 2
m_Value: {x: -0.043411803, y: 0.5870788, z: 0.03154916, w: 0.80774903}
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 12.124355
m_Target: 330.06903
speed: 2
m_Value: 12.124355
m_Value: 330.06903
m_Ortho:
m_Target: 0
m_Target: 1
speed: 2
m_Value: 0
m_Value: 1
m_CameraSettings:
m_Speed: 1.0005
m_SpeedNormalized: 0.5
@ -635,7 +635,7 @@ MonoBehaviour:
m_FarClip: 10000
m_DynamicClip: 1
m_OcclusionCulling: 0
m_LastSceneViewRotation: {x: -0.23316237, y: -0.24425557, z: 0.060633, w: -0.93931496}
m_LastSceneViewRotation: {x: -0.08717229, y: 0.89959055, z: -0.21045254, w: -0.3726226}
m_LastSceneViewOrtho: 0
m_ReplacementShader: {fileID: 0}
m_ReplacementString:
@ -662,10 +662,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: -21
y: 158
width: 1037
height: 573
x: 65
y: 73
width: 990
height: 686
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -673,17 +673,17 @@ MonoBehaviour:
m_SerializedViewNames: []
m_SerializedViewValues: []
m_PlayModeViewName: GameView
m_ShowGizmos: 1
m_ShowGizmos: 0
m_TargetDisplay: 0
m_ClearColor: {r: 0, g: 0, b: 0, a: 0}
m_TargetSize: {x: 1037, y: 552}
m_TargetSize: {x: 990, y: 665}
m_TextureFilterMode: 0
m_TextureHideFlags: 61
m_RenderIMGUI: 1
m_EnterPlayModeBehavior: 0
m_UseMipMap: 0
m_VSyncEnabled: 0
m_Gizmos: 1
m_Gizmos: 0
m_Stats: 0
m_SelectedSizes: 00000000000000000000000000000000000000000000000000000000000000000000000000000000
m_ZoomArea:
@ -691,10 +691,10 @@ MonoBehaviour:
m_VRangeLocked: 0
hZoomLockedByDefault: 0
vZoomLockedByDefault: 0
m_HBaseRangeMin: -518.5
m_HBaseRangeMax: 518.5
m_VBaseRangeMin: -276
m_VBaseRangeMax: 276
m_HBaseRangeMin: -495
m_HBaseRangeMax: 495
m_VBaseRangeMin: -332.5
m_VBaseRangeMax: 332.5
m_HAllowExceedBaseRangeMin: 1
m_HAllowExceedBaseRangeMax: 1
m_VAllowExceedBaseRangeMin: 1
@ -703,7 +703,7 @@ MonoBehaviour:
m_HSlider: 0
m_VSlider: 0
m_IgnoreScrollWheelUntilClicked: 0
m_EnableMouseInput: 1
m_EnableMouseInput: 0
m_EnableSliderZoomHorizontal: 0
m_EnableSliderZoomVertical: 0
m_UniformScale: 1
@ -712,23 +712,23 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 21
width: 1037
height: 552
width: 990
height: 665
m_Scale: {x: 1, y: 1}
m_Translation: {x: 518.5, y: 276}
m_Translation: {x: 495, y: 332.5}
m_MarginLeft: 0
m_MarginRight: 0
m_MarginTop: 0
m_MarginBottom: 0
m_LastShownAreaInsideMargins:
serializedVersion: 2
x: -518.5
y: -276
width: 1037
height: 552
x: -495
y: -332.5
width: 990
height: 665
m_MinimalGUI: 1
m_defaultScale: 1
m_LastWindowPixelSize: {x: 1037, y: 573}
m_LastWindowPixelSize: {x: 990, y: 686}
m_ClearInEditMode: 1
m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 01000000000000000000
@ -754,10 +754,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 0
y: 613
width: 1037
height: 372
x: 65
y: 780
width: 990
height: 259
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -775,22 +775,22 @@ MonoBehaviour:
m_SkipHidden: 0
m_SearchArea: 1
m_Folders:
- Assets/Script/GameScript
- Assets/Script/UI
m_Globs: []
m_OriginalText:
m_ViewMode: 1
m_StartGridSize: 16
m_LastFolders:
- Assets/Script/GameScript
- Assets/Script/UI
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: 352}
m_SelectedIDs: 7c970000
m_LastClickedID: 38780
m_ExpandedIDs: 000000005e97000060970000629700006497000066970000689700006a9700006c9700006e97000070970000729700007497000076970000789700007a9700007c9700007e970000d297000000ca9a3bffffff7f
scrollPos: {x: 0, y: 593}
m_SelectedIDs: b0980000
m_LastClickedID: 39088
m_ExpandedIDs: 0000000000980000029800000498000006980000089800000a9800000c9800000e98000010980000129800001498000016980000189800001a9800001c9800001e9800002098000022980000249800007a98000000ca9a3bffffff7f
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -818,7 +818,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 000000005e97000060970000629700006497000066970000689700006a9700006c9700006e97000070970000729700007497000076970000789700007a9700007c9700007e970000
m_ExpandedIDs: 0000000000980000029800000498000006980000089800000a9800000c9800000e98000010980000129800001498000016980000189800001a9800001c9800001e980000209800002298000024980000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -849,18 +849,18 @@ MonoBehaviour:
m_ExpandedInstanceIDs: c62300008a5c000000000000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
m_OriginalName:
m_Name: RayInfoUI
m_OriginalName: RayInfoUI
m_EditFieldRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_UserData: 0
m_UserData: 4132
m_IsWaitingForDelay: 0
m_IsRenaming: 0
m_OriginalEventType: 11
m_OriginalEventType: 0
m_IsRenamingFilename: 1
m_ClientGUIView: {fileID: 8}
m_CreateAssetUtility:
@ -922,20 +922,20 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1017
y: 158
width: 403
height: 590
x: 1056
y: 73
width: 511
height: 465
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
m_SaveData: []
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 30740000
m_LastClickedID: 29744
m_ExpandedIDs: 32fbffffea73000064740000187900003e7b0000047c0000
scrollPos: {x: 0, y: 148}
m_SelectedIDs: a80c0100
m_LastClickedID: 68776
m_ExpandedIDs: 6e24ffff3425ffffec31ffffac42ffff5ee3ffffacf3ffff32fbffffb6990000009a000040a2000068090100ba090100840d0100
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -951,7 +951,7 @@ MonoBehaviour:
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 0
m_ClientGUIView: {fileID: 10}
m_ClientGUIView: {fileID: 12}
m_SearchString:
m_ExpandedScenes: []
m_CurrenRootInstanceID: 0
@ -979,10 +979,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1017
y: 769
width: 403
height: 355
x: 1056
y: 559
width: 511
height: 480
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -1035,9 +1035,9 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1422
y: 158
width: 411
x: 1569
y: 73
width: 350
height: 966
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -1050,7 +1050,7 @@ MonoBehaviour:
m_ControlHash: -371814159
m_PrefName: Preview_InspectorPreview
m_LastInspectedObjectInstanceID: -1
m_LastVerticalScrollValue: 280
m_LastVerticalScrollValue: 0
m_GlobalObjectId:
m_InspectorMode: 0
m_LockTracker: