List示例代码
List() 可扩展list
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AllVideo : MonoBehaviour
{
public VideoCol VideoC1;
public VideoCol VideoC2;
public VideoCol VideoC3;
public VideoCol VideoC4;
public VideoCol VideoC5;
public VideoCol VideoC6;
public VideoCol VideoC7;
public VideoCol VideoC8;
public VideoCol VideoC9;
private List<VideoCol> ViC;
public void FirstPlay()
{
ViC = new List<VideoCol>();
ViC.Add(VideoC1);//<方法>.ADD()添加元素,单个添加
ViC.Add(VideoC2);
ViC.Add(VideoC3);
ViC.Add(VideoC4);
ViC.Add(VideoC5);
ViC.Add(VideoC6);
ViC.Add(VideoC7);
ViC.Add(VideoC8);
ViC.Add(VideoC9);
foreach (VideoCol element in ViC)
{
element.FirstOfAllVideo();
}
}
}