<commit_before>﻿using UnityEngine;
using System.Collections;

public class GradientBackround : MonoBehaviour {
  public Color topColor;
  public Color bottomColor;
  public int gradientLayer = 7;

  void Awake() {
    gradientLayer = Mathf.Clamp(gradientLayer, 0, 31);

    if (!GetComponent<Camera>()) {
      Debug.LogError ("Must attach GradientBackground script to the camera");
      return;
    }
    
    GetComponent<Camera>().clearFlags = CameraClearFlags.Depth;
    GetComponent<Camera>().cullingMask = GetComponent<Camera>().cullingMask & ~(1 << gradientLayer);
    Camera gradientCam = new GameObject("Gradient Cam", typeof(Camera)).GetComponent<Camera>();
    gradientCam.depth = GetComponent<Camera>().depth - 1;
    gradientCam.cullingMask = 1 << gradientLayer;
 
    Mesh mesh = new Mesh();
    mesh.vertices = new Vector3[4]
      {new Vector3(-100f, .577f, 1f), new Vector3(100f, .577f, 1f), new Vector3(-100f, -.577f, 1f), new Vector3(100f, -.577f, 1f)};
 
    mesh.colors = new Color[4] {topColor, topColor, bottomColor, bottomColor};
 
    mesh.triangles = new int[6] {0, 1, 2, 1, 3, 2};
 
    Shader shader = Shader.Find("Gradient");
    Material mat = new Material(shader);
    GameObject gradientPlane = new GameObject("Gradient Plane", typeof(MeshFilter), typeof(MeshRenderer));
 
    ((MeshFilter)gradientPlane.GetComponent(typeof(MeshFilter))).mesh = mesh;
    gradientPlane.GetComponent<Renderer>().material = mat;
    gradientPlane.layer = gradientLayer;
  }
  // Use this for initialization
  void Start () {
  
  }
  
  // Update is called once per frame
  void Update () {
  
  }
}<commit_msg>implementa cambios de colores en gradiente de background<commit_after>using UnityEngine;
using System.Collections;

public class GradientBackround : MonoBehaviour {
  public Color topColor;
  public Color bottomColor;
  public Color[] colors = new Color[] {new Color(0.95f, 0.89f, 0.05f), new Color(0.92f, 0.7f, 0.02f), new Color(0.709f, 0.41f, 0.27f), new Color(0.109f, 0.009f, 0.009f), new Color(0.0f, 0.0f, 0.0f)}; 
  public int gradientLayer = 7;
  public GameObject ball;
  private Mesh mesh;

  void Awake() {

    gradientLayer = Mathf.Clamp(gradientLayer, 0, 31);

    if (!GetComponent<Camera>()) {
      Debug.LogError ("Must attach GradientBackground script to the camera");
      return;
    }
    
    GetComponent<Camera>().clearFlags = CameraClearFlags.Depth;
    GetComponent<Camera>().cullingMask = GetComponent<Camera>().cullingMask & ~(1 << gradientLayer);
    Camera gradientCam = new GameObject("Gradient Cam", typeof(Camera)).GetComponent<Camera>();
    gradientCam.depth = GetComponent<Camera>().depth - 1;
    gradientCam.cullingMask = 1 << gradientLayer;
    
    mesh = new Mesh();
    mesh.vertices = new Vector3[4]
      {new Vector3(-100f, .577f, 1f), new Vector3(100f, .577f, 1f), new Vector3(-100f, -.577f, 1f), new Vector3(100f, -.577f, 1f)};
    mesh.triangles = new int[6] {0, 1, 2, 1, 3, 2};

    mesh.colors = new Color[4] {topColor, topColor, bottomColor, bottomColor};
 
    Shader shader = Shader.Find("Gradient");
    Material mat = new Material(shader);
    GameObject gradientPlane = new GameObject("Gradient Plane", typeof(MeshFilter), typeof(MeshRenderer));
 
    ((MeshFilter)gradientPlane.GetComponent(typeof(MeshFilter))).mesh = mesh;
    gradientPlane.GetComponent<Renderer>().material = mat;
    gradientPlane.layer = gradientLayer;
  }
  // Use this for initialization
  void Start () {
  
  }
  
  // Update is called once per frame
  void Update () {
    float tilNext = ball.GetComponent<BTBPlayerController>().TimeTilNextBounce;

    if(tilNext <= 1.0f) {
      bottomColor = colors[0];
      topColor = colors[1];
    }

    else if(tilNext > 1.0f && tilNext <= 2.0f) {
      bottomColor = colors[1];
      topColor = colors[2];
    }

    else if(tilNext > 2.0f && tilNext <= 3.0f) {
      bottomColor = colors[2];
      topColor = colors[3];
    }

    else {
      bottomColor = colors[3];
      topColor = colors[4];
    }
    UpdateGradients();
  }

  void UpdateGradients() {
    mesh.colors = new Color[4] {topColor, topColor, bottomColor, bottomColor};
  }
}
{'fraction_non_alphanumeric': 0.13555233960443802, 'fraction_numerical': 0.03907380607814761, 'mean_word_length': 3.592469545957918, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5197682', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1321, 'n_words': 331}