mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-16 14:11:19 +07:00
Add SwfClip bounds functions (currentLocalBounds, currentWorldBounds)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
* Fix optimizator bitmap trim problems
|
||||
* Fix Unity 5.6 submesh sorting bug
|
||||
* Add shape tween warning
|
||||
* Add SwfClip bounds functions (currentLocalBounds, currentWorldBounds)
|
||||
* Remove excess "if" instruction from shaders
|
||||
|
||||
###### Version 1.3.7
|
||||
|
||||
@@ -190,6 +190,34 @@ namespace FTRuntime {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current frame mesh bounding volume in local space
|
||||
/// (Since 1.3.8)
|
||||
/// </summary>
|
||||
/// <value>The bounding volume in local space</value>
|
||||
public Bounds currentLocalBounds {
|
||||
get {
|
||||
var frame = GetCurrentBakedFrame();
|
||||
return frame != null
|
||||
? frame.CachedMesh.bounds
|
||||
: new Bounds();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current frame mesh bounding volume in world space
|
||||
/// (Since 1.3.8)
|
||||
/// </summary>
|
||||
/// <value>The bounding volume in world space</value>
|
||||
public Bounds currentWorldBounds {
|
||||
get {
|
||||
Internal_UpdateMesh();
|
||||
return _meshRenderer
|
||||
? _meshRenderer.bounds
|
||||
: new Bounds();
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Functions
|
||||
@@ -255,7 +283,7 @@ namespace FTRuntime {
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
internal void Internal_LateUpdate() {
|
||||
internal void Internal_UpdateMesh() {
|
||||
if ( _meshFilter && _meshRenderer && _dirtyMesh ) {
|
||||
var baked_frame = GetCurrentBakedFrame();
|
||||
if ( baked_frame != null ) {
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace FTRuntime {
|
||||
for ( int i = 0, e = _clips.Count; i < e; ++i ) {
|
||||
var clip = _clips[i];
|
||||
if ( clip ) {
|
||||
clip.Internal_LateUpdate();
|
||||
clip.Internal_UpdateMesh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user