private void Awake() { DouKeEntity entity = new DouKeEntity(); entity.tipText = "豆壳"; entity.localPostion = gameObject.transform.localPosition; this.DataEntity = entity; Watch(this); }
/// <summary> /// 处理豆苗部分显示业务逻辑 /// </summary> /// <param name="evt"></param> public override void ProcessLogic(PropertyMessage evt) { if (evt.PropertyName.Equals("hideAllDouGan")) { DouGanDataModel[] dms = dataModels.FindObjects <DouGanDataModel>(); bool hideAllDouGan = (bool)evt.NewValue; foreach (DouGanDataModel dm in dms) { DouGanEntity entity = utilsEntity.GetEntity <DouGanEntity>(dm.gameObject); entity.visible = !hideAllDouGan; } return; } if (evt.PropertyName.Equals("hideAllDouYa")) { bool hideAllDouYa = (bool)evt.NewValue; DouYaDataModel[] dms = dataModels.FindObjects <DouYaDataModel>(); foreach (DouYaDataModel dm in dms) { DouYaEntity entity = utilsEntity.GetEntity <DouYaEntity>(dm.gameObject); entity.visible = !hideAllDouYa; } return; } if (evt.PropertyName.Equals("hideAllDouBai")) { bool hideAllDouBai = (bool)evt.NewValue; DouBaiDataModel[] dms = dataModels.FindObjects <DouBaiDataModel>(); foreach (DouBaiDataModel dm in dms) { DouBaiEntity entity = utilsEntity.GetEntity <DouBaiEntity>(dm.gameObject); entity.visible = !hideAllDouBai; } return; } if (evt.PropertyName.Equals("hideAllDouKe")) { bool hideAllDouKe = (bool)evt.NewValue; DouKeDataModel[] dms = dataModels.FindObjects <DouKeDataModel>(); foreach (DouKeDataModel dm in dms) { DouKeEntity entity = utilsEntity.GetEntity <DouKeEntity>(dm.gameObject); entity.visible = !hideAllDouKe; } return; } if (evt.PropertyName.Equals("hideAllYeZi")) { bool hideAllYeZi = (bool)evt.NewValue; YeZiDataModel[] dms = dataModels.FindObjects <YeZiDataModel>(); foreach (YeZiDataModel dm in dms) { YeZiEntity entity = utilsEntity.GetEntity <YeZiEntity>(dm.gameObject); entity.visible = !hideAllYeZi; } return; } }