Esempio n. 1
0
        private void AddProblemsToFeatLenght()
        {
            ProblemContainer lastProblem = _movableProblems.Last.Value;

            if ((lastProblem.transform.position.x + lastProblem.Length()) < StartPosition.position.x)
            {
                CreateProblem();
            }
        }
Esempio n. 2
0
        private void CreateProblem()
        {
            ProblemContainer problem         = CreateRandomProblem();
            ProblemContainer lastProblem     = _movableProblems.Last.Value;
            float            problemLength   = lastProblem.Length();
            Vector3          distance        = DistanceProblems * _normalizedDirection;
            Vector3          newLastPosition = (_normalizedDirection * problemLength) + lastProblem.transform.position + distance;

            problem.transform.position = newLastPosition;
            _movableProblems.AddLast(problem);
        }