public void Awake() { m_ReceiveController = null; if (string.IsNullOrEmpty(ReceiveControllerObjectName) == true) { Debug.LogError("You must supply a ReceiverControllerObjectName"); return; } GameObject controllerObject = GameObject.Find(ReceiveControllerObjectName); if (controllerObject == null) { Debug.LogError(string.Format("A GameObject with the name '{0}' could not be found", ReceiveControllerObjectName)); return; } OscReceiveController controller = controllerObject.GetComponent <OscReceiveController> (); if (controller == null) { Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscReceiveController component", ReceiveControllerObjectName)); return; } m_ReceiveController = controller; }
public void Awake() { m_ReceiveController = null; if (ReceiveControllerObject == null) { Debug.LogError("You must supply a ReceiverControllerObject"); return; } OscReceiveController controller = ReceiveControllerObject.GetComponent <OscReceiveController> (); if (controller == null) { Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscReceiveController component", ReceiveControllerObject.name)); return; } m_ReceiveController = controller; }
public void Awake() { m_ReceiveControllers = new List <OscReceiveController>(); if (ReceiveControllers.Count == 0) { Debug.LogError("You must supply a ReceiveController"); return; } foreach (var ReceiveController in ReceiveControllers) { OscReceiveController controller = ReceiveController.GetComponent <OscReceiveController>(); if (controller == null) { Debug.LogError(string.Format("The GameObject with the name '{0}' does not contain a OscReceiveController component", ReceiveController.name)); return; } m_ReceiveControllers.Add(controller); } }
private bool GetReceiveController(GameObject g, out OscReceiveController r) { r = g.GetComponent <OscReceiveController>(); return(r == null ? false : true); }