public void SetLimitType(ItemsTypeEnum limitType) { SetLimitTypes(new List <ItemsTypeEnum>() { limitType }); }
/// <summary> /// 检测是否能放置该道具 /// </summary> /// <param name="itemsType"></param> /// <returns>true能设置 false不能设置</returns> public bool CheckCanSetItem(ItemsTypeEnum itemsType) { if (listLimitTypes.IsNull()) { return(true); } for (int i = 0; i < listLimitTypes.Count; i++) { ItemsTypeEnum limitType = listLimitTypes[i]; if (itemsType == limitType) { return(true); } } return(false); }
/// <summary> /// 改变右手握住的东西 /// </summary> public void ChangeRightHandItem(long itemId) { ItemsInfoBean itemsInfo = ItemsHandler.Instance.manager.GetItemsInfoById(itemId); if (itemsInfo == null || itemsInfo.id == 0) { itemHoldRight.ShowObj(false); return; } itemHoldRight?.SetItem(itemsInfo); if (itemsInfo.GetHoldData(out Vector3 holdRotate)) { itemHoldRight.transform.localEulerAngles = holdRotate; itemHoldRight.transform.localPosition = new Vector3(0, 0, 0.25f); } else { ItemsTypeEnum itemsType = itemsInfo.GetItemsType(); switch (itemsType) { case ItemsTypeEnum.Hoe: case ItemsTypeEnum.Pickaxe: case ItemsTypeEnum.Axe: case ItemsTypeEnum.Shovel: case ItemsTypeEnum.Sword: case ItemsTypeEnum.Knife: itemHoldRight.transform.localPosition = new Vector3(0, 0, 0.25f); itemHoldRight.transform.localEulerAngles = new Vector3(90f, -40f, 0f); break; case ItemsTypeEnum.Bow: itemHoldRight.transform.localPosition = new Vector3(0, 0, 0); itemHoldRight.transform.localEulerAngles = new Vector3(90f, 180f, 0f); break; default: itemHoldRight.transform.localPosition = new Vector3(0, 0, 0.25f); itemHoldRight.transform.localEulerAngles = new Vector3(90f, 0f, 0f); break; } } itemHoldRight.ShowObj(true); }
public void SetLimitType(EquipTypeEnum equipType) { ItemsTypeEnum itemsType = UserEquipBean.EquipTypeEnumToItemsType(equipType); SetLimitType(itemsType); }