예제 #1
0
 public void ThrowItem(MerchandiseInfo.MerchandiseEnum key)
 {
     if (HaveMerchandiseDic[(int)key].itemCount > 0)
     {
         HaveMerchandiseDic[(int)key].itemCount--;
     }
 }
예제 #2
0
    public bool CheckHadItem(MerchandiseInfo.MerchandiseEnum key)
    {
        if (HaveMerchandiseDic.ContainsKey((int)key))
        {
            return(true);
        }

        return(false);
    }
예제 #3
0
 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);
     }
 }
예제 #4
0
        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);
            }
        }
예제 #5
0
 public void SetGoodsEnumReceived(int goodsNum)
 {
     GoodsEnum = (MerchandiseInfo.MerchandiseEnum)Enum.ToObject(typeof(MerchandiseInfo.MerchandiseEnum), goodsNum);
 }
예제 #6
0
 public bool CheckHadItem(int key)
 {
     MerchandiseInfo.MerchandiseEnum tmp = (MerchandiseInfo.MerchandiseEnum)Enum.ToObject(typeof(MerchandiseInfo.MerchandiseEnum), key);
     return(CheckHadItem(tmp));
 }
예제 #7
0
 public void ThrowItem(int key)
 {
     MerchandiseInfo.MerchandiseEnum tmp = (MerchandiseInfo.MerchandiseEnum)Enum.ToObject(typeof(MerchandiseInfo.MerchandiseEnum), key);
     ThrowItem(tmp);
 }
예제 #8
0
 public GameObject FindGoods(MerchandiseInfo.MerchandiseEnum merchandiseEnum)
 {
     return(_goodsTable.GoodsData
            .Find(x => x.GoodsType == merchandiseEnum).GoodsObj);
 }