Skip to content

Instantly share code, notes, and snippets.

@TomoG29
Last active January 13, 2019 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomoG29/5d057315bda31056491e296587e076dd to your computer and use it in GitHub Desktop.
Save TomoG29/5d057315bda31056491e296587e076dd to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using UnityEngine;
public class Sample : MonoBehaviour
{
public static T MaxValue<T>(params T[] values)
{
var list = new List();
list.AddRange(values);
list.Sort();
return list[values.Length - 1];
}
public static T MinValue<T>(params T[] values)
{
var list = new List();
list.AddRange(values);
list.Sort();
return list[0];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment