void Awake() { if (_instance == null) { //If I am the first instance, make me the Singleton _instance = this; } else { //If a Singleton already exists and you find //another reference in scene, destroy it! if (this != _instance) { Destroy(this.gameObject); } } }
public Node <INode> GetNode(string nodeName) { switch (nodeName) { case OSCManager.NAME: INode nodeOsc = new OSCManager() as INode; return(new Node <INode> (nodeOsc)); case OSCReceive.NAME: INode nodeOSCFilter = new OSCReceive() as INode; return(new Node <INode> (nodeOSCFilter)); case OSCSend.NAME: INode nodeOSCSend = new OSCSend() as INode; return(new Node <INode> (nodeOSCSend)); default: return(null); } }