override public void dispose() { if (m_model != null) { m_model.dispose(); m_model = null; } }
override public void dispose() { if (m_model != null) { m_model.dispose(); m_model = null; } if (m_uiPrefabRes != null) { Ctx.m_instance.m_uiPrefabMgr.unload(m_uiPrefabRes.GetPath(), null); m_uiPrefabRes = null; } if (m_boxModel != null) { Ctx.m_instance.m_modelMgr.unload(m_boxModel.GetPath(), null); m_boxModel = null; } }
protected AuxDynModel m_model; // 模型资源 public BlackCardRender(SceneEntityBase entity_) : base(entity_) { m_model = new AuxDynModel(); }
public void setNum(int value) { if (m_num != value) { disposeNum(); m_num = value; if (value > 0) { m_bPositive = true; } else { m_bPositive = false; m_num = -m_num; } int left = m_num; int mod = 0; List <int> numList = new List <int>(); while (left > 0) { mod = left % 10; numList.Add(mod); left /= 10; } mod = 0; AuxDynModel modelItem; int idx = 0; int curNum = 0; // 添加 + - 号 modelItem = new AuxDynModel(); modelItem.pntGo = m_parentGo; if (m_bPositive) { modelItem.modelResPath = string.Format("{0}Num/+{1}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathModel], ".prefab"); } else { modelItem.modelResPath = string.Format("{0}Num/-{1}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathModel], ".prefab"); } modelItem.syncUpdateModel(); UtilApi.setPos(modelItem.selfGo.transform, new Vector3(((float)-(numList.Count + 1) / 2) * m_modelWidth, 0, 0)); m_childList.Add(modelItem); while (idx < numList.Count) { curNum = numList[numList.Count - 1 - idx]; modelItem = new AuxDynModel(); modelItem.pntGo = m_parentGo; if (m_bPositive) { modelItem.modelResPath = string.Format("{0}Num/+{1}{2}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathModel], curNum, ".prefab"); } else { modelItem.modelResPath = string.Format("{0}Num/-{1}{2}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathModel], curNum, ".prefab"); } modelItem.syncUpdateModel(); UtilApi.setPos(modelItem.selfGo.transform, new Vector3(((float)-(numList.Count + 1) / 2 + (idx + 1)) * m_modelWidth, 0, 0)); m_childList.Add(modelItem); ++idx; } } }
public void setNum(int value) { if (m_num != value) { disposeNum(); m_num = value; if(value > 0) { m_bPositive = true; } else { m_bPositive = false; m_num = -m_num; } int left = m_num; int mod = 0; List<int> numList = new List<int>(); while (left > 0) { mod = left % 10; numList.Add(mod); left /= 10; } mod = 0; AuxDynModel modelItem; int idx = 0; int curNum = 0; // 添加 + - 号 modelItem = new AuxDynModel(); modelItem.pntGo = m_parentGo; if (m_bPositive) { modelItem.modelResPath = string.Format("{0}Num/+{1}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathModel], ".prefab"); } else { modelItem.modelResPath = string.Format("{0}Num/-{1}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathModel], ".prefab"); } modelItem.syncUpdateModel(); UtilApi.setPos(modelItem.selfGo.transform, new Vector3(((float)-(numList.Count + 1) / 2) * m_modelWidth, 0, 0)); m_childList.Add(modelItem); while (idx < numList.Count) { curNum = numList[numList.Count - 1 - idx]; modelItem = new AuxDynModel(); modelItem.pntGo = m_parentGo; if (m_bPositive) { modelItem.modelResPath = string.Format("{0}Num/+{1}{2}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathModel], curNum, ".prefab"); } else { modelItem.modelResPath = string.Format("{0}Num/-{1}{2}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathModel], curNum, ".prefab"); } modelItem.syncUpdateModel(); UtilApi.setPos(modelItem.selfGo.transform, new Vector3(((float)-(numList.Count + 1) / 2 + (idx + 1)) * m_modelWidth, 0, 0)); m_childList.Add(modelItem); ++idx; } } }
override public void loadChaHaoModel(GameObject pntGo_) { if (chaHaoModel == null) { chaHaoModel = new AuxDynModel(); } chaHaoModel.pntGo = pntGo_; chaHaoModel.modelResPath = string.Format("{0}{1}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathModel], "ChaHao.prefab"); chaHaoModel.syncUpdateModel(); }
protected ModelRes m_boxModel; // 这个是碰撞盒子模型 public ExceptBlackCardRender(SceneEntityBase entity_) : base(entity_) { m_model = new AuxDynModel(); }