<commit_before>using UnityEngine;

[System.Serializable]
public class ResourceAsset
{
	public string GUID;
	public string path;
	protected Object cachedObject;
	
    public T Get<T>() where T : Object
    {
		if( cachedObject == null ){
			Load<T>();
		}
		
		return cachedObject as T;
    }
    
    public void Load<T>() where T : Object
    {
		cachedObject  = Resources.Load<T>(path);		
    }
    
    public static System.Type AssetType()
    {
    	return typeof(Object);
    }
}

[System.Serializable]
public class ResourceAsset<T> : ResourceAsset where T : Object
{
	public T Get()
	{
		return Get<T>();
	}
}

[System.Serializable]
public class ResourceGameObject : ResourceAsset
{
	public GameObject Get()
	{
		return Get<GameObject>();
	}
	
	new public static System.Type AssetType()
	{
		return typeof(GameObject);
    }
}

[System.Serializable]
public class ResourceAudioClip : ResourceAsset
{
	public AudioClip Get()
	{
		return Get<AudioClip>();
	}
	
	new public static System.Type AssetType()
	{
		return typeof(AudioClip);
    }
}

[System.Serializable]
public class ResourceTextAsset : ResourceAsset
{
	public TextAsset Get()
	{
		return Get<TextAsset>();
	}
	
	new public static System.Type AssetType()
	{
		return typeof(TextAsset);
    }
}

[System.Serializable]
public class ResourceTexture : ResourceAsset
{
	public Texture Get()
	{
		return Get<Texture>();
	}
	
	new public static System.Type AssetType()
	{
		return typeof(Texture);
    }
}



<commit_msg>Added unload method<commit_after>using UnityEngine;

[System.Serializable]
public class ResourceAsset
{
	public string GUID;
	public string path;
	protected Object cachedObject;
	
    public T Get<T>() where T : Object
    {
		if( cachedObject == null ){
			Load<T>();
		}
		
		return cachedObject as T;
    }
    
    public void Load<T>() where T : Object
    {
		cachedObject  = Resources.Load<T>(path);		
    }

    public void Unload()
    {
        if (cachedObject != null)
        {
            cachedObject = null;
            Resources.UnloadAsset(cachedObject);
        }
    }

    public static System.Type AssetType()
    {
    	return typeof(Object);
    }
}

[System.Serializable]
public class ResourceAsset<T> : ResourceAsset where T : Object
{
	public T Get()
	{
		return Get<T>();
	}
}

[System.Serializable]
public class ResourceGameObject : ResourceAsset
{
	public GameObject Get()
	{
		return Get<GameObject>();
	}
	
	new public static System.Type AssetType()
	{
		return typeof(GameObject);
    }
}

[System.Serializable]
public class ResourceAudioClip : ResourceAsset
{
	public AudioClip Get()
	{
		return Get<AudioClip>();
	}
	
	new public static System.Type AssetType()
	{
		return typeof(AudioClip);
    }
}

[System.Serializable]
public class ResourceTextAsset : ResourceAsset
{
	public TextAsset Get()
	{
		return Get<TextAsset>();
	}
	
	new public static System.Type AssetType()
	{
		return typeof(TextAsset);
    }
}

[System.Serializable]
public class ResourceTexture : ResourceAsset
{
	public Texture Get()
	{
		return Get<Texture>();
	}
	
	new public static System.Type AssetType()
	{
		return typeof(Texture);
    }
}




{'fraction_non_alphanumeric': 0.10867492850333652, 'fraction_numerical': 0.0, 'mean_word_length': 3.202937249666222, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '1516881', 'n_tokens_mistral': 1056, 'n_tokens_neox': 980, 'n_words': 259}