文章来源地址https://www.toymoban.com/news/detail-697361.html
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class A02_Generic : MonoBehaviour
{
[ContextMenu("测试Start")]
// Start is called before the first frame update
void Start()
{
Persons people = new Persons()
{
new Person("1.zhang san",1.57f,63),
new Person("2.Li si",1.75f,59),
new Person("3333333",1.65f,56),
new Person("44444444",1.7f,61),
};
Debug.Log("原生数据");
people.ForEach(p => Debug.Log(p));
Debug.Log("\n身高排序");
people.Sort(new PersonHeightCompare());
people.ForEach(p => Debug.Log(p));
Debug.Log("\n过滤");
var fits = people.Filt
文章来源:https://www.toymoban.com/news/detail-697361.html
到了这里,关于C#进阶 多个泛型约束的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!