// 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>(); }
// 커스터마이즈된 에디터의 인스턴스가 생성될 때 호출 void OnEnable() { // target은 위의 CustomEditor() 애트리뷰트에서 설정해 준 타입의 객체에 대한 레퍼런스 // object형이므로 실제 사용할 타입으로 캐스팅 해 준다. _neuro = target as NeuroHeadSetController; }