You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-15 04:30:09 +00:00
# [3.0.0-preview.18](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.17...v3.0.0-preview.18) (2020-08-19) ### Bug Fixes * AsmdefEx is no longer required ([50e749c](50e749c183)) * fix camera for baking mesh ([6395a4f](6395a4fa74)) * support .Net Framework 3.5 (again) ([23fcb06](23fcb06bf9)) ### Features * 3.0.0 updater ([f99292b](f99292b9a1)) * add menu to create UIParticle ([14f1c78](14f1c782ff)) * Combine baked meshes to improve performance ([633d058](633d058756)) * improve performance ([77c056a](77c056ad5f)) * optimization for vertices transforms and adding node for trails ([e070e8d](e070e8d5ee)), closes [#75](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/75) * option to ignoring canvas scaling ([fe85fed](fe85fed3c0)) * support 3d scaling ([42a84bc](42a84bc5e1)) * support custom simulation space ([a83e647](a83e64761c)), closes [#78](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/78) * support for particle systems including trail only ([f389d39](f389d39953)), closes [#61](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/61) ### BREAKING CHANGES * The bake-task has changed significantly. It may look different from previous versions.
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using System;
|
|
using System.Reflection;
|
|
using UnityEngine;
|
|
|
|
namespace Coffee.UIExtensions
|
|
{
|
|
internal static class SpriteExtensions
|
|
{
|
|
#if UNITY_EDITOR
|
|
private static Type tSpriteEditorExtension = Type.GetType("UnityEditor.Experimental.U2D.SpriteEditorExtension, UnityEditor")
|
|
?? Type.GetType("UnityEditor.U2D.SpriteEditorExtension, UnityEditor");
|
|
|
|
private static MethodInfo miGetActiveAtlasTexture = tSpriteEditorExtension
|
|
.GetMethod("GetActiveAtlasTexture", BindingFlags.Static | BindingFlags.NonPublic);
|
|
|
|
internal static Texture2D GetActualTexture(this Sprite self)
|
|
{
|
|
if (!self) return null;
|
|
|
|
if (Application.isPlaying) return self.texture;
|
|
var ret = miGetActiveAtlasTexture.Invoke(null, new[] {self}) as Texture2D;
|
|
return ret ? ret : self.texture;
|
|
}
|
|
#else
|
|
internal static Texture2D GetActualTexture(this Sprite self)
|
|
{
|
|
return self ? self.texture : null;
|
|
}
|
|
#endif
|
|
}
|
|
}
|