Ejemplo n.º 1
0
 void Awake()
 {
     instance   = this;
     mainCamera = Camera.main;
     center     = Vector3.zero;
     height     = mainCamera.orthographicSize * 2;
     width      = height * mainCamera.aspect;
 }
Ejemplo n.º 2
0
        private IEnumerator PlaceCoroutine()
        {
            List <Vector3> positions = new List <Vector3>();
            WorldBounds    bounds    = WorldBounds.Instance;
            float          xMin      = bounds.ToTheLeftQuestionStart().x;
            float          xMax      = bounds.ToTheRightQuestionStart().x;
            float          yMin      = bounds.YMin();
            float          yMax      = bounds.YMax();
            float          z         = bounds.DefaultZ();

            if (AppConstants.VerboseLogging)
            {
                Debug.Log("xMin" + xMin);
                Debug.Log("xMax" + xMax);
                Debug.Log("yMin" + yMin);
                Debug.Log("yMax" + yMax);
            }

            for (float x = xMin; x < xMax; x += 4.3f)
            {
                for (float y = yMin; y < yMax; y += 1.7f)
                {
                    float dx  = Random.Range(-0.2f, 0.2f);
                    float dy  = Random.Range(-0.1f, 0.2f);
                    var   vec = new Vector3(x + dx, y + dy, z);
                    positions.Add(vec);
                    if (AppConstants.VerboseLogging)
                    {
                        Debug.Log("VECTOR" + vec);
                    }
                }
            }

            if (AppConstants.VerboseLogging)
            {
                Debug.Log("COUNT:" + positions.Count);
            }
            positions = positions.Shuffle();

            foreach (var a in allAnswers)
            {
                yield return(PlaceAnswer(a, positions));
            }

            yield return(TimeEngine.Wait(0.65f));

            isAnimating = false;
        }