/// <summary> /// 全屏时,w,h无效 /// </summary> public HeroPhoto(ref RawImage image, int resId, PhotoType type, int w = 2048, int h = 2048, bool bFullScreen = false) { if (Application.isEditor) { image.material.shader = Shader.Find(image.material.shader.name); } Debug.Log("打开玩家展示:" + resId); m_bFullScreen = bFullScreen; if (bFullScreen) { RectTransform rect = image.GetComponent <RectTransform>(); rect.anchorMax = Vector2.one; rect.anchorMin = Vector2.zero; rect.anchoredPosition = Vector2.zero; rect.sizeDelta = Vector2.zero; } m_resId = resId; m_photoImage = image; m_type = type; m_w = w; m_h = h; UIHeroShowEffectCsv showEffectCsv = CsvManager.Inst.GetCsv <UIHeroShowEffectCsv>((int)eAllCSV.eAC_UIHeroShowEffect); m_showEffectData = showEffectCsv.GetData((int)m_resId); OnCreateEnv(); if (type == PhotoType.uieffect) { OnCreateEnterPhoto("born"); } else { // 先加载预加载再创建 if (m_showEffectData == null) { return; } LoadPre(m_showEffectData, () => { if (m_photoObject == null) { return; } OnCreateUI(); OnEnter(); }); } HeroPhotoMgr.Inst.Add(this); }
/// <summary> /// 这里初始化所有的csv配置 /// </summary> public void InitCsv(ref CsvManager csvMgr) { csvMgr.AddCSVCreate((int)eAllCSV.eAC_Animation, "动作表", new AnimationCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_Effect, "特效表", new EffectCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_Sound, "音效表", new SoundCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_Dns, "域名表", new DnsCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_GameText, "游戏文本表", new GameTextCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_Scene, "地图表", new SceneCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_Player, "角色表", new PlayerCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_PlayerExp, "玩家经验表", new PlayerExpCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_Skill, "技能主表", new SkillCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_SkillStep, "技能子表", new SkillStepCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_SkillData, "技能数据表", new SkillDataCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_SkillBuff, "技能buff表", new SkillBuffCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAc_BuffTrigger, "技能buff触发器表", new BuffTriggerCsv()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_UIHeroShow, "英雄展示表", UIHeroShowCsv.CreateCSV()); csvMgr.AddCSVCreate((int)eAllCSV.eAC_UIHeroShowEffect, "英雄展示动效表", UIHeroShowEffectCsv.CreateCSV()); InitLuaCsv(ref csvMgr); }