Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KaseliaePenguin/608ce520ac335f1b5660d83312588348 to your computer and use it in GitHub Desktop.
Save KaseliaePenguin/608ce520ac335f1b5660d83312588348 to your computer and use it in GitHub Desktop.
紐付け
public class SamplePrefab : MonoBehaviour
{
public Func<GameObject> Generator
{
get{ return () => Instantiate(this); }
}
}
public class SampleClass : MonoBehaviour
{
[SerializeField]
SamplePrefab prefab;
void Awake()
{
prefab.Generator();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment