Exemplo n.º 1
0
        public MaterialSerializable(Material material) : base(material)
        {
            shaderKeywords          = material.shaderKeywords;
            enableInstancing        = material.enableInstancing;
            doubleSidedGI           = material.doubleSidedGI;
            globalIlluminationFlags = material.globalIlluminationFlags;
            renderQueue             = material.renderQueue;
            mainTextureScale        = material.mainTextureScale;
            mainTextureOffset       = material.mainTextureOffset;
            shader = material.shader != null ? new ShaderSerializable(material.shader) : null;

            if (material.HasProperty("_Color"))
            {
                color = material.GetColor("_Color");
            }
            if (material.HasProperty("_MainTex"))
            {
                var tex = material.GetTexture("_MainTex");
                mainTex = tex != null ? new TextureUnion(tex) : null;
            }
        }
Exemplo n.º 2
0
        public LightSerializable(Light obj) : base(obj)
        {
            type      = obj.type;
            range     = obj.range;
            spotAngle = obj.spotAngle;

            color           = obj.color;
            intensity       = obj.intensity;
            bounceIntensity = obj.bounceIntensity;

            shadows          = obj.shadows;
            shadowStrength   = obj.shadowStrength;
            shadowResolution = obj.shadowResolution;
            shadowBias       = obj.shadowBias;
            shadowNormalBias = obj.shadowNormalBias;
            shadowNearPlane  = obj.shadowNearPlane;

            cookie      = obj.cookie != null ? new TextureUnion(obj.cookie) : null;
            cookieSize  = obj.cookieSize;
            renderMode  = obj.renderMode;
            cullingMask = obj.cullingMask;
        }