Skip to content

Instantly share code, notes, and snippets.

@Hironyi
Last active June 16, 2021 17:31
Show Gist options
  • Save Hironyi/4c0f630b8f83abefea9cd84980c777d9 to your computer and use it in GitHub Desktop.
Save Hironyi/4c0f630b8f83abefea9cd84980c777d9 to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using UnityEngine;
public class TestForEach : MonoBehaviour
{
public List<TestClass> testClass;
private void Start()
{
//ForEachを使った時の処理
testClass.ForEach(test => test.Test());
//foreachで書いたとき。
foreach (var test in testClass)
{
test.Test();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment