public float m_headPos; // 头顶位置,因为外部逻辑,这个位置会变动 public Entity(int handle, Action <Entity> notity, eEntityType tpye, EntityBaseInfo baseInfo) { if (baseInfo.m_resID == 0) { Debug.LogError("资源id为0,请检查配置"); return; } m_entityInitNofity = notity; m_hid = handle; m_entityType = tpye; m_entityInfo = baseInfo; m_LoadingDestory = false; //Debug.LogError("请求加载资源。。。。。。。。。。。。"+ m_entityInfo.m_resID); if (!string.IsNullOrEmpty(m_entityInfo.m_strName)) { m_res = ResourceFactory.Inst.LoadResource(m_entityInfo.m_strName, ResourceLoaded); } else { ResInfo resInfo = ResInfosResource.GetResInfo(m_entityInfo.m_resID); if (resInfo != null && resInfo.strUrl != null) { m_entityInfo.m_strName = resInfo.strName; m_res = ResourceFactory.Inst.LoadResource(m_entityInfo.m_resID, ResourceLoaded); } else { Debug.LogError("创建失败,无资源id:" + m_entityInfo.m_resID + " 现用灰色盒子代替,请注意更换!"); m_res = ResourceFactory.Inst.LoadResource(4, ResourceLoaded); } } }
// 逻辑初始化 public void InitLayout() { foreach (KeyValuePair <int, Widget> item in m_dicGameAllPanel) { ResInfo resInfo = ResInfosResource.GetResInfo(1000 + (int)item.Key); if (resInfo != null) { m_dicWidgetByName.Add(resInfo.strName, item.Value); } } }