// apply custom values of hand animation profile, mainly used when grabbing objects public void SetAnimatorWithProfile(HandAnimationProfile profile) { Grip = profile.grip; Index = profile.index; Thumb = profile.thumb; GripPercentage = profile.gripPercentage; IndexPercentage = profile.indexPercentage; ThumbState = profile.thumbState; ThumbPercentage = profile.thumbPercentage; StaticPose = profile.staticPose; Pose = profile.pose; }
// Returns a Profile of the current Hand public HandAnimationProfile CopyAnimatorToProfile() { HandAnimationProfile profile = new HandAnimationProfile { grip = Grip, index = Index, thumb = Thumb, gripPercentage = GripPercentage, indexPercentage = IndexPercentage, thumbState = ThumbState, thumbPercentage = ThumbPercentage, staticPose = StaticPose, pose = Pose }; return(profile); }
void Awake() { if (!animator) { animator = GetComponent <Animator>(); } StaticPose = StaticPose; Pose = Pose; Grip = Grip; Index = Index; Thumb = Thumb; GripPercentage = GripPercentage; IndexPercentage = IndexPercentage; ThumbPercentage = ThumbPercentage; ThumbState = ThumbState; defaultProfile = CopyAnimatorToProfile(); defaultAnimationDrive = drivedByAnimation; }