Example #1
0
        internal void LoadStubImage(bool transparent)
        {
            const int side = 128;

            TextureParams = TextureParams.Default;
            OpacityMask   = transparent? new OpacityMask(side, side) : null;

            var pixels = new Color4[side * side];

            for (int i = 0; i < side; i++)
            {
                for (int j = 0; j < side; j++)
                {
                    pixels[i * side + j] =
                        transparent
                                                        ? Color4.Transparent
                                                        : ((i + (j & ~7)) & 8) == 0
                                                                ? Color4.Blue
                                                                : Color4.White;
                }
            }
            LoadImage(pixels, side, side);

            IsStubTexture = true;
        }
Example #2
0
        private void LoadTextureParams(string path)
        {
            var textureParamsPath = path + ".texture";

            if (AssetBundle.Current.FileExists(textureParamsPath))
            {
                using (var stream = AssetBundle.Current.OpenFile(textureParamsPath)) {
                    TextureParams = Serialization.ReadObject <TextureParams>(textureParamsPath, stream);
                }
            }
            else
            {
                TextureParams = TextureParams.Default;
            }
        }
Example #3
0
        private void LoadTextureParams(string path)
        {
            var textureParamsPath = path + ".texture";

            if (AssetBundle.Current.FileExists(textureParamsPath))
            {
                using (var stream = AssetBundle.Current.OpenFile(textureParamsPath)) {
                    TextureParams = InternalPersistence.Instance.ReadObject <TextureParams>(textureParamsPath, stream);
                }
            }
            else
            {
                TextureParams = TextureParams.Default;
            }
        }
Example #4
0
        public void LoadTextureParams(string path)
        {
            var textureParamsPath = Path.ChangeExtension(path, ".texture");

            if (AssetBundle.Current.FileExists(textureParamsPath))
            {
                using (var stream = AssetBundle.Current.OpenFile(textureParamsPath)) {
                    TextureParams = Serialization.ReadObject <TextureParams>(textureParamsPath, stream);
                }
            }
            else
            {
                TextureParams = TextureParams.Default;
            }
        }
Example #5
0
        internal void LoadStubImage()
        {
            TextureParams = TextureParams.Default;
            OpacityMask   = null;

            var pixels = new Color4[128 * 128];

            for (int i = 0; i < 128; i++)
            {
                for (int j = 0; j < 128; j++)
                {
                    pixels[i * 128 + j] = (((i + (j & ~7)) & 8) == 0) ? Color4.Blue : Color4.White;
                }
            }

            LoadImage(pixels, 128, 128);

            IsStubTexture = true;
            reloader      = new TextureStubReloader();
        }