public void StopLeadingHorseByReins(Player player) { player.UnequipEquippedItem(); horse.horseBehavior.PutHorseOnLead(false); headGear.anim.Play("OnHorse"); GenericUtilities.EnableAllColliders(transform, true); }
private void PutOnBridle(Player player) { headGear = player.currentlyEquippedItem.GetComponent <HorseGear> (); player.UnequipEquippedItem(); headGear.transform.position = bridleTransform.position; headGear.transform.rotation = bridleTransform.rotation; headGear.transform.SetParent(bridleTransform); headGear.anim.Play("OnHorse"); GenericUtilities.EnableAllColliders(headGear.transform, false); }
public void LeadIsDropped(Player player) { headGearAttachment.anim.Play("Hanging"); headGearAttachment.transform.position = leadTransformHanging.position; headGearAttachment.transform.rotation = leadTransformHanging.rotation; headGearAttachment.transform.SetParent(leadTransformHanging); StopLeadingHorse(player); //set lead and halter colliders to disabled again, bc they get enabled along with horse colliders when dropping the lead GenericUtilities.EnableAllColliders(headGear.transform, false); GenericUtilities.EnableAllColliders(headGearAttachment.transform, false); }
public void TieHorseToPost(Player player) { StopLeadingHorse(player); player.UnequipEquippedItem(); headGearAttachment.anim.Play("Tied"); transform.SetParent(player.nearestInteractable.transform); transform.localPosition = positionOnPost; headGearAttachment.transform.position = leadTransformTied.position; headGearAttachment.transform.rotation = leadTransformTied.rotation; headGearAttachment.transform.SetParent(leadTransformTied); horse.horseBehavior.TieHorseToPost(true); GenericUtilities.EnableAllColliders(transform, true); }
private void PutOnLead(Player player) { headGearAttachment = player.currentlyEquippedItem.GetComponent <HorseGear> (); player.UnequipEquippedItem(); headGearAttachment.transform.position = leadTransformLeading.position; headGearAttachment.transform.rotation = leadTransformLeading.rotation; headGearAttachment.transform.SetParent(leadTransformLeading); GenericUtilities.EnableAllColliders(headGearAttachment.transform, false); StartLeadingHorse(player); }
public void Dismount(Player player) { player.UnequipEquippedItem(); horse.horseBehavior.RidingHorse(false); player.transform.position = playerLeadingPos.position; player.transform.rotation = playerLeadingPos.rotation; player.playerModel.transform.position = player.transform.position; player.playerModel.transform.rotation = player.transform.rotation; player.playerModel.transform.SetParent(player.transform); //enable all colliders (but only trigger really matters, right? GenericUtilities.EnableAllColliders(transform, true); }
private void PutOnSaddleAndPad(Player player) { backGear = player.currentlyEquippedItem.GetComponent <HorseGear> (); backGear.girth.position = backGear.girthPosOnHorse.position; backGear.girth.rotation = backGear.girthPosOnHorse.rotation; player.UnequipEquippedItem(); backGear.transform.position = saddleTransform.position; backGear.transform.rotation = saddleTransform.rotation; backGear.transform.SetParent(saddleTransform); GenericUtilities.EnableAllColliders(backGear.transform, false); }
private void PutOnHalterAndLead(Player player) { //store this here so that I can still access it once it's been unequipped Equippable combinedEquippable = player.currentlyEquippedItem; foreach (Transform child in player.currentlyEquippedItem.transform) { Debug.Log("equipping " + child); horseGearType type = child.GetComponent <HorseGear> ().type; switch (type) { case horseGearType.HALTER: headGear = child.GetComponent <HorseGear> (); headGear.transform.position = halterTransform.position; headGear.transform.rotation = halterTransform.rotation; GenericUtilities.EnableAllColliders(headGear.transform, false); break; case horseGearType.LEAD: headGearAttachment = child.GetComponent <HorseGear> (); headGearAttachment.transform.position = leadTransformLeading.position; headGearAttachment.transform.rotation = leadTransformLeading.rotation; GenericUtilities.EnableAllColliders(headGearAttachment.transform, false); break; } } headGear.transform.SetParent(halterTransform); headGearAttachment.transform.SetParent(leadTransformLeading); player.UnequipEquippedItem(); combinedEquippable.transform.SetParent(headGear.transform); StartLeadingHorse(player); }