示例#1
0
    private void Update()
    {
        if (_changeSkillCheckPos)
        {
            _changeSkillCheckPos = false;
            RandomizePositionAndWidth();
        }
        if (Input.GetMouseButtonDown(0))
        {
            _canMove = false;

            var colls = _pointerToCheck.CheckIfFailed();

            if (colls == null || colls.Length == 0)
            {
                Debug.Log("Niente hai fallito");
            }

            bool giusto = colls.ToList().Exists(col => col.gameObject == _skillChecker.gameObject);
            OnSkillCheckDone?.Invoke(giusto);

            if (giusto)
            {
                tentativi++;
            }

            if (gameObject.activeInHierarchy == false)
            {
                return;
            }

            if (!_restartAfterInput)
            {
                return;
            }

            StopAllCoroutines();

            StartCoroutine(WaitAfterInput());
        }
    }