浏览代码

cp

/hh-develop-fps_game_project
HH 4 年前
当前提交
6d608fc1
共有 3 个文件被更改,包括 15 次插入17 次删除
  1. 6
      Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/PlayerCubeWithGun.prefab
  2. 14
      Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity
  3. 12
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeMovement.cs

6
Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/PlayerCubeWithGun.prefab


m_Script: {fileID: 11500000, guid: fa7155796051b734daa718462081dc5f, type: 3}
m_Name:
m_EditorClassIdentifier:
m_BindingMode: 5
m_BindingMode: 1
m_FollowOffset: {x: 0, y: 2, z: -5}
m_XDamping: 1
m_YDamping: 1

m_YawDamping: 0
m_YawDamping: 1
m_RollDamping: 0
m_AngularDamping: 0
--- !u!1 &1517390717

groundPoundForceMode: 1
groundPoundForce: 35
spinAttackSpeed: 20
agentRotationSpeed: 10
agentRotationSpeed: 2
agentJumpVelocity: 15
agentFallingSpeed: 50
cam: {fileID: 0}

14
Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity


m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1517390719, guid: 497c5a1fa56ff4204a66acfb42a8ebde, type: 3}
propertyPath: m_LocalRotation.x
value: 0.08767625
objectReference: {fileID: 0}
- target: {fileID: 1517390719, guid: 497c5a1fa56ff4204a66acfb42a8ebde, type: 3}
propertyPath: m_LocalRotation.y
value: 0.00000002600996
objectReference: {fileID: 0}
- target: {fileID: 1517390719, guid: 497c5a1fa56ff4204a66acfb42a8ebde, type: 3}
propertyPath: m_LocalRotation.z
value: -0.0000000022892717
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalPosition.x

m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1828481691}
m_LocalRotation: {x: -0.0000000022892717, y: 0.99614906, z: -0.08767625, w: -0.00000002600996}
m_LocalRotation: {x: 3.4656758e-10, y: 0.99614906, z: -0.087676235, w: 0.0000000039375903}
m_LocalPosition: {x: 0, y: 1.9999999, z: 6.4973907}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []

12
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeMovement.cs


}
if (lookDir != Vector3.zero)
{
// var camRotDir = lookDir;
// camRotDir.z = Mathf.Clamp01(camRotDir.z);
// var rot = quaternion.LookRotation(camRotDir, Vector3.up);
rb.rotation = Quaternion.Lerp(rb.rotation, rot, agentRotationSpeed * Time.deltaTime);
rb.rotation = Quaternion.Lerp(rb.rotation, rot, agentRotationSpeed * Time.fixedDeltaTime);
}
// RunOnGround(rb, dir.normalized);
// var dirToGo = rb.transform.forward;

}
else
{
// var forwardMovement = lookDir;
//// forwardMovement.x = 0; //
// var walkDir = cam.transform.TransformDirection(forwardMovement);
// RunOnGround(rb, walkDir.normalized);
RunOnGround(rb, dirToGo.normalized);
}
// rb.MoveRotation(rb.rotation * Quaternion.AngleAxis(agentRotationSpeed, rotationAxis));

正在加载...
取消
保存