Browse Source

getup model swap on 'G' added

main
cailean 7 months ago
parent
commit
ff3a5cfff2
  1. 16
      Assets/2_Chair/Chair.prefab
  2. 34
      Assets/6_Scenes/Beep.unity
  3. 21
      Assets/7_Scripts/Agent/Walker.cs
  4. 2
      Assets/ML-Agents/Timers/Beep_timers.json

16
Assets/2_Chair/Chair.prefab

@ -210,6 +210,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &2225134942834663317 --- !u!1 &2225134942834663317
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -420,6 +421,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &2907507614063161647 --- !u!1 &2907507614063161647
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -630,6 +632,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &3022150810398622485 --- !u!1 &3022150810398622485
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -840,6 +843,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &3028507005537857522 --- !u!1 &3028507005537857522
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1134,6 +1138,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &3677055482454108232 --- !u!1 &3677055482454108232
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1385,6 +1390,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &4685213736971843660 --- !u!1 &4685213736971843660
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1595,6 +1601,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &4871452371939253621 --- !u!1 &4871452371939253621
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1976,6 +1983,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &5777259271730693716 --- !u!1 &5777259271730693716
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2067,7 +2075,7 @@ MonoBehaviour:
rWalkSpeedEachEpisode: 0 rWalkSpeedEachEpisode: 0
m_RandomiseYRotation: 0 m_RandomiseYRotation: 0
m_RandomiseXYZRotation: 0 m_RandomiseXYZRotation: 0
m_ModelSwap: 0 m_ModelSwap: 1
m_ProximitySwapper: 0 m_ProximitySwapper: 0
m_SwitchModelAfterFalling: 0 m_SwitchModelAfterFalling: 0
m_StepCountAtLastMeter: 0 m_StepCountAtLastMeter: 0
@ -2351,6 +2359,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &6628358011295906335 --- !u!1 &6628358011295906335
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2561,6 +2570,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &6794064008694923825 --- !u!1 &6794064008694923825
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2673,6 +2683,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &7331846505223066426 --- !u!1 &7331846505223066426
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2880,6 +2891,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &7470254353610657185 --- !u!1 &7470254353610657185
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3090,6 +3102,7 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0
--- !u!1 &8666002640045771141 --- !u!1 &8666002640045771141
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3297,3 +3310,4 @@ MonoBehaviour:
touchingObject: 0 touchingObject: 0
touchingGround: 0 touchingGround: 0
touchingStairs: 0 touchingStairs: 0
touchingSit: 0

34
Assets/6_Scenes/Beep.unity

@ -234,7 +234,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 83569712} m_GameObject: {fileID: 83569712}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.020231633, y: 0.9743378, z: -0.097696625, w: 0.20177202} m_LocalRotation: {x: 0.020231629, y: 0.9743378, z: -0.097696625, w: 0.20177199}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -392,7 +392,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 155411616} m_GameObject: {fileID: 155411616}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.03223712, y: 0.96677077, z: -0.15566999, w: 0.20020498} m_LocalRotation: {x: 0.032237124, y: 0.96677077, z: -0.15566999, w: 0.200205}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -516,7 +516,7 @@ Transform:
m_GameObject: {fileID: 163243333} m_GameObject: {fileID: 163243333}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.91, y: -32.51, z: 83.67} m_LocalPosition: {x: -0.91, y: -32.51, z: 84.05}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -1097,7 +1097,7 @@ MonoBehaviour:
LensShift: {x: 0, y: 0} LensShift: {x: 0, y: 0}
GateFit: 1 GateFit: 1
FocusDistance: 8.93528 FocusDistance: 8.93528
m_SensorSize: {x: 36, y: 24} m_SensorSize: {x: 1, y: 1}
Iso: 50 Iso: 50
ShutterSpeed: 0.0005 ShutterSpeed: 0.0005
Aperture: 2.2 Aperture: 2.2
@ -1250,7 +1250,7 @@ MonoBehaviour:
LensShift: {x: 0, y: 0} LensShift: {x: 0, y: 0}
GateFit: 1 GateFit: 1
FocusDistance: 0.01 FocusDistance: 0.01
m_SensorSize: {x: 36, y: 24} m_SensorSize: {x: 1, y: 1}
Iso: 50 Iso: 50
ShutterSpeed: 0.0005 ShutterSpeed: 0.0005
Aperture: 1.9 Aperture: 1.9
@ -1838,7 +1838,7 @@ MonoBehaviour:
LensShift: {x: 0, y: 0} LensShift: {x: 0, y: 0}
GateFit: 1 GateFit: 1
FocusDistance: 8.93528 FocusDistance: 8.93528
m_SensorSize: {x: 36, y: 24} m_SensorSize: {x: 1, y: 1}
Iso: 50 Iso: 50
ShutterSpeed: 0.0005 ShutterSpeed: 0.0005
Aperture: 2.2 Aperture: 2.2
@ -1881,7 +1881,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 513050371} m_GameObject: {fileID: 513050371}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.17829932, y: -0.22369511, z: 0.041663487, w: 0.9573056} m_LocalRotation: {x: 0.17829932, y: -0.22369513, z: 0.041663494, w: 0.9573056}
m_LocalPosition: {x: 9.355881, y: -3.2973547, z: -5.6164856} m_LocalPosition: {x: 9.355881, y: -3.2973547, z: -5.6164856}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -1919,7 +1919,7 @@ MonoBehaviour:
LensShift: {x: -0.21, y: 0.15} LensShift: {x: -0.21, y: 0.15}
GateFit: 1 GateFit: 1
FocusDistance: 10 FocusDistance: 10
m_SensorSize: {x: 36, y: 24} m_SensorSize: {x: 1, y: 1}
Iso: 50 Iso: 50
ShutterSpeed: 0.0005 ShutterSpeed: 0.0005
Aperture: 2.2 Aperture: 2.2
@ -2009,7 +2009,7 @@ Transform:
m_GameObject: {fileID: 533893388} m_GameObject: {fileID: 533893388}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 5.45, y: -29.72, z: 83.06} m_LocalPosition: {x: 5.45, y: -30.62, z: 84.09}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -2141,7 +2141,7 @@ MonoBehaviour:
LensShift: {x: 0, y: 0} LensShift: {x: 0, y: 0}
GateFit: 1 GateFit: 1
FocusDistance: 8.93528 FocusDistance: 8.93528
m_SensorSize: {x: 36, y: 24} m_SensorSize: {x: 1, y: 1}
Iso: 50 Iso: 50
ShutterSpeed: 0.0005 ShutterSpeed: 0.0005
Aperture: 2.2 Aperture: 2.2
@ -3001,7 +3001,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1178814724} m_GameObject: {fileID: 1178814724}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: 0.020202018, y: 0.9790844, z: -0.16078894, w: 0.12301517} m_LocalRotation: {x: 0.020202018, y: 0.9790844, z: -0.16078894, w: 0.123015165}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
@ -3831,7 +3831,7 @@ Transform:
m_GameObject: {fileID: 1591509191} m_GameObject: {fileID: 1591509191}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 9.6, y: -30.1, z: 83.3} m_LocalPosition: {x: 11.19, y: -30.1, z: 83.3}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -5046,6 +5046,16 @@ PrefabInstance:
value: value:
objectReference: {fileID: 13400000, guid: 55fa6736a2a0f42ae9e0418644d109e6, objectReference: {fileID: 13400000, guid: 55fa6736a2a0f42ae9e0418644d109e6,
type: 2} type: 2}
- target: {fileID: 2711207082700034684, guid: 14d8283abcefffd4a916b8611ccd49fa,
type: 3}
propertyPath: m_LocalPosition.x
value: -4.845
objectReference: {fileID: 0}
- target: {fileID: 2711207082700034684, guid: 14d8283abcefffd4a916b8611ccd49fa,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.545
objectReference: {fileID: 0}
- target: {fileID: 3006033085249723243, guid: 14d8283abcefffd4a916b8611ccd49fa, - target: {fileID: 3006033085249723243, guid: 14d8283abcefffd4a916b8611ccd49fa,
type: 3} type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x

21
Assets/7_Scripts/Agent/Walker.cs

@ -288,7 +288,7 @@ public class Walker : Agent
// Check if model swapper is on // Check if model swapper is on
if (m_ModelSwap) if (m_ModelSwap)
{ {
SwitchModelAfterFalling(); //SwitchModelAfterFalling();
} }
UpdateOrientationObject(); UpdateOrientationObject();
@ -380,24 +380,31 @@ public class Walker : Agent
{ {
if (m_ModelSwap) if (m_ModelSwap)
{ {
//InputSwitchModel(); InputSwitchModel();
} }
} }
private void InputSwitchModel() private void InputSwitchModel()
{ {
if (Input.GetKeyDown(KeyCode.O))
if (Input.GetKeyDown(KeyCode.G))
{
if( !m_FinishedSwap )
{ {
m_ModelSwapper.SwitchModel("Walker", this); m_FinishedSwap = true;
m_ModelSwapper.m_PastModel = m_ModelSwapper.m_currentModelName;
m_ModelSwapper.SwitchModel("Getup", this);
} }
else
if (Input.GetKeyDown(KeyCode.P))
{ {
m_ModelSwapper.SwitchModel("Stairs", this); m_FinishedSwap = false;
m_ModelSwapper.SwitchModel(m_ModelSwapper.m_PastModel, this);
} }
} }
}
private void SwitchModelAfterFalling() private void SwitchModelAfterFalling()
{ {
if (m_SwitchModelAfterFalling) if (m_SwitchModelAfterFalling)

2
Assets/ML-Agents/Timers/Beep_timers.json

@ -1 +1 @@
{"count":1,"self":85.4708864,"total":86.2944977,"children":{"InitializeActuators":{"count":1,"self":0.0010007,"total":0.0010007,"children":null},"InitializeSensors":{"count":1,"self":0.0020039,"total":0.0020039,"children":null},"AgentSendState":{"count":4017,"self":0.0392186,"total":0.10328069999999999,"children":{"CollectObservations":{"count":804,"self":0.0306712,"total":0.0306712,"children":null},"WriteActionMask":{"count":804,"self":0.0019992,"total":0.0019992,"children":null},"RequestDecision":{"count":804,"self":0.0313917,"total":0.0313917,"children":null}}},"DecideAction":{"count":4017,"self":0.6761115,"total":0.6836808,"children":{"RayPerceptionSensor.Perceive":{"count":804,"self":0.0075692999999999993,"total":0.0075692999999999993,"children":null}}},"AgentAct":{"count":4017,"self":0.0336451,"total":0.0336451,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1710852750","unity_version":"2023.2.8f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2023.2.8f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\Projects\\24_02-Beep\\4_Unity\\Beep Final Git\\beep-final -useHub -hubIPC -cloudEnvironment production","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.3.0-exp.3","scene_name":"Beep","end_time_seconds":"1710852836"}} {"count":1,"self":45.6146336,"total":46.2928968,"children":{"InitializeActuators":{"count":1,"self":0.0010107,"total":0.0010107,"children":null},"InitializeSensors":{"count":1,"self":0.0010039,"total":0.0010039,"children":null},"AgentSendState":{"count":2021,"self":0.0211559,"total":0.3031351,"children":{"CollectObservations":{"count":405,"self":0.0070731,"total":0.0070731,"children":null},"WriteActionMask":{"count":405,"self":0,"total":0,"children":null},"RequestDecision":{"count":405,"self":0.2749061,"total":0.2749061,"children":null}}},"DecideAction":{"count":2021,"self":0.3534794,"total":0.3560065,"children":{"RayPerceptionSensor.Perceive":{"count":405,"self":0.0025271,"total":0.0025271,"children":null}}},"AgentAct":{"count":2021,"self":0.0161058,"total":0.0161058,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1710853612","unity_version":"2023.2.8f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2023.2.8f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\Projects\\24_02-Beep\\4_Unity\\Beep Final Git\\beep-final -useHub -hubIPC -cloudEnvironment production","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.3.0-exp.3","scene_name":"Beep","end_time_seconds":"1710853658"}}
Loading…
Cancel
Save