|
|
|
|
|
|
using System; |
|
|
|
#if UNITY_EDITOR
|
|
|
|
#endif
|
|
|
|
using UnityEngine; |
|
|
|
|
|
|
|
namespace MLAgents.RewardProvider |
|
|
|
|
|
|
|
|
|
|
void RewardReset(float reward) |
|
|
|
{ |
|
|
|
#if UNITY_EDITOR
|
|
|
|
var keyframe = new Keyframe |
|
|
|
{ |
|
|
|
time = Time.realtimeSinceStartup, |
|
|
|
|
|
|
var index = rewardCurve.AddKey(keyframe); |
|
|
|
AnimationUtility.SetKeyLeftTangentMode(rewardCurve, index, AnimationUtility.TangentMode.Linear); |
|
|
|
AnimationUtility.SetKeyRightTangentMode(rewardCurve, index, AnimationUtility.TangentMode.Linear); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
} |
|
|
|
} |