Ejemplo n.º 1
0
    public void RandomChoose() //Chossing a random cube
    {
        System.Random r1     = new System.Random();
        System.Random r2     = new System.Random();
        int           row    = r1.Next(0, grid.GetLength(0));
        int           column = r2.Next(0, grid.GetLength(1));
        var           value  = grid[row, column];

        Debug.Log("choose a random block");

        previousRedCude = value.GetComponent <GridItem>();

        previousRedCude.ChangeToRed();
        StartTime = 0f;  //reset the start time to 0
    }