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)
C#进阶 多个泛型约束
于 2023-09-07 00:42:21 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)