void Awake() { m_Instance = this; if (m_Instance == null) { m_Instance = this; } else if (m_Instance != this) { Destroy(gameObject); } gamaManager = gameObject; MainCamera = GameObject.Find("MainCamera"); // Create the Topic's manager GameObjects new GameObject(IMQTTConnector.COLOR_TOPIC_MANAGER).AddComponent <ColorTopic>(); new GameObject(IMQTTConnector.POSITION_TOPIC_MANAGER).AddComponent <PositionTopic>(); new GameObject(IMQTTConnector.SET_TOPIC_MANAGER).AddComponent <SetTopic>(); new GameObject(IMQTTConnector.GET_TOPIC_MANAGER).AddComponent <GetTopic>(); new GameObject(IMQTTConnector.MONO_FREE_TOPIC_MANAGER).AddComponent <MonoFreeTopic>(); new GameObject(IMQTTConnector.MULTIPLE_FREE_TOPIC_MANAGER).AddComponent <MultipleFreeTopic>(); new GameObject(IMQTTConnector.CREATE_TOPIC_MANAGER).AddComponent <CreateTopic>(); new GameObject(IMQTTConnector.DESTROY_TOPIC_MANAGER).AddComponent <DestroyTopic>(); new GameObject(IMQTTConnector.MOVE_TOPIC_MANAGER).AddComponent <MoveTopic>(); new GameObject(IMQTTConnector.NOTIFICATION_TOPIC_MANAGER).AddComponent <NotificationTopic>(); new GameObject(IMQTTConnector.PROPERTY_TOPIC_MANAGER).AddComponent <PropertyTopic>(); new GameObject(IMQTTConnector.MQTT_CONNECTOR).AddComponent <MQTTConnector>(); new GameObject(IMQTTConnector.SCENE_MANAGER).AddComponent <SceneManager>(); (mainTopicManager = new GameObject(IMQTTConnector.MAIN_TOPIC_MANAGER)).AddComponent <MainTopic>(); new GameObject(IGamaManager.CSVREADER).AddComponent <CSVReader>().transform.SetParent(gamaManager.transform); new GameObject(IGamaManager.AGENT_CREATOR).AddComponent <AgentCreator>(); }
void OnDestroy() { m_Instance = null; }