Created
April 4, 2019 05:08
-
-
Save KaseliaePenguin/608ce520ac335f1b5660d83312588348 to your computer and use it in GitHub Desktop.
紐付け
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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