Exemplo n.º 1
0
        private async void Update()
        {
            if (Input.GetKeyDown(KeyCode.W))
            {
                _sensorObjPos.position += new Vector3(0.0f, 0.0f, 1.5f);
            }
            else if (Input.GetKeyDown(KeyCode.S))
            {
                _sensorObjPos.position += new Vector3(0.0f, 0.0f, -1.5f);
            }
            else if (Input.GetKeyDown(KeyCode.A))
            {
                _sensorObjPos.position += new Vector3(-1.5f, 0.0f, 0.0f);
            }
            else if (Input.GetKeyDown(KeyCode.D))
            {
                _sensorObjPos.position += new Vector3(1.5f, 0.0f, 0.0f);
            }

            if (Input.GetMouseButtonDown(0))
            {
                Ray ray = roomCamera.ScreenPointToRay(Input.mousePosition);
                ClickFloor(ray);
            }

            else if (Input.GetKeyDown(KeyCode.Space))
            {
                if (_selectObjList.Count - 1 == _exitObjCount) //nullじゃなかったら
                {
                    Debug.Log("オブジェクト移動開始!!!!!!!");
                    moveGoodsObj.SetActive(true);
                    _moveGoods.MoveObjInit(_selectObjList[_exitObjCount]);
                    _selectObjList[_exitObjCount].transform.position += Vector3.up;
                    OnTriggerExit(_selectObjList[_exitObjCount].GetComponent <Collider>());
                    gameObject.SetActive(false);
                }
                else if (_selectObjList.Count - 1 < _exitObjCount)
                {
                    Debug.Log("オブジェクト配置開始!!!!!!!");
                    gameObject.SetActive(false);
                    putGoodsObj.SetActive(true);
                }
                else if (_selectObjList.Count - 1 > _exitObjCount)
                {
                    foreach (var selectObj in _selectObjList)
                    {
                        Debug.Log($"selectObj: {selectObj}");
                    }
                    Debug.Log("2個以上選択しています。");
                }
            }
            else if (Input.GetKeyDown(KeyCode.B))
            {
                sensorAnimator.SetTrigger("FinishSensor");
                //_myPlayerManager.PlayerController.RemoveFreeze();
                _myPlayerManager.currentPlayerState = PlayerState.Idol;
                gameObject.SetActive(false);
            }
        }
Exemplo n.º 2
0
        public void InstanceGoods(MerchandiseInfo.Merchandise merchandise)
        {
            GoodsRepository goodsRepository = new GoodsRepository(goodsTable);
            GameObject      putGoods        = _instancePrefab.InstanceGoods(merchandise, goodsRepository.FindGoods(merchandise.merchandise), sensorObj.transform.position);

            _menuButtonManager.InActivePutMerchandisePanel();
            _moveGoods.MoveObjInit(putGoods);
            moveGoodsObj.SetActive(true);
            gameObject.SetActive(false);
        }