Skip to content

Commit 927a4ea

Browse files
committed
moved a couple scripts in the modular-agents library, since we will need them for more than 1 environment
1 parent 33885ad commit 927a4ea

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

modular-agents/core/Runtime/Training Event System/Animation/AnimationTrainingEvent.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44

5+
[RequireComponent(typeof(Animator))]
56
public class AnimationTrainingEvent : TrainingEvent
67
{
7-
[SerializeField] Animator animator;
8+
// [SerializeField] string clipName;
89
[SerializeField] int clipId;
910
[SerializeField] float time;
1011

1112
// Start is called before the first frame update
1213
void Awake()
1314
{
14-
AnimationClip clip = animator.runtimeAnimatorController.animationClips[clipId];
15+
// GetComponent<Animator>()
16+
AnimationClip clip = GetComponent<Animator>().runtimeAnimatorController.animationClips[clipId];
1517

1618
var animEvent = new AnimationEvent();
1719
animEvent.functionName = "AnimEventWrapper";

UnityMjExamples/Assets/Environments/0.CartPole/RL Scripts/SetDofStateEvent.cs renamed to modular-agents/mujoco/Runtime/Training Events/MjDofStateHandler.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
using System.Collections.Generic;
55
using UnityEngine;
66

7-
public class SetDofStateEvent : TrainingEventHandler
7+
/// <summary>
8+
/// Sets the position, velocity and acceleration state vectors of a given degrees of freedom to values specified by a given vector.
9+
/// </summary>
10+
public class MjDofStateHandler
11+
12+
: TrainingEventHandler
813
{
914
public override EventHandler Handler => (_, _) => ResetMj();
1015

UnityMjExamples/Assets/Environments/0.CartPole/RL Scripts/SetDofStateEvent.cs.meta renamed to modular-agents/mujoco/Runtime/Training Events/MjDofStateHandler.cs.meta

File renamed without changes.

UnityMjExamples/Assets/Scripts/ResetMjState.cs renamed to modular-agents/mujoco/Runtime/Training Events/MjResetState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Collections.Generic;
55
using UnityEngine;
66

7-
public class ResetMjState : TrainingEventHandler
7+
public class MjResetState : TrainingEventHandler
88
{
99
public override EventHandler Handler => (_, _) => ResetMj();
1010

UnityMjExamples/Assets/Scripts/ResetMjState.cs.meta renamed to modular-agents/mujoco/Runtime/Training Events/MjResetState.cs.meta

File renamed without changes.

0 commit comments

Comments
 (0)