V3.3.0 MultiLevel功能创建完成

MultiLevel功能创建完成,play模式基本功能适配结束。下次再也不隔这么久commit一次了:(
This commit is contained in:
2023-09-08 07:15:24 +09:00
parent 5226f1dbbf
commit 203407693c
63 changed files with 2924 additions and 2384 deletions
+5 -5
View File
@@ -12,7 +12,7 @@ public class AgentController : MonoBehaviour
public GameObject environmentUIControlObj;
public GameObject targetControllerObj;
public GameObject HUDObj;
public Camera nowCam;
public Camera fpsCam;
[Header("GetAxis() Simulate")]
public float moveSpeed = 9.0f;
@@ -182,7 +182,7 @@ public class AgentController : MonoBehaviour
//相机在上下旋转移动时,相机方向不会随着移动,类似于低头和抬头,左右移动时,相机方向会随着向左向右移动,类似于向左向右看
//所以在控制相机向左向右旋转时,要保证和父物体一起转动
nowCam.transform.localRotation = Quaternion.Euler(yRotation, 0, 0);
fpsCam.transform.localRotation = Quaternion.Euler(yRotation, 0, 0);
//this.transform指这个CameraRotation的位置,localRotation指的是旋转轴
//transform.localRotation = Quaternion.Eular(x,y,z)控制旋转的时候,按照X-Y-Z轴的旋转顺规
//即以围绕X轴旋转x度,围绕Y轴旋转y度,围绕Z轴旋转z度
@@ -196,8 +196,8 @@ public class AgentController : MonoBehaviour
// ballistic 射击弹道处理,并返回获得reward
private float Ballistic(int shootState)
{
Vector3 point = new Vector3(nowCam.pixelWidth / 2, nowCam.pixelHeight / 2, 0);//发射位置
Ray ray = nowCam.ScreenPointToRay(point);
Vector3 point = new Vector3(fpsCam.pixelWidth / 2, fpsCam.pixelHeight / 2, 0);//发射位置
Ray ray = fpsCam.ScreenPointToRay(point);
RaycastHit hit;
// Debug.DrawRay(ray.origin, ray.direction * 100, Color.blue);
//按下鼠标左键
@@ -252,7 +252,7 @@ public class AgentController : MonoBehaviour
float nowReward = 0;
bool isFacingtoEnemy = false;
float enemyFacingDistance = 0f;
Ray ray = nowCam.ScreenPointToRay(new Vector3(nowCam.pixelWidth / 2, nowCam.pixelHeight / 2, 0));
Ray ray = fpsCam.ScreenPointToRay(new Vector3(fpsCam.pixelWidth / 2, fpsCam.pixelHeight / 2, 0));
if (targetCon.targetTypeInt == (int)SceneBlockContainer.Targets.Free)
{
//free mode
+4
View File
@@ -43,6 +43,8 @@ public class TargetController : MonoBehaviour
[SerializeField, Range(0f, 1f)] public float defenceProb = 0.2f;
[System.NonSerialized] public int targetTypeInt;
[System.NonSerialized] public int gotoLevelNum;
[System.NonSerialized] public int attackLevelNum;
public float[] targetState = new float[6];
public enum EndType
@@ -103,6 +105,8 @@ public class TargetController : MonoBehaviour
freeProb = 1 - attackProb - gotoProb - defenceProb;
targetNum = (int)SceneBlockContainer.Targets.Num;
gotoLevelNum = sceneBlockCon.scenePrefabSet.GetLevelNumber(SceneBlockContainer.Targets.Go);
attackLevelNum = sceneBlockCon.scenePrefabSet.GetLevelNumber(SceneBlockContainer.Targets.Attack);
if (freeProb < 0)
{
Debug.LogError("TargetController.Start: target percentage wrong");