//----------------------------------------------------------------------------- public void Set(int value, AREntity entity) { if (!HasSetPermission(entity)) { Debug.LogError("Error in SetProperty :: this entity has no permission"); return; } mValue = value; if (OnPropertyChanged != null) { OnPropertyChanged(this, null); } }
public override void RegisterMsg(int msg_id, AREntity entity) { //Debug.Log("Final in MsgEntity.RegisterMsg()"); if (msgRegisterDic == null) { msgRegisterDic = new Dictionary <int, List <AREntity> >(); } if (msgRegisterDic.ContainsKey(msg_id)) { msgRegisterDic[msg_id].Add(entity); } else { List <AREntity> paramList = new List <AREntity>() { entity }; msgRegisterDic.Add(msg_id, paramList); } }
/// <summary> /// 注册模块 /// </summary> /// <param name="entityID"></param> /// <param name="entity"></param> public void RegisterEntity(int entityID, AREntity entity) { if (entityDic == null) { entityDic = new Dictionary <int, AREntity>(); } int key = entityID; if (!entityDic.ContainsValue(entity)) { entity.EntityID = key; entityDic.Add(entity.EntityID, entity); //Debug.Log((EntityLib)entity.EntityID); } else { Debug.LogError("Error in RegisterEntity :: this entity has already been registered"); } entity.Init(); }
/// <summary> /// 用于entity注册功能性消息(功能模块需要接收的消息需要在Init时进行注册) /// </summary> /// <param name="msg_id"></param> public virtual void RegisterMsg(int msg_id, AREntity entity) { entityMgr.RegisterMsg(msg_id, entity); }
public override void RegisterMsg(int msg_id, AREntity entity) { MsgEntityIns.RegisterMsg(msg_id, entity); }
/// <summary> /// 检测是否具有修改数据的权限 /// </summary> /// <param name="entity"></param> /// <returns></returns> private bool HasSetPermission(AREntity entity) { return entity.EntityID == (int)EntityLib.PlayerPrefsEntity; }
// Use this for initialization private void Awake() { entity = AREntity.Instance; // 注册EntityMgr entity.SetEntityMgr(new EntityMgr()); }