public void ThrowItem(MerchandiseInfo.MerchandiseEnum key) { if (HaveMerchandiseDic[(int)key].itemCount > 0) { HaveMerchandiseDic[(int)key].itemCount--; } }
public bool CheckHadItem(MerchandiseInfo.MerchandiseEnum key) { if (HaveMerchandiseDic.ContainsKey((int)key)) { return(true); } return(false); }
public void GetItem(MerchandiseInfo.MerchandiseEnum key) { if (CheckHadItem(key)) { HaveMerchandiseDic[(int)key].itemCount++; } else { MerchandiseInfo.Merchandise item = MerchandiseInfo.MerchandiseInfoDic[(int)key]; item.itemCount = 1; HaveMerchandiseDic.Add((int)key, item); } }
private void Update() { if (Input.GetKeyDown(KeyCode.W)) { _moveObj.transform.position += Vector3.forward * MoveUnit; } else if (Input.GetKeyDown(KeyCode.S)) { _moveObj.transform.position += Vector3.back * MoveUnit; } else if (Input.GetKeyDown(KeyCode.A)) { _moveObj.transform.position += Vector3.left * MoveUnit; } else if (Input.GetKeyDown(KeyCode.D)) { _moveObj.transform.position += Vector3.right * MoveUnit; } if (Input.GetMouseButtonDown(0)) { Ray ray = _roomCamera.ScreenPointToRay(Input.mousePosition); ClickFloor(ray); } else if (Input.GetKeyDown(KeyCode.Space)) { if (_stayJudge.StayObj == null) { moveSensorObj.SetActive(true); _moveObj.transform.position += GoodsUpDist; _goodsPosition.ObjPosMove(); float moveObjPosX = _moveObj.transform.position.x;//clickposxはfloat(.5にはなる) float moveObjPosZ = _moveObj.transform.position.z; moveSensorObj.transform.position = new Vector3(moveObjPosX, moveSensorObj.transform.position.y, moveObjPosZ); AdjustPos(moveSensorObj); SetTrigger(false); Destroy(_stayJudge); Destroy(_moveGoodsRigidBody); gameObject.SetActive(false); } else { StartCoroutine(ShowText()); } } else if (Input.GetKeyDown(KeyCode.B)) { if (_moveObj.CompareTag(TagList.TreeTag)) { return; } Debug.Log("オブジェクト削除!!!!!!!!!!"); moveSensorObj.SetActive(true); float moveObjPosX = _moveObj.transform.position.x;//clickposxはfloat(.5にはなる) float moveObjPosZ = _moveObj.transform.position.z; moveSensorObj.transform.position = new Vector3(moveObjPosX, moveSensorObj.transform.position.y, moveObjPosZ); AdjustPos(moveSensorObj); Debug.Log($"_moveObj: {_moveObj.name}"); MerchandiseInfo.MerchandiseEnum cleanUpItemEnum = _moveObj.GetComponent <GoodsAddress>().GoodsEnum; _playerManager.haveMerchandise.GetItem(cleanUpItemEnum); _goodsPosition.ObjDestroy(); gameObject.SetActive(false); } }
public void SetGoodsEnumReceived(int goodsNum) { GoodsEnum = (MerchandiseInfo.MerchandiseEnum)Enum.ToObject(typeof(MerchandiseInfo.MerchandiseEnum), goodsNum); }
public bool CheckHadItem(int key) { MerchandiseInfo.MerchandiseEnum tmp = (MerchandiseInfo.MerchandiseEnum)Enum.ToObject(typeof(MerchandiseInfo.MerchandiseEnum), key); return(CheckHadItem(tmp)); }
public void ThrowItem(int key) { MerchandiseInfo.MerchandiseEnum tmp = (MerchandiseInfo.MerchandiseEnum)Enum.ToObject(typeof(MerchandiseInfo.MerchandiseEnum), key); ThrowItem(tmp); }
public GameObject FindGoods(MerchandiseInfo.MerchandiseEnum merchandiseEnum) { return(_goodsTable.GoodsData .Find(x => x.GoodsType == merchandiseEnum).GoodsObj); }