private IKSolverLimb InitLimb(IKSolverLimb limb, IKSolverLimb.BendModifier bendModifier) { limb.IKPositionWeight = 0; limb.IKRotationWeight = 0; limb.bendModifier = bendModifier; return(limb); }
public static LimbGoalHandle Create(IKSolverLimb solver, IllusionCamera camera) { var handle = GameObject.CreatePrimitive(PrimitiveType.Sphere).AddComponent <LimbGoalHandle>(); handle.transform.localScale *= 0.1f; handle.camera = camera; handle.constraint = solver; return(handle); }
protected override void OnEnable() { base.OnEnable(); animator = GetComponent <Animator>(); Assert.IsNotNull(animator, "Animator not found"); var biped = GetComponent <BipedIK>(); Assert.IsNotNull(biped, "Biped IK not found"); rightHand = biped.solvers.rightHand; Assert.IsNotNull(rightHand, "Right Hand not found"); Assert.IsNotNull(rightHand.target, "Right Hand target not set"); lookAt = biped.solvers.lookAt; Assert.IsNotNull(lookAt, "Look At not found"); Assert.IsNotNull(lookAt.target, "Look At target not set"); var spell = wizard.GetSpellToCast(); StartCoroutine(Cast(spell)); }