protected virtual void Awake() { m_Instance = this; m_MapManager = new CMapManager(); m_RegisterEntities = new Dictionary <string, CEntity> (); m_EntityConnecteds = new Dictionary <NetworkConnection, CEntity> (); }
public virtual void LoadMap() { m_MapManager = new CMapManager(); m_MapManager.LoadMap("WorldMap0001", (mapData) => { var mapObjects = mapData.mapObjects; for (int i = 0; i < mapObjects.Length; i++) { var objDataText = CResourceManager.Instance.LoadResourceOrAsset <TextAsset> (mapObjects[i].dataPath); if (objDataText != null) { var objData = TinyJSON.JSON.Load(objDataText.text).Make <CCharacterData> (); var objModel = CResourceManager.Instance.LoadResourceOrAsset <CObjectController>(objData.modelPath); var objController = GameObject.Instantiate(objModel); objController.SetPosition(mapObjects[i].position.ToV3()); } } }); }