Ejemplo n.º 1
0
    //private enum Line
    //{
    //	RIGHT,
    //	LEFT,
    //	UP,
    //	DOWN
    //}
    //[SerializeField] private Line[] _line = new Line[4];

    //private Vector2 _point;
    //private float _px;
    //private float _py;

    private void PlayerManage()
    {
        if (_pMode == PlayerMode.WAIT)
        {
            PredictionLine();

            _hook.transform.position = transform.position;

            if (!_sceneController.nowFade)
            {
                if (Input.GetMouseButtonDown(0))
                {
                    _seManager.RopeShotSE();
                    _touchPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
                    //var dx = _touchPos.x - transform.position.x;
                    //var dy = _touchPos.y - transform.position.y;
                    //var hookAngle = (Mathf.Atan2(dy, dx) * Mathf.Rad2Deg);
                    //if (-70.0f < hookAngle && hookAngle < 90.0f)
                    //{
                    //	Debug.Log("hookを出すよ");
                    for (int i = 0; i < tenNum; i++)
                    {
                        Guidearray[i].gameObject.SetActive(false);
                    }

                    _pMode = PlayerMode.EXTEND;
                    //}
                    //else Debug.Log("hook出せないよ");
                }
            }
        }
        else if (_pMode == PlayerMode.EXTEND)
        {
            _hCon.ExtendHook((Vector3)_touchPos, transform.position, _distance, _extendSpeed);
        }
        else if (_pMode == PlayerMode.SWAY)
        {
            //Debug.Log(_velocity);
            _totleTime += Time.deltaTime;

            var oldpos = transform.position;

            if (Input.GetMouseButtonDown(0) || _totleTime > _rimitTime)
            {
                _totleTime = 0.0f;
                _pMode     = PlayerMode.SHRINK;
            }

            _circularMotion.SpiralSway(ref _velocity);

            //_velocity = transform.position - oldpos;
        }
        else if (_pMode == PlayerMode.SHRINK)
        {
            _circularMotion._angle = 0;
            _hCon.ShrinkHook((Vector3)_touchPos, transform.position, _distance, _shrinkSpeed);
        }
    }