File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
com.unity.perception/Runtime
Randomization/Randomizers/RandomizerExamples/Randomizers Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ namespace UnityEngine.Perception.GroundTruth
1111 public class PoseTimestampRecord
1212 {
1313 /// <summary>
14- /// The point in the clip that the pose starts, a value from 0 (beginning) to 1 (end)
14+ /// The percentage within the clip that the pose starts, a value from 0 (beginning) to 1 (end)
1515 /// </summary>
16- public float startOffset ;
16+ [ Tooltip ( "The percentage within the clip that the pose starts, a value from 0 (beginning) to 1 (end)" ) ]
17+ public float startOffsetPercent ;
1718 /// <summary>
1819 /// The label to use for any captures inside of this time period
1920 /// </summary>
@@ -51,7 +52,7 @@ public string GetPoseAtTime(float time)
5152 var i = 1 ;
5253 for ( i = 1 ; i < timestamps . Count ; i ++ )
5354 {
54- if ( timestamps [ i ] . startOffset > time ) break ;
55+ if ( timestamps [ i ] . startOffsetPercent > time ) break ;
5556 }
5657
5758 return timestamps [ i - 1 ] . poseLabel ;
Original file line number Diff line number Diff line change 11using System ;
2- using System . Collections . Generic ;
32using UnityEngine ;
43using UnityEngine . Experimental . Perception . Randomization . Parameters ;
54using UnityEngine . Experimental . Perception . Randomization . Randomizers . SampleRandomizers . Tags ;
@@ -16,8 +15,8 @@ public class AnimationRandomizer : Randomizer
1615 {
1716 FloatParameter m_FloatParameter = new FloatParameter { value = new UniformSampler ( 0 , 1 ) } ;
1817
19- const string clipName = "PlayerIdle" ;
20- const string stateName = "Base Layer.RandomState" ;
18+ const string k_ClipName = "PlayerIdle" ;
19+ const string k_StateName = "Base Layer.RandomState" ;
2120
2221 void RandomizeAnimation ( AnimationRandomizerTag tag )
2322 {
@@ -27,8 +26,8 @@ void RandomizeAnimation(AnimationRandomizerTag tag)
2726 var overrider = tag . animatorOverrideController ;
2827 if ( overrider != null && tag . animationClips . GetCategoryCount ( ) > 0 )
2928 {
30- overrider [ clipName ] = tag . animationClips . Sample ( ) ;
31- animator . Play ( stateName , 0 , m_FloatParameter . Sample ( ) ) ;
29+ overrider [ k_ClipName ] = tag . animationClips . Sample ( ) ;
30+ animator . Play ( k_StateName , 0 , m_FloatParameter . Sample ( ) ) ;
3231 }
3332 }
3433
You can’t perform that action at this time.
0 commit comments