Exemplo n.º 1
0
 // 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;
 }
Exemplo n.º 2
0
        // 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);
        }
Exemplo n.º 3
0
        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;
        }