private void _ExecuteAddConstraints() { _execLog.Remove(0, _execLog.Length); _AddConstraintForArm(Bones.HandL, Bones.LowerArmL, Bones.UpperArmL); _AddConstraintForArm(Bones.HandR, Bones.LowerArmR, Bones.UpperArmR); _AddConstraintForLeg(Bones.FootL, Bones.LowerLegL, Bones.UpperLegL); _AddConstraintForLeg(Bones.FootR, Bones.LowerLegR, Bones.UpperLegR); Transform root = _bones[(int)Bones.Root]; Transform lfTarget = root.Find("LFTarget"); Transform rfTarget = root.Find("RFTarget"); Transform pelvis = _bones[(int)Bones.Pelvis]; if (_addPelvisFollow && lfTarget && rfTarget && pelvis) { // clear old constraints if exists ConstraintStack cs = pelvis.ForceGetComponent <ConstraintStack>(); cs.RemoveByType(typeof(CopyPosition)); cs.ExecOrder = 50; // add new ones var copyL = pelvis.gameObject.AddComponent <CopyPosition>(); var copyR = pelvis.gameObject.AddComponent <CopyPosition>(); copyL.Target = lfTarget; copyL.Influence = 1f; copyL.Affect = EAxisD.X | EAxisD.Z; copyL.UseOffset = false; copyR.Target = rfTarget; copyR.Influence = 0.5f; copyR.Affect = EAxisD.X | EAxisD.Z; copyR.UseOffset = false; } }
/// <summary> /// Initializes a new instance of the <see cref="T:ConstraintBuilder"/> class. /// </summary> public ConstraintBuilder() { this.ops = new OperatorStack(this); this.constraints = new ConstraintStack(this); }
/// <summary> /// Initializes a new instance of the <see cref="T:ConstraintBuilder"/> class. /// </summary> public ConstraintBuilder() { this.ops = new OperatorStack(this); this.constraints = new ConstraintStack(this); }
/// <summary> /// Initializes a new instance of the <see cref="T:ConstraintBuilder" /> class. /// </summary> internal ConstraintBuilder() { _ops = new OperatorStack(this); _constraints = new ConstraintStack(this); }