// Use this for initialization void Start() { //have to get the OSCCommunicator with a tag if we want this script to be //part of a prefab GameObject oscCommunicatorObject = GameObject.FindWithTag("osc"); oscCommunicator = oscCommunicatorObject.GetComponent(typeof(OSCCommunicator)) as OSCCommunicator; }
// Use this for initialization void Start() { //have to get the OSCCommunicator with a tag if we want this script to be //part of a prefab GameObject oscCommunicatorObject = GameObject.FindWithTag("osc"); oscCommunicator = oscCommunicatorObject.GetComponent(typeof(OSCCommunicator)) as OSCCommunicator; }
// Use this for initialization protected virtual void Start() { OSCCommunicator oscCommunicator = GameObject.FindGameObjectWithTag("osc").GetComponent <OSCCommunicator>(); oscCommunicator.registerOSCReceiver(this.OSCMessageReceiver, this.commandOfInterest()); }
protected virtual void Destroy() { OSCCommunicator oscCommunicator = GameObject.FindGameObjectWithTag("osc").GetComponent <OSCCommunicator>(); oscCommunicator.unregisterOSCReceiver(this.OSCMessageReceiver); }