protected void SetArms(bool isRightOn, out IHumArmChain onArm, out IHumArmChain offArm, out Mover <IHumArmChain> onArmMove, out Mover <IHumArmChain> offArmMove) { onArm = isRightOn ? Human.ArmR : Human.ArmL; offArm = isRightOn ? Human.ArmL : Human.ArmR; onArmMove = isRightOn ? MoveArmR : MoveArmL; offArmMove = isRightOn ? MoveArmL : MoveArmR; }
IComplexHuman IComplexHuman.Set(IComplexHumanDefinition definition, params IHumanExtender[] extenders) { _definition = definition; var m = _definition.Model; _id = (ulong)m.GetHashCode(); // foreach (var e in _definition.BonesByName.Values) e.gameObject.layer = layers.BitNumber_Characters; _sourceNeckUpper = _definition.NeckUpper.Bone; _sourceHead = _definition.Head.Bone; _root = _definition.Root.Bone; _hip = new HumBoneHandler(m, _definition.Hip.Bone); _pelvis = new HumBoneHandler(m, _definition.Pelvis.Bone); _spine = new HumSpineChain(_definition); _neckUpper = new HumBoneHandler(m, _definition.NeckUpper.Bone); _head = new HumBoneHandler(m, _definition.Head.Bone); _tongue = new HumBoneHandler(m, _definition.Tongue.Tongue2); // _tongue = new GenTongueChain(_definition); if (_definition.HumanoidType == HumanoidType.Genesis8) { _armL = new Gen8ArmChain(BodyPart.ArmL, _definition); _armR = new Gen8ArmChain(BodyPart.ArmR, _definition); } else //if (_definition.HumanoidType == HumanoidType.MakeHuman) { _armL = new MHArmChain(BodyPart.ArmL, _definition); _armR = new MHArmChain(BodyPart.ArmR, _definition); } _legL = new HumLegChain(BodyPart.LegL, _definition); _legR = new HumLegChain(BodyPart.LegR, _definition); var humFaceConfigSource = extenders.FirstOrDefault(e => e is HumanFaceConfigSource) as HumanFaceConfigSource; if (_definition.HumanoidType == HumanoidType.Genesis8) { _genFace = new GenFaceGroup(this, humFaceConfigSource); } else if (_definition.HumanoidType == HumanoidType.MakeHuman) { _mhFace = new MHFaceGroup(this, humFaceConfigSource); } _collarL = new HumBoneHandler(BodyPart.CollarL, m, _definition.ArmL.Collar); _collarR = new HumBoneHandler(BodyPart.CollarR, m, _definition.ArmR.Collar); if (_definition.HasCompletedImport) { _updatables.Add(_spine); _updatables.Add(_legL); _updatables.Add(_legR); _updatables.Add(_armL); _updatables.Add(_armR); } var modelRt = m.right; var modelLt = -modelRt; if (_definition.HasCompletedImport) { if (_definition.HasBreasts) { var breastConfigSource = extenders.FirstOrDefault(e => e is BreastConfigSource) as BreastConfigSource; _breastL = new HumBreastGroup(definition.Persona, BodySide.LT, this, _definition.BreastL.Bone, _nippleL, breastConfigSource).AddTo(_updatables); _breastR = new HumBreastGroup(definition.Persona, BodySide.RT, this, _definition.BreastR.Bone, _nippleR, breastConfigSource).AddTo(_updatables); } } foreach (var ext in (extenders ?? new IHumanExtender[0])) { ext.Setup(this); if (ext is IUpdatable upd) { _updatables.Add(upd); } if (ext is IDisposable dis) { _disposables.Add(dis); } if (ext is INamedObjectSource nts) { _objectSources.Add(nts); } } _initialStats = new HumanInitialStats(this); return(this); }
IShakeableArm IShakeableArm.Set(IHumArmChain arm) { _arm = arm; Initialize(); return(this); }
public IHumArmChain OtherArm(IHumArmChain arm) => arm.Side == BodySide.Left ? ArmR : ArmL;
protected Mover <IHumArmChain> GetMove(IHumArmChain arm) => arm.Side == BodySide.Left ? MoveArmL : MoveArmR;