Exemple #1
0
        private void Render()
        {
            //Rendering
#if UNITY_IOS && !UNITY_EDITOR
            int length = EmojiTexture_render(text, buffer, texture.width, texture.height, SanitizeText ? 1 : 0);
            if (!string.IsNullOrEmpty(text) && text.Length != length)
            {
                text = text.Substring(0, length);
            }
#elif UNITY_ANDROID && !UNITY_EDITOR
            int length =
                EmojiTextureClass.CallStatic <int>("render", text, jByteBuffer, texture.width, texture.height, SanitizeText);
            if (!string.IsNullOrEmpty(text) && text.Length != length)
            {
                text = text.Substring(0, length);
            }
#elif UNITY_WEBGL && !UNITY_EDITOR
            int length = EmojiTexture_render(text, buffer, texture.width, texture.height, SanitizeText ? 1 : 0);
            if (!string.IsNullOrEmpty(text) && text.Length != length)
            {
                text = text.Substring(0, length);
            }
#endif
            //Copy pixels to texture
#if (UNITY_IOS || UNITY_ANDROID || UNITY_WEBGL) && !UNITY_EDITOR
            isByteBufferDirty = true;

#if ENABLE_CUSTOM_TEXTURE_UPDATE
            if (CanCopyTextures && TextureUpdateCallback != IntPtr.Zero)
            {
                commandBuffer.IssuePluginCustomTextureUpdate(
                    TextureUpdateCallback, texture, (uint)(bufferRef.IndexOf(buffer))
                    );
                Debug.Log("CustomTextureUpdate");
                Graphics.ExecuteCommandBuffer(commandBuffer);
                commandBuffer.Clear();
            }
            else
#endif
            {
                texture.LoadRawTextureData(buffer, bufferSize);
                texture.Apply();
            }
#endif
        }
Exemple #2
0
        private void Render()
        {
            //Rendering
#if UNITY_IOS && !UNITY_EDITOR
            EmojiTexture_render(text, buffer, texture.width, texture.height);
#elif UNITY_ANDROID && !UNITY_EDITOR
            int length = EmojiTextureClass.CallStatic <int>("render", text, jByteBuffer, texture.width, texture.height, SanitizeText);
            if (!string.IsNullOrEmpty(text) && text.Length != length)
            {
                text = text.Substring(0, length);
            }
#endif
            //Copy pixels to texture
#if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
            isByteBufferDirty = true;
            texture.LoadRawTextureData(buffer, bufferSize);
            texture.Apply();
#endif
        }