Last active
January 13, 2019 04:48
-
-
Save TomoG29/5d057315bda31056491e296587e076dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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