IWithChangingTexture.cs 1.3 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright (c) 2024 Vuplex Inc. All rights reserved.
  2. //
  3. // Licensed under the Vuplex Commercial Software Library License, you may
  4. // not use this file except in compliance with the License. You may obtain
  5. // a copy of the License at
  6. //
  7. // https://vuplex.com/commercial-library-license
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. using System;
  15. using UnityEngine;
  16. namespace Vuplex.WebView {
  17. /// <summary>
  18. /// Unity added support for using Texture2D.CreateExternalTexture() with Vulkan in 2020.2,
  19. /// but support for Texture2D.UpdateExternalTexture() wasn't added until 2022.1.
  20. /// So, this interface is used by 3D WebView on Android to update the texture
  21. /// when Vulkan is used with versions of Unity prior to 2022.1.
  22. /// https://issuetracker.unity3d.com/issues/android-vulkan-texture2d-dot-updateexternaltexture-does-not-respond-when-a-project-is-built-on-android-with-vulkan-graphics-api
  23. /// </summary>
  24. public interface IWithChangingTexture {
  25. event EventHandler<EventArgs<Texture2D>> TextureChanged;
  26. }
  27. }