diff --git a/Assets/FlashTools/Docs/CHANGELOG.md b/Assets/FlashTools/Docs/CHANGELOG.md index 3f03516..2e1086b 100644 --- a/Assets/FlashTools/Docs/CHANGELOG.md +++ b/Assets/FlashTools/Docs/CHANGELOG.md @@ -1,6 +1,7 @@ ###### Version 1.3.9 * Not save generated meshes in scene * Fix (At line 908 of file "FTMain.jsfl": ReferenceError: ft is not defined) +* Fix warning on add missing components ###### Version 1.3.8 * Fix shape groups in tweens problems diff --git a/Assets/FlashTools/Scripts/FTRuntime/Internal/SwfUtils.cs b/Assets/FlashTools/Scripts/FTRuntime/Internal/SwfUtils.cs index 5d343d2..b567899 100644 --- a/Assets/FlashTools/Scripts/FTRuntime/Internal/SwfUtils.cs +++ b/Assets/FlashTools/Scripts/FTRuntime/Internal/SwfUtils.cs @@ -27,11 +27,12 @@ namespace FTRuntime.Internal { // // - public static T GetOrCreateComponent(GameObject obj) where T : Component { + public static T GetComponent(GameObject obj, bool allow_create) where T : Component { var comp = obj.GetComponent(); - return comp != null - ? comp - : obj.AddComponent(); + if ( allow_create && !comp ) { + comp = obj.AddComponent(); + } + return comp; } // diff --git a/Assets/FlashTools/Scripts/FTRuntime/SwfClip.cs b/Assets/FlashTools/Scripts/FTRuntime/SwfClip.cs index 07d3d50..a9b1961 100644 --- a/Assets/FlashTools/Scripts/FTRuntime/SwfClip.cs +++ b/Assets/FlashTools/Scripts/FTRuntime/SwfClip.cs @@ -301,7 +301,7 @@ namespace FTRuntime { /// Update all animation properties (for internal use only) /// public void Internal_UpdateAllProperties() { - ClearCache(); + ClearCache(false); ChangeTint(); ChangeClip(); ChangeSequence(); @@ -309,11 +309,11 @@ namespace FTRuntime { ChangeSortingProperties(); } - void ClearCache() { - _meshFilter = SwfUtils.GetOrCreateComponent(gameObject); - _meshRenderer = SwfUtils.GetOrCreateComponent(gameObject); + void ClearCache(bool allow_to_create_components) { + _meshFilter = SwfUtils.GetComponent (gameObject, allow_to_create_components); + _meshRenderer = SwfUtils.GetComponent(gameObject, allow_to_create_components); #if UNITY_5_6_OR_NEWER - _sortingGroup = SwfUtils.GetOrCreateComponent(gameObject); + _sortingGroup = SwfUtils.GetComponent(gameObject, allow_to_create_components); #endif _dirtyMesh = true; _curSequence = null; @@ -432,11 +432,9 @@ namespace FTRuntime { // // --------------------------------------------------------------------- - void Awake() { - Internal_UpdateAllProperties(); - } - void Start() { + ClearCache(true); + Internal_UpdateAllProperties(); EmitChangeEvents(true, true, true); } diff --git a/ProjectStuff/FlashTools.org b/ProjectStuff/FlashTools.org index b064980..174608e 100644 --- a/ProjectStuff/FlashTools.org +++ b/ProjectStuff/FlashTools.org @@ -68,7 +68,7 @@ https://web.archive.org/web/20161214092913/http://http.developer.nvidia.com:80/C **** TODO graphics_scale не влияет на растр **** TODO Оптимизации по скейлу не влияют на растр **** TODO Не работает конвертация в batchmod'е -**** TODO Ворнинг при авто-добавлении SortingGroup +**** DONE Ворнинг при авто-добавлении SortingGroup **** TODO Площадь для оптимизации вычисляется некорректно при повёрнутых клипах **** TODO Возможно проблемы с DX9 UNITY_UV_STARTS_AT_TOP