public static AddScene ( RootMotion.FinalIK.IKSolverHeuristic solver, Color color, bool modifiable ) : void | ||
solver | RootMotion.FinalIK.IKSolverHeuristic | |
color | Color | |
modifiable | bool | |
return | void |
private static void AddSceneChain(FABRIKChain[] chain, Color color, FABRIKChain selected) { foreach (FABRIKChain c in chain) { col = GetChainColor(c, color); IKSolverHeuristicInspector.AddScene(c.ik.solver as IKSolverHeuristic, col, selected == c, sizeMlp); } }
private static void AddSceneChain(FABRIKChain[] chain, Color color, FABRIKChain selected) { foreach (FABRIKChain c in chain) { if (!c.IsValid(null)) { return; } } foreach (FABRIKChain c in chain) { col = GetChainColor(c, color); IKSolverHeuristicInspector.AddScene(c.ik.solver as IKSolverHeuristic, col, selected == c); } }
/* * Draws the scene view helpers for BipedIK.Solvers * */ public static void AddScene(BipedIKSolvers solvers, ref int selected) { // Draw limbs for (int i = 0; i < solvers.limbs.Length; i++) { IKSolverLimbInspector.AddScene(solvers.limbs[i] as IKSolverLimb, GetSolverColor(i), selected == i); } // Draw spine IKSolverHeuristicInspector.AddScene(solvers.spine, GetSolverColor(4), selected == 4); // Draw look at IKSolverLookAtInspector.AddScene(solvers.lookAt, GetSolverColor(5), selected == 5); // Draw aim IKSolverAimInspector.AddScene(solvers.aim, GetSolverColor(6), selected == 6); // Draw constraints ConstraintsInspector.AddScene(solvers.pelvis, GetSolverColor(7), selected == 7); // Selecting solvers if (Application.isPlaying) { for (int i = 0; i < solvers.ikSolvers.Length; i++) { Handles.color = GetSolverColor(i); if (solvers.ikSolvers[i].GetIKPositionWeight() > 0 && selected != i && solvers.ikSolvers[i].initiated) { if (Inspector.DotButton(solvers.ikSolvers[i].GetIKPosition(), Quaternion.identity, GetHandleSize(solvers.ikSolvers[i].GetIKPosition()), GetHandleSize(solvers.ikSolvers[i].GetIKPosition()))) { selected = i; } } } if ((solvers.pelvis.positionWeight > 0 || solvers.pelvis.rotationWeight > 0) && selected != solvers.ikSolvers.Length) { Handles.color = GetSolverColor(7); if (Inspector.DotButton(solvers.pelvis.position, Quaternion.identity, GetHandleSize(solvers.pelvis.position), GetHandleSize(solvers.pelvis.position))) { selected = solvers.ikSolvers.Length; } } } }
void OnSceneGUI() { // Draw the scene veiw helpers IKSolverHeuristicInspector.AddScene(script.solver, Color.cyan, true); }