Beispiel #1
0
        protected void LoadHGraphics(FakeStruct fake, UIContext hg)
        {
            HGraphicsData tmp;

            unsafe
            {
                tmp = *(HGraphicsData *)fake.ip;
            }

            var tar    = hg.GetUIData() as huqiang.Core.HGUI.HGraphics;
            var buffer = fake.buffer;

            asset       = buffer.GetData(tmp.asset) as string;
            MainTexture = buffer.GetData(tmp.MainTexture) as string;
            if (MainTexture != null)
            {
                tar.MainTexture = ElementAsset.FindTexture(asset, MainTexture);
            }
            else
            {
                tar.MainTexture = null;
            }
            STexture = buffer.GetData(tmp.STexture) as string;
            if (STexture != null)
            {
                tar.STexture = ElementAsset.FindTexture(asset, STexture);
            }
            else
            {
                tar.STexture = null;
            }
            TTexture = buffer.GetData(tmp.TTexture) as string;
            if (TTexture != null)
            {
                tar.TTexture = ElementAsset.FindTexture(asset, TTexture);
            }
            else
            {
                TTexture = null;
            }
            FTexture = buffer.GetData(tmp.FTexture) as string;
            if (FTexture != null)
            {
                tar.FTexture = ElementAsset.FindTexture(asset, FTexture);
            }
            else
            {
                FTexture = null;
            }
            shader = buffer.GetData(tmp.shader) as string;
            if (shader != null)
            {
                tar.Material = new Material(Shader.Find(shader));
            }
            else
            {
                tar.Material = null;
            }
            tar.m_color       = tmp.color;
            tar.uvrect        = tmp.uvRect;
            tar.Shadow        = tmp.Shadow;
            tar.shadowOffsset = tmp.shadowOffsset;
            tar.shadowColor   = tmp.shadowColor;
            //tar.tris = null;
        }