Esempio n. 1
0
            public Factory(Data d, GameObject gObj,
			float zOff = 0, float zR = 1, int rQOff = 0, Camera cam = null,
			string texturePrfx = "", string fontPrfx = "",
			TextureLoader textureLdr = null,
			TextureUnloader textureUnldr = null)
                : base(gObj, zOff, zR, rQOff,
			cam, texturePrfx, fontPrfx, textureLdr, textureUnldr)
            {
                data = d;
                mesh = new Mesh();

                meshFilter = gameObject.AddComponent<MeshFilter>();
                meshFilter.sharedMesh = mesh;

                meshRenderer = gameObject.AddComponent<UnityEngine.MeshRenderer>();
                meshRenderer.castShadows = false;
                meshRenderer.receiveShadows = false;

                textureName = texturePrefix + data.textures[0].filename;
                meshRenderer.sharedMaterial =
                ResourceCache.SharedInstance().LoadTexture(
                data.name, textureName, data.textures[0].format,
                    textureLoader, textureUnloader);
                if (renderQueueOffset != 0)
                meshRenderer.sharedMaterial.renderQueue += renderQueueOffset;

                premultipliedAlpha = (data.textures[0].format ==
                (int)Format.Constant.TEXTUREFORMAT_PREMULTIPLIEDALPHA);

                buffer = new CombinedMeshBuffer();

                CreateBitmapContexts(data);
                CreateTextContexts(data);
            }
            public Factory(Data data, GameObject gObj,
			float zOff = 0, float zR = 1, int rQOff = 0, Camera cam = null,
			string texturePrfx = "", string fontPrfx = "",
			TextureLoader textureLdr = null,
			TextureUnloader textureUnldr = null)
                : base(gObj, zOff, zR, rQOff,
			cam, texturePrfx, fontPrfx, textureLdr, textureUnldr)
            {
                CreateBitmapContexts(data);
            }
Esempio n. 3
0
            public Factory(Data d, GameObject gObj,
			float zOff = 0, float zR = 1, int rQOff = 0,
			string sLayerName = null, int sOrder = 0, bool uAC = false,
			Camera renderCam = null, Camera inputCam = null,
			string texturePrfx = "", string fontPrfx = "",
			TextureLoader textureLdr = null,
			TextureUnloader textureUnldr = null)
                : base(d, gObj, zOff, zR, rQOff, sLayerName, sOrder, uAC, renderCam,
			inputCam, texturePrfx, fontPrfx, textureLdr, textureUnldr)
            {
                CreateBitmapContexts();
                CreateTextContexts();
            }
Esempio n. 4
0
            protected Factory(GameObject gObj,
		float zOff, float zR, int rQOff, Camera cam,
		string texturePrfx = "", string fontPrfx = "",
		TextureLoader textureLdr = null,
		TextureUnloader textureUnldr = null)
            {
                gameObject = gObj;
                zOffset = zOff;
                zRate = zR;
                renderQueueOffset = rQOff;
                camera = cam;
                texturePrefix = texturePrfx;
                fontPrefix = fontPrfx;
                textureLoader = textureLdr;
                textureUnloader = textureUnldr;
                matrix = Matrix4x4.identity;
            }
Esempio n. 5
0
            protected Factory(GameObject gObj,
		float zOff, float zR, int rQOff, Camera cam,
		string texturePrfx = "", string fontPrfx = "",
		TextureLoader textureLdr = null,
		TextureUnloader textureUnldr = null)
            {
                gameObject = gObj;
                zOffset = zOff;
                zRate = zR;
                renderQueueOffset = rQOff;
                camera = cam;
                texturePrefix = texturePrfx;
                fontPrefix = fontPrfx;
                textureLoader = textureLdr;
                textureUnloader = textureUnldr;
                matrix = Matrix4x4.identity;
                blendMode = (int)Format.Constant.BLEND_MODE_NORMAL;
                maskMode = (int)Format.Constant.BLEND_MODE_NORMAL;
            }
Esempio n. 6
0
            protected Factory(Data d, GameObject gObj, float zOff, float zR, int rQOff,
		string sLayerName, int sOrder, bool uAC, Camera renderCam,
		Camera inputCam, string texturePrfx = "", string fontPrfx = "",
		TextureLoader textureLdr = null, TextureUnloader textureUnldr = null)
            {
                data = d;
                gameObject = gObj;
                zOffset = zOff;
                zRate = zR;
                renderQueueOffset = rQOff;
                sortingLayerName = sLayerName;
                sortingOrder = sOrder;
                useAdditionalColor = uAC;
                renderCamera = renderCam;
                inputCamera = inputCam;
                texturePrefix = texturePrfx;
                fontPrefix = fontPrfx;
                textureLoader = textureLdr;
                textureUnloader = textureUnldr;
                matrix = Matrix4x4.identity;
                blendMode = (int)Format.Constant.BLEND_MODE_NORMAL;
                maskMode = (int)Format.Constant.BLEND_MODE_NORMAL;
            }
Esempio n. 7
0
            public Factory(Data d, GameObject gObj,
			float zOff = 0, float zR = 1, int rQOff = 0,
			string sLayerName = null, int sOrder = 0, bool uAC = false,
			Camera renderCam = null, Camera inputCam = null,
			string texturePrfx = "", string fontPrfx = "",
			TextureLoader textureLdr = null,
			TextureUnloader textureUnldr = null,
			bool attaching = false)
                : base(d, gObj, zOff, zR, rQOff, sLayerName, sOrder, uAC, renderCam,
			inputCam, texturePrfx, fontPrfx, textureLdr, textureUnldr)
            {
                CreateBitmapContexts();
                CreateTextContexts();

                meshComponents = new List<CombinedMeshComponent>();
                if (!attaching)
                AddMeshComponent();
                usedMeshComponentNo = -1;

                updateCount = -1;
            }