private void LoadScene(HScene scene) { sf.Reset(); ac.Init(); string[] onHolds = scene.GetOnHolds(); for (int i = (int)AvatarControl.BODYS.RH; i <= (int)AvatarControl.BODYS.LF; i++) { if (!string.IsNullOrEmpty(onHolds[i])) { Transform t = holds.Find(onHolds[i]); if (t != null) { Hold hold = t.gameObject.GetComponent <Hold>(); sf.SetFocusHold(i, hold); ac.SetFixed(i, true); } } } cs.SetComments(scene.GetComments()); if (scene.IsPose()) { ik.SetPose(scene.GetPose(), scene.GetPRotate()); } else { ik.InitAvatar(); } }
private void PoseProc() { hp.Sync(); Vector3[] v = ik.GetPosition(); Quaternion[] r = ik.GetRotation(); Vector3[] holdPos = hp.GetHoldsPos(); if (holdPos[(int)AvatarControl.BODYS.RH] != Vector3.zero) { if (!ac.IsFixed((int)AvatarControl.BODYS.RH)) { v[(int)AvatarControl.BODYS.RH] = holdPos[(int)AvatarControl.BODYS.RH]; ac.SetFixed((int)AvatarControl.BODYS.RH, true); } } if (holdPos[(int)AvatarControl.BODYS.RF] != Vector3.zero) { if (!ac.IsFixed((int)AvatarControl.BODYS.RF)) { v[(int)AvatarControl.BODYS.RF] = holdPos[(int)AvatarControl.BODYS.RF]; ac.SetFixed((int)AvatarControl.BODYS.RF, true); } } if (holdPos[(int)AvatarControl.BODYS.LH] != Vector3.zero) { if (!ac.IsFixed((int)AvatarControl.BODYS.LH)) { v[(int)AvatarControl.BODYS.LH] = holdPos[(int)AvatarControl.BODYS.LH]; ac.SetFixed((int)AvatarControl.BODYS.LH, true); } } if (holdPos[(int)AvatarControl.BODYS.LF] != Vector3.zero) { if (!ac.IsFixed((int)AvatarControl.BODYS.LF)) { v[(int)AvatarControl.BODYS.LF] = holdPos[(int)AvatarControl.BODYS.LF]; ac.SetFixed((int)AvatarControl.BODYS.LF, true); } } ik.SetPose(v, r); }
public void Registration(Hold hold) { if (choiced != (int)AvatarControl.BODYS.NONE) { ac.SetFixed(choiced, false); if (curFocusHolds[choiced] == hold) { hold.SetBodyActive(choiced, false); curFocusHolds[choiced] = null; } else { SetFocusHold(choiced, hold); } } }