Skip to content

Instantly share code, notes, and snippets.

@AngryAnt
Created October 16, 2013 20:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AngryAnt/7014722 to your computer and use it in GitHub Desktop.
Save AngryAnt/7014722 to your computer and use it in GitHub Desktop.
For when you really want that one line for instantiation and initialisation.
class MyBehaviour : MonoBehaviour
{
public MyBehaviour Init (int some, float parameters)
{
//...
return this;
}
}
// Examples:
// MyBehaviour instance = new GameObject ("Moo").AddComponent<MyBehaviour>().Init (1, 5.5f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment