Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        private void OnCreateEnv()
        {
            // 创建photo对象,摄像机和灯光
            m_photoObject = new GameObject("photo_" + m_resId);
            m_photoObject.transform.position = new Vector3(m_photoPos, 0, 0);
            m_photoPos += 100;

            if (m_type == PhotoType.hero)
            {
                // 背景
                //EntityBaseInfo infoBg = new EntityBaseInfo();
                //infoBg.m_resID = m_bgResId;
                //infoBg.m_ilayer = (int)LusuoLayer.eEL_Photo;
                //infoBg.m_parent = m_photoObject.transform;
                //m_bgHandleId = EntityManager.Inst.CreateEntity(eEntityType.eBoneEntity, infoBg, (ent) =>
                //{
                //    SetBgOffset();
                //});
            }

            m_photoCam = (new GameObject("cam")).AddComponent <Camera>();
            m_photoCam.transform.SetParent(m_photoObject.transform);
            m_photoCam.cullingMask         = LayerMask.GetMask(LayerMask.LayerToName((int)LusuoLayer.eEL_Photo)); // 以及特效
            m_photoCam.depth               = -1;
            m_photoCam.farClipPlane        = 15;
            m_photoCam.backgroundColor     = Color.clear;
            m_photoCam.clearFlags          = CameraClearFlags.SolidColor;
            m_photoCam.useOcclusionCulling = false;

            RenderTextureFormat rtFormat = RenderTextureFormat.Default;

            if (CheckSupport(ref rtFormat))
            {
                if (m_bFullScreen)
                {
                    m_photoRT = new RenderTexture((int)(Screen.width * 1f), (int)(Screen.height * 1f), 1, rtFormat);
                }
                else
                {
                    m_photoRT = new RenderTexture((int)(m_w * 1f), (int)(m_h * 1f), 1, rtFormat);
                }
                m_photoRT.depth          = 24;
                m_photoCam.targetTexture = m_photoRT;
                if (m_photoImage != null)
                {
                    m_photoImage.texture = m_photoCam.targetTexture;
                    m_photoImage.gameObject.SetActiveNew(true);
                }
            }

            // 动态读取配置
            UIHeroShowCsv     csv  = CsvManager.Inst.GetCsv <UIHeroShowCsv>((int)eAllCSV.eAC_UIHeroShow);
            UIHeroShowCsvData data = csv.GetData((int)m_resId);

            if (data.orthographic == 0)  // 透视
            {
                m_photoCam.orthographic = false;
                m_photoCam.fieldOfView  = data.fovOrSize;
                m_photoCam.farClipPlane = 15f;
            }
            else
            {
                m_photoCam.orthographic     = true;
                m_photoCam.orthographicSize = data.fovOrSize;
            }

            if (data != null)
            {
                // 相机
                m_photoCam.transform.localPosition    = data.vPos;
                m_photoCam.transform.localEulerAngles = data.vRota;

                GameObject lig1 = new GameObject("l1");
                lig1.transform.SetParent(m_photoObject.transform);
                Light light = lig1.AddComponent <Light>();
                light.type = LightType.Directional;
                light.transform.localPosition    = Vector3.zero;
                light.transform.localEulerAngles = data.vLightPos_1;
                light.color       = data.vLightColor_1 / 255;
                light.intensity   = data.lightIntensity_1;
                light.range       = 10;
                light.cullingMask = LayerMask.GetMask(LayerMask.LayerToName((int)LusuoLayer.eEL_Photo));

                GameObject lig2 = new GameObject("l2");
                lig2.transform.SetParent(m_photoObject.transform);
                Light light2 = lig2.AddComponent <Light>();
                light2.type = LightType.Point;
                light2.transform.localPosition = data.vLightPos_2;
                light2.color       = data.vLightColor_2 / 255;
                light2.intensity   = data.lightIntensity_2;
                light2.range       = 10;
                light2.cullingMask = LayerMask.GetMask(LayerMask.LayerToName((int)LusuoLayer.eEL_Photo));
            }
        }