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

[RequireComponent (typeof(CanvasGroup))]
public class CanvasGroupFader : MonoBehaviour
{
	[Tooltip ("Time in seconds to fade in/out the loader.")]
	public float fadeSpeed = 1f;

	private CanvasGroup canvasGroup;
	private IEnumerator currentFade;

	public void Show ()
	{
		Debug.Log ("[CanvasGroupFader] Show");
		StopCurrentFade ();
		currentFade = Fade (1, fadeSpeed);
		StartCoroutine (currentFade);
	}

	public void Hide ()
	{
		Debug.Log ("[CanvasGroupFader] Hide");
		StopCurrentFade ();
		currentFade = Fade (0, fadeSpeed);
		StartCoroutine (currentFade);
	}

	void Start ()
	{
		canvasGroup = GetComponent<CanvasGroup> ();
	}

	void StopCurrentFade ()
	{
		if (currentFade != null) {
			StopCoroutine (currentFade);
		}
	}

	IEnumerator Fade (float alpha, float speed)
	{
		float speedForAlphaChange = (alpha - canvasGroup.alpha) / speed;

		while (!Mathf.Approximately (canvasGroup.alpha, alpha)) {
			canvasGroup.alpha += (speedForAlphaChange * Time.deltaTime);
			yield return null;
		}
	}
}
<commit_msg>Show name of canvas fader game object inside debug log<commit_after>﻿using UnityEngine;
using System.Collections;

[RequireComponent (typeof(CanvasGroup))]
public class CanvasGroupFader : MonoBehaviour
{
	[Tooltip ("Time in seconds to fade in/out the loader.")]
	public float fadeSpeed = 1f;

	private CanvasGroup canvasGroup;
	private IEnumerator currentFade;

	public void Show ()
	{
		Debug.Log ("[CanvasGroupFader] Show " + name);
		StopCurrentFade ();
		currentFade = Fade (1, fadeSpeed);
		StartCoroutine (currentFade);
	}

	public void Hide ()
	{
		Debug.Log ("[CanvasGroupFader] Hide " + name);
		StopCurrentFade ();
		currentFade = Fade (0, fadeSpeed);
		StartCoroutine (currentFade);
	}

	void Start ()
	{
		canvasGroup = GetComponent<CanvasGroup> ();
	}

	void StopCurrentFade ()
	{
		if (currentFade != null) {
			StopCoroutine (currentFade);
		}
	}

	IEnumerator Fade (float alpha, float speed)
	{
		float speedForAlphaChange = (alpha - canvasGroup.alpha) / speed;

		while (!Mathf.Approximately (canvasGroup.alpha, alpha)) {
			canvasGroup.alpha += (speedForAlphaChange * Time.deltaTime);
			yield return null;
		}
	}
}

{'fraction_non_alphanumeric': 0.11668928086838534, 'fraction_numerical': 0.0027137042062415195, 'mean_word_length': 4.3951219512195125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1546324', 'n_tokens_mistral': 787, 'n_tokens_neox': 730, 'n_words': 185}