mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-13 11:39:54 +07:00
remove old unity version support
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
###### Version 1.3.12
|
||||
* Upgrade to minimal LTS version
|
||||
* More readable conversion warnings
|
||||
|
||||
###### Version 1.3.11
|
||||
|
||||
@@ -41,9 +41,7 @@ namespace FTEditor.Editors {
|
||||
var clip_go = new GameObject(clip.name);
|
||||
clip_go.AddComponent<MeshFilter>();
|
||||
clip_go.AddComponent<MeshRenderer>();
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
clip_go.AddComponent<SortingGroup>();
|
||||
#endif
|
||||
clip_go.AddComponent<SwfClip>().clip = clip;
|
||||
clip_go.AddComponent<SwfClipController>();
|
||||
return clip_go;
|
||||
|
||||
@@ -206,11 +206,7 @@ namespace FTEditor.Postprocessors {
|
||||
atlas_importer.spritePixelsPerUnit = asset.Settings.PixelsPerUnit;
|
||||
atlas_importer.mipmapEnabled = asset.Settings.GenerateMipMaps;
|
||||
atlas_importer.filterMode = SwfAtlasFilterToImporterFilter(asset.Settings.AtlasTextureFilter);
|
||||
#if UNITY_5_5_OR_NEWER
|
||||
atlas_importer.textureCompression = SwfAtlasFormatToImporterCompression(asset.Settings.AtlasTextureFormat);
|
||||
#else
|
||||
atlas_importer.textureFormat = SwfAtlasFormatToImporterFormat(asset.Settings.AtlasTextureFormat);
|
||||
#endif
|
||||
|
||||
var atlas_settings = new TextureImporterSettings();
|
||||
atlas_importer.ReadTextureSettings(atlas_settings);
|
||||
@@ -248,7 +244,6 @@ namespace FTEditor.Postprocessors {
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_5_5_OR_NEWER
|
||||
static TextureImporterCompression SwfAtlasFormatToImporterCompression(
|
||||
SwfSettingsData.AtlasFormat format)
|
||||
{
|
||||
@@ -263,22 +258,6 @@ namespace FTEditor.Postprocessors {
|
||||
format));
|
||||
}
|
||||
}
|
||||
#else
|
||||
static TextureImporterFormat SwfAtlasFormatToImporterFormat(
|
||||
SwfSettingsData.AtlasFormat format)
|
||||
{
|
||||
switch ( format ) {
|
||||
case SwfSettingsData.AtlasFormat.AutomaticCompressed:
|
||||
return TextureImporterFormat.AutomaticCompressed;
|
||||
case SwfSettingsData.AtlasFormat.AutomaticTruecolor:
|
||||
return TextureImporterFormat.AutomaticTruecolor;
|
||||
default:
|
||||
throw new UnityException(string.Format(
|
||||
"incorrect swf atlas format ({0})",
|
||||
format));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -4,22 +4,16 @@ using FTRuntime.Internal;
|
||||
|
||||
namespace FTRuntime {
|
||||
[ExecuteInEditMode, DisallowMultipleComponent]
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer), typeof(SortingGroup))]
|
||||
#else
|
||||
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
|
||||
#endif
|
||||
public class SwfClip : MonoBehaviour {
|
||||
|
||||
MeshFilter _meshFilter = null;
|
||||
MeshRenderer _meshRenderer = null;
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
SortingGroup _sortingGroup = null;
|
||||
#endif
|
||||
MeshFilter _meshFilter = null;
|
||||
MeshRenderer _meshRenderer = null;
|
||||
SortingGroup _sortingGroup = null;
|
||||
|
||||
bool _dirtyMesh = true;
|
||||
SwfClipAsset.Sequence _curSequence = null;
|
||||
MaterialPropertyBlock _curPropBlock = null;
|
||||
bool _dirtyMesh = true;
|
||||
SwfClipAsset.Sequence _curSequence = null;
|
||||
MaterialPropertyBlock _curPropBlock = null;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
@@ -312,9 +306,7 @@ namespace FTRuntime {
|
||||
void ClearCache(bool allow_to_create_components) {
|
||||
_meshFilter = SwfUtils.GetComponent<MeshFilter> (gameObject, allow_to_create_components);
|
||||
_meshRenderer = SwfUtils.GetComponent<MeshRenderer>(gameObject, allow_to_create_components);
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
_sortingGroup = SwfUtils.GetComponent<SortingGroup>(gameObject, allow_to_create_components);
|
||||
#endif
|
||||
_dirtyMesh = true;
|
||||
_curSequence = null;
|
||||
_curPropBlock = null;
|
||||
@@ -375,12 +367,10 @@ namespace FTRuntime {
|
||||
_meshRenderer.sortingOrder = sortingOrder;
|
||||
_meshRenderer.sortingLayerName = sortingLayer;
|
||||
}
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
if ( _sortingGroup ) {
|
||||
_sortingGroup.sortingOrder = sortingOrder;
|
||||
_sortingGroup.sortingLayerName = sortingLayer;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void UpdatePropBlock() {
|
||||
|
||||
Reference in New Issue
Block a user