Пример #1
0
 // Start is called before the first frame update
 void Start()
 {
     if (player == null)
     {
         player = GameObject.FindWithTag("Player");
     }
     if (rig == null)
     {
         rig = GetComponentInChildren <UnityEngine.Animations.Rigging.Rig>();
     }
     button.SetActive(false);
 }
Пример #2
0
        public static JobTransform[] GetAllRigTransformReferences(Rig rig)
        {
            RigTransform[] rigTransforms = rig.GetComponentsInChildren <RigTransform>();
            if (rigTransforms.Length == 0)
            {
                return(null);
            }

            JobTransform[] jobTransforms = new JobTransform[rigTransforms.Length];
            for (int i = 0; i < jobTransforms.Length; ++i)
            {
                jobTransforms[i] = new JobTransform(rigTransforms[i].transform, rigTransforms[i].syncFromScene);
            }

            return(jobTransforms);
        }
Пример #3
0
        public static IRigConstraint[] GetConstraints(Rig rig)
        {
            IRigConstraint[] constraints = rig.GetComponentsInChildren <IRigConstraint>();
            if (constraints.Length == 0)
            {
                return(null);
            }

            List <IRigConstraint> tmp = new List <IRigConstraint>(constraints.Length);

            foreach (var constraint in constraints)
            {
                if (constraint.IsValid())
                {
                    tmp.Add(constraint);
                }
            }

            return(tmp.Count == 0 ? null : tmp.ToArray());
        }
 public RigLayer(Rig rig, bool active = true)
 {
     this.rig    = rig;
     this.active = active;
     data        = k_InvalidDataIndex;
 }