Esempio n. 1
0
    private static void Read(string mapPath)
    {
        StreamReader reader = new StreamReader(mapPath);
        string       line   = "";

        while ((line = reader.ReadLine()) != null)
        {
            width = line.Length;
            height++;
        }

        reader = new StreamReader(mapPath);
        map    = new string[width, height];
        tiles  = new GameObject[width, height];
        int rowCount    = 0;
        int columnCount = 0;

        while ((line = reader.ReadLine()) != null)
        {
            for (rowCount = 0; rowCount < line.Length; rowCount++)
            {
                map[rowCount, columnCount] = line[rowCount].ToString();
            }
            columnCount++;
        }

        Frani.DebugMatrix(map);
    }
Esempio n. 2
0
    public static IEnumerator Zoom(float amount)
    {
        if (zooming || amount == 0)
        {
            yield break;
        }
        zooming = true;

        for (int i = 0; i < zoomSteps; i++)
        {
            float skewValue = (amount > 0) ? Frani.GetInBetween(0, 2, zoomSteps, i) : Frani.GetInBetween(-2, 0, zoomSteps, i);
            Camera.main.orthographicSize += amount * zoomMultiplier + skewValue;
            yield return(null);
        }

        zooming = false;
        yield break;
    }
Esempio n. 3
0
    public static IEnumerator RotateCounterClockwise()
    {
        if (rotating)
        {
            yield break;
        }
        rotating = true;

        for (int angles = 0; angles < 44 / rotationSpeed; angles++)
        {
            Camera.main.transform.eulerAngles = new Vector3(30, Camera.main.transform.eulerAngles.y - rotationSpeed - Frani.GetInBetween(-3, 3, 44 / rotationSpeed, angles), 0);
            yield return(null);
        }

        Camera.main.transform.eulerAngles = new Vector3(30, Camera.main.transform.eulerAngles.y - 1, 0);
        rotating = false;
        yield break;
    }