public void Remove(long key) { Log.Info($"location remove key: {key}"); this.locations.Remove(key); }
public void Awake() { Type[] types = typeof(NodeType).Assembly.GetTypes(); foreach (Type type in types) { if (type.IsSubclassOf(typeof(NP_NodeDataBase)) || type.IsSubclassOf(typeof(NP_ClassForStoreAction)) || type.IsSubclassOf(typeof(BuffNodeDataBase)) || type.IsSubclassOf(typeof(BuffDataBase)) || type.IsSubclassOf(typeof(ListenBuffEvent_Normal)) || type.IsSubclassOf(typeof(NP_DataSupportorBase))) { BsonClassMap.LookupClassMap(type); } } BsonClassMap.LookupClassMap(typeof(NP_BBValue_Int)); BsonClassMap.LookupClassMap(typeof(NP_BBValue_Bool)); BsonClassMap.LookupClassMap(typeof(NP_BBValue_Float)); BsonClassMap.LookupClassMap(typeof(NP_BBValue_String)); BsonClassMap.LookupClassMap(typeof(NP_BBValue_Vector3)); BsonClassMap.LookupClassMap(typeof(NP_BBValue_Long)); BsonClassMap.LookupClassMap(typeof(NP_BBValue_List_Long)); #if SERVER DirectoryInfo directory = new DirectoryInfo(NPDataPath); FileInfo[] fileInfos = directory.GetFiles(); foreach (var fileInfo in fileInfos) { byte[] mfile = File.ReadAllBytes(fileInfo.FullName); if (mfile.Length == 0) { Log.Info("没有读取到文件"); } try { NP_DataSupportor MnNpDataSupportor = BsonSerializer.Deserialize <NP_DataSupportor>(mfile); Log.Info($"反序列化行为树:{fileInfo.FullName}完成"); m_NpRuntimeTreesDatas.Add(MnNpDataSupportor.NpDataSupportorBase.RootId, MnNpDataSupportor); } catch (Exception e) { Console.WriteLine(e); throw; } } #else ResourcesComponent resourcesComponent = Game.Scene.GetComponent <ResourcesComponent>(); resourcesComponent.LoadBundle("skillconfigs.unity3d"); GameObject skillConfigs = (GameObject)resourcesComponent.GetAsset("skillconfigs.unity3d", "SkillConfigs"); foreach (var referenceCollectorData in skillConfigs.GetComponent <ReferenceCollector>().data) { TextAsset textAsset = skillConfigs.GetTargetObjectFromRC <TextAsset>(referenceCollectorData.key); if (textAsset.bytes.Length == 0) { Log.Info("没有读取到文件"); } try { NP_DataSupportor MnNpDataSupportor = BsonSerializer.Deserialize <NP_DataSupportor>(textAsset.bytes); Log.Info($"反序列化行为树:{referenceCollectorData.key}完成"); this.m_NpRuntimeTreesDatas.Add(MnNpDataSupportor.NpDataSupportorBase.RootId, MnNpDataSupportor); } catch (Exception e) { Log.Error(e); throw; } } #endif }
public override void Start() { networkHttp = this.entity.GetComponent <ComponentNetworkHttp>(); Log.Info($"HttpRpc http://{networkHttp.ipEndPoint}/"); HttpService.ReplaceFunc = ReplaceFunc; }