kingBook

导航

C#可变参数params

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestParams:MonoBehaviour{
        
        private void Start(){
            test(1,2,3,4);
            test(1,4);
            
            int[] list= { 1, 2, 3, 4, 5, 6 };
            test(list);
        }
        
        private void test(params int[] list){
            
        }
        
}

posted on 2019-01-04 20:32  kingBook  阅读(135)  评论(0编辑  收藏  举报