// Use Awake() to initialize field variables. public void Awake() { //It is assumed that all the necessary components are already attached to CommHub gameObject, which is referred to by // gameObject field of this object, the current instance of the current Class. m_displayController = this.gameObject.GetComponent <DisplayScriptTreeOfVoice>(); m_actionPlanController = this.gameObject.GetComponent <ActionPlanController>(); m_actionPlanUpdateController = this.gameObject.GetComponent <ActionPlanUpdateController>(); m_boidsController = this.gameObject.GetComponent <SimpleBoidsTreeOfVoice>(); m_boidsRenderer = this.gameObject.GetComponent <BoidRendererTreeOfVoice>(); m_actionPlanFileManager = this.gameObject.GetComponent <ActionPlanFileManager>(); //debugging m_LEDColorGenController = this.gameObject.GetComponent <LEDColorGenController>(); // compute Shader use if (m_LEDColorGenController == null) { Debug.LogError("The component LEDColorGenController should be added to CommHub"); // Application.Quit(); } m_pointerEventsController = this.gameObject.GetComponent <PointerEventsController>(); // this gets the reference to the instance of class PointerEventsController // The instance is automatically created (by new PointerEventsController() ) when the component is added to the gameObject // The gameboject will has the reference to that instance. m_IRSensorMasterController = this.gameObject.GetComponent <IRSensorMasterController>(); m_LEDMasterController = this.gameObject.GetComponent <LEDMasterController>(); m_neuroHeadSetController = this.gameObject.GetComponent <NeuroHeadSetController>(); }
// Use Awake() to initialize field variables. public void Awake() { //ActionPlanController m_actionPlanController; //ActionPlanUpdateController m_actionPlanUpdateController; //SimpleBoidsTreeOfVoice m_boidsController; //BoidsRendererTreeOfVoice m_boidsRenderer; //DictManager m_dictManager; //LEDColorGenController m_ledColorGenController; //ButtonEventController m_buttonEventController; //PointerEventsController m_pointerEventsController; //IRSensorMasterController m_irSensorMasterController; //LEDMasterController m_ledMasterController; //NeuroHeadSetController m_neuroHeadSetController; //m_actionPlanController = gameObject.GetComponent<ActionPlanController>(); // When the component is attached to objects other than the current gameObject to which the current component is attached //GameManager gameManager; //void Awake() //{ // gameManager = GameObject.Find("ManagerObj").GetComponent<GameManager>(); //} m_actionPlanUpdateController = gameObject.GetComponent <ActionPlanUpdateController>(); //m_boidsController = gameObject.GetComponent<SimpleBoidsTreeOfVoice>(); // m_boidsRenderer = gameObject.GetComponent<BoidsRendererTreeOfVoice>(); // For Debugging by Moon // m_dictManager = gameObject.GetComponent<DictManager>(); // DictManager should be added to CommHub m_ledColorGenController = gameObject.GetComponent <LEDColorGenController>(); // compute Shader use m_pointerEventsController = gameObject.GetComponent <PointerEventsController>(); //PointerEventsController component should be added to CommHub object // this gets the reference to the instance of class PointerEventsController // The instance is automatically created (by new PointerEventsController() ) when the component is added to the gameObject // The gameboject will has the reference to that instance. m_irSensorMasterController = gameObject.GetComponent <IRSensorMasterController>(); Debug.Log(m_irSensorMasterController); Debug.Log("hihi"); // For Debugging // m_ledMasterController = gameObject.GetComponent<LEDMasterController>(); //for debugging // m_neuroHeadSetController = gameObject.GetComponent<NeuroHeadSetController>(); //In Start(): call actionPlanController.InitActionPlan //pointerEventController.onDrag += actionPlanController.ChangeActionTimes; //pointerEventController.onDrag += actionPlanController.RedrawActionPlan ==> NO, NO: all drawings are controlled by the Renderer Components such as // CanvasRenderer and LineRenderer. All you need to change is to change the locations and properties of the gameobjects involved. //pointerEventController.onPointerClick += actionPlanController.MergeOrSplitActionFields;; // two right mouse clicks merge or split the fields based on the position of the mouse within the field //inputField.onEndEdit += actionPlanController.ChangeActionValues //neuroHeadSetController.onReceived += boidsController.ChangeColorOfElectrodeBoids //irsensorMasterController.onReceived += boidsController.ChangeBrightnessOfInnerCircleBoids; // In Update call boidsController.SampleColorsAtLEDPoints // In Update call ledMasterController.SendLEDData // uiMenuController.onLoadActionPlan += actionPlanController.LoadActionPlan // uiMenuController.onSaveActionPlan += actionPlanController.SaveActionPlan }