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
Vector3 GetHorizontalAxis(float inputHorizontal) | |
{ | |
return new Vector3(0, inputHorizontal, 0); | |
} | |
Vector3 GetVerticalAxis(float inputVertical) | |
{ | |
return transform.right * inputVertical; | |
} |
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 | |
{ |
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
[SerializeField] | |
SamplePrefab prefab; | |
void Awake() | |
{ | |
var instance = Instantiate(prefab); | |
} |