public FkChara(Transform root) { _root = CreateBone(root); if (!IsMale() && !IsFemale()) { throw new Exception("Invalid Root"); } Transform hips = root.FindChildLoopByRegex(@"^c[fm]_J_Hips$"); // if (IsFemale()) // { // hips = root.Find("BodyTop/p_cf_anim/cf_J_Root/cf_N_height/cf_J_Hips"); // } // else // { // hips = root.Find("BodyTop/p_cm_anim/cm_J_Root/cm_N_height/cm_J_Hips"); // } if (hips == null) { throw new Exception("Can't Find Hips"); } LoopChildren(hips); AttachRelation(); }
private void InnerUpdate() { if (Input.GetKey(KeyCode.LeftAlt) && Input.GetMouseButtonDown(0)) { var minDist = double.MaxValue; FkBone.FkBone minBone = null; FkCharaMgr.FindSelectCharas().Foreach(c => { c.MainBones().Foreach(b => { var screenPoint = Context.MainCamera().WorldToScreenPoint(b.Transform.position); var dist = (screenPoint - Input.mousePosition).magnitude; if (dist < minDist) { minDist = dist; minBone = b; } }); }); if (minBone != null) { Context.GuideObjectManager().selectObject = minBone.GuideObject; } } }