add readme, license, and demo

This commit is contained in:
BlackMATov
2023-01-05 04:00:10 +07:00
parent c4a7f409c2
commit c13b440ada
33 changed files with 575 additions and 28 deletions

View File

@@ -0,0 +1,267 @@
## SwfClip
```csharp
// Occurs when clip changes
event Action<SwfClip> OnChangeClipEvent;
// Occurs when sequence changes
event Action<SwfClip> OnChangeSequenceEvent;
// Occurs when current frame changes
event Action<SwfClip> OnChangeCurrentFrameEvent;
```
```csharp
// Gets or sets the animation mesh renderer sorting layer
// [value] - The sorting layer
string sortingLayer { get; set; }
// Gets or sets the animation mesh renderer sorting order
// [value] - The sorting order
int sortingOrder { get; set; }
// Gets or sets the animation tint color
// [value] - The tint color
Color tint { get; set; }
// Gets or sets the animation asset (reset sequence and current frame)
// [value] - The animation asset
SwfClipAsset clip { get; set; }
// Gets or sets the animation sequence (reset current frame)
// [value] - The animation sequence
string sequence { get; set; }
// Gets or sets the animation current frame
// [value] - The animation current frame
int currentFrame { get; set; }
// Gets the current animation sequence frame count
// [value] - The frame count
int frameCount { get; }
// Gets the animation frame rate
// [value] - The frame rate
float frameRate { get; }
// Gets the current frame label count
// [value] - The frame label count
int currentLabelCount { get; }
```
```csharp
// Gets the current frame mesh bounding volume in local space (Since 1.3.8)
// [value] - The bounding volume in local space
Bounds currentLocalBounds { get; }
// Gets the current frame mesh bounding volume in world space (Since 1.3.8)
// [value] - The bounding volume in world space
Bounds currentWorldBounds { get; }
```
```csharp
// Rewind current sequence to begin frame
void ToBeginFrame();
// Rewind current sequence to end frame
void ToEndFrame();
// Rewind current sequence to previous frame
// [returns] - [true], if animation was rewound, [false] otherwise
bool ToPrevFrame();
// Rewind current sequence to next frame
// [returns] - [true], if animation was rewound, [false] otherwise
bool ToNextFrame();
// Gets the current frame label by index
// [returns] - The current frame label
// [index] - Current frame label index
string GetCurrentFrameLabel(int index);
```
## SwfClipController
```csharp
// Occurs when the controller stops played clip
event Action<SwfClipController> OnStopPlayingEvent;
// Occurs when the controller plays stopped clip
event Action<SwfClipController> OnPlayStoppedEvent;
// Occurs when the controller rewinds played clip
event Action<SwfClipController> OnRewindPlayingEvent;
```
```csharp
// Controller play modes
enum PlayModes {
// Forward play mode
Forward,
// Backward play mode
Backward
}
// Controller loop modes
enum LoopModes {
// Once loop mode
Once,
// Repeat loop mode
Loop
}
// Gets or sets a value indicating whether controller play after awake on scene
// [value] - [true] if auto play; otherwise, [false]
bool autoPlay { get; set; }
// Gets or sets a value indicating whether controller uses unscaled delta time
// [value] - [true] if uses unscaled delta time; otherwise, [false]
bool useUnscaledDt { get; set; }
// Gets or sets the controller rate scale
// [value] - The rate scale
float rateScale { get; set; }
// Gets or sets the controller group name
// [value] - The group name
string groupName { get; set; }
// Gets or sets the controller play mode
// [value] - The play mode
PlayModes playMode { get; set; }
// Gets or sets the controller loop mode
// [value] - The loop mode
LoopModes loopMode { get; set; }
// Gets the controller clip
// [value] - The clip
SwfClip clip { get; }
// Gets a value indicating whether controller is playing
// [value] - [true] if is playing; otherwise, [false]
bool isPlaying { get; }
// Gets a value indicating whether controller is stopped
// [value] - [true] if is stopped; otherwise, [false]
bool isStopped { get; }
```
```csharp
// Changes the animation frame with stops it
// [frame] - The new current frame
void GotoAndStop(int frame);
// Changes the animation sequence and frame with stops it
// [sequence] - The new sequence
// [frame] - The new current frame
void GotoAndStop(string sequence, int frame);
// Changes the animation frame with plays it
// [frame] - The new current frame
void GotoAndPlay(int frame);
// Changes the animation sequence and frame with plays it
// [sequence] - The new sequence
// [frame] - The new current frame
void GotoAndPlay(string sequence, int frame);
// Stop with specified rewind action
// [rewind] - If set to [true] rewind animation to begin frame
void Stop(bool rewind);
// Changes the animation sequence and stop controller with rewind
// [sequence] - The new sequence
void Stop(string sequence);
// Play with specified rewind action
// [rewind] - If set to [true] rewind animation to begin frame
void Play(bool rewind);
// Changes the animation sequence and play controller with rewind
// [sequence] - The new sequence
void Play(string sequence);
// Rewind animation to begin frame
void Rewind();
```
## SwfManager
```csharp
// Get cached manager instance from scene or create it (if allowed)
// [allow_create] - If set to [true] allow create
static SwfManager GetInstance(bool allow_create);
```
```csharp
// Get animation clip count on scene
// [value] - Clip count
int clipCount { get; }
// Get animation clip controller count on scene
// [value] - Clip controller count
int controllerCount { get; }
// Get or set a value indicating whether animation updates is paused
// [value] - [true] if is paused; otherwise, [false]
bool isPaused { get; set; }
// Get or set a value indicating whether animation updates is playing
// [value] - [true] if is playing; otherwise, [false]
bool isPlaying { get; set; }
// Get or set a value indicating whether animation updates uses unscaled delta time
// [value] - [true] if uses unscaled delta time; otherwise, [false]
bool useUnscaledDt { get; set; }
// Get or set the global animation rate scale
// [value] - Global rate scale
float rateScale { get; set; }
```
```csharp
// Pause animation updates
void Pause();
// Resume animation updates
void Resume();
// Pause the group of animations by name
// [group_name] - Group name
void PauseGroup(string group_name);
// Resume the group of animations by name
// [group_name] - Group name
void ResumeGroup(string group_name);
// Determines whether group of animations is paused
// [returns] - [true] if group is paused; otherwise, [false]
// [group_name] - Group name
bool IsGroupPaused(string group_name);
// Determines whether group of animations is playing
// [returns] - [true] if group is playing; otherwise, [false]
// [group_name] - Group name
bool IsGroupPlaying(string group_name);
// Set the group of animations use unscaled delta time
// [group_name] - Group name
// [yesno] - [true] if group will use unscaled delta time; otherwise, [false]
void SetGroupUseUnscaledDt(string group_name, bool yesno);
// Determines whether group of animations uses unscaled delta time
// [returns] - [true] if group uses unscaled delta time; otherwise, [false]
// [group_name] - Group name
bool IsGroupUseUnscaledDt(string group_name);
// Set the group of animations rate scale
// [group_name] - Group name
// [rate_scale] - Rate scale
void SetGroupRateScale(string group_name, float rate_scale);
// Get the group of animations rate scale
// [returns] - The group rate scale
// [group_name] - Group name
float GetGroupRateScale(string group_name);
```

View File

@@ -1,42 +1,42 @@
###### Version 1.3.18
### Version 1.3.18
* Fix frameCount working before Start
* Fix preview in Unity 2021
###### Version 1.3.17
### Version 1.3.17
* Fix 2019 warnings
* Force swf asset binary serialization
###### Version 1.3.16
### Version 1.3.16
* Minor promo fixes
###### Version 1.3.15
### Version 1.3.15
* Add optional bitmap trimming
* Fix preview leaks in the Editor mode
* Add warning notes about outdated assets
* Add log message about successfully converting
###### Version 1.3.14
### Version 1.3.14
* Fix 2018.3.2f1 compilation
###### Version 1.3.13
### Version 1.3.13
* Fix preview shutdown warning
###### Version 1.3.12
### Version 1.3.12
* Upgrade to minimal LTS version
* Fix anchor frame label detector
* More readable conversion warnings
###### Version 1.3.11
### Version 1.3.11
* Fix trial version in Unity 2017
* Fix warnings in Unity 2017
* Fix possible mesh leak after scene switch
###### Version 1.3.10
### Version 1.3.10
* Fix (conversion error: 'Error: scaleSelection: Argument number 1 is invalid.')
* Fix (Parsing swf error: Failed to read past end of stream)
* Fix rasterization error with vector graphics in buttons
###### Version 1.3.9
### 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
@@ -44,7 +44,7 @@
* Replace shader "if" instruction to "step"
* Replace mask shader "if + discard" instruction to "clip"
###### Version 1.3.8
### Version 1.3.8
* Fix shape groups in tweens problems
* Fix drawing object shape problems
* Fix locked elements problem
@@ -58,74 +58,74 @@
* Remove excess "if" instruction from shaders
* Remove excess animation reimports
###### Version 1.3.7
### Version 1.3.7
* Fix multiple import
* Fix single frame optimization
###### Version 1.3.6
### Version 1.3.6
* Fix for scale very small vector items
* Big vector item optimization
* More yield instructions and extensions
###### Version 1.3.5
### Version 1.3.5
* Fix sprite import problem
###### Version 1.3.4
### Version 1.3.4
* Fix CS6 export problem
* Fix unity postprocessor problems
###### Version 1.3.3
### Version 1.3.3
* Fix undefined unusedItems in CS6
###### Version 1.3.2
### Version 1.3.2
* Fix bug custom scale export with small items optimization
###### Version 1.3.1
### Version 1.3.1
* Fix some Unity 5.5 deprecated functions
###### Version 1.3.0
### Version 1.3.0
* ETC separated alpha support
* Export animations with custom scale (for retina)
* New small vector scaled items optimization
###### Version 1.2.0
### Version 1.2.0
* Add Yield instructions for wait in coroutines(SwfWaitPlayStopped, SwfWaitRewindPlaying, SwfWaitStopPlaying)
* Add unscaled delta time support(for separate animations, groups of animations or for all)
* Fix guide type flash layers
* Some fixes for reconvert asset problem
###### Version 1.1.1
### Version 1.1.1
* Add conversion error by shape tween in CS6
* Fix life after death (problem about destroying with big lag by frame event)
###### Version 1.1.0
### Version 1.1.0
* Sequence separator is anchor frame label (not common frame label)
* SwfClip access to frame labels (currentLabelCount, GetCurrentFrameLabel)
* SwfClip events (OnChangeClipEvent, OnChangeSequenceEvent, OnChangeCurrentFrameEvent)
###### Version 1.0.0
### Version 1.0.0
* Initial asset store version
* Sources to dll
* Palette bitmaps support
###### Version 0.5.0
### Version 0.5.0
* Flash optimizer twicks
* Blending modes (except Alpha and Erase)
###### Version 0.4.0
### Version 0.4.0
* Clip groups
* Fix move assets bug
* Tint color for clips
* Animation API improvements
###### Version 0.3.0
### Version 0.3.0
* Preview for animation assets and clips
* Animation API improvements
* Memory optimizations
###### Version 0.2.0
### Version 0.2.0
* Export optimizations
* Export clips with export names
###### Version 0.1.0
### Version 0.1.0
* Initial alpha version

View File

@@ -0,0 +1,29 @@
Open your flash animation in Adobe Flash (CS6 or above).
![](./Images/user-guide-1.png)
Click the right button on movie clip which you want to export besides main timeline and go to the Properties.
![](./Images/user-guide-3.png)
Choose "Export for ActionScript" and set name for clip in "Class" field.
![](./Images/user-guide-4.png)
You can add **anchor** frame labels to separate timeline to different named sequences.
![](./Images/user-guide-2.png)
Run export script (_FlashTools/FlashExport/FlashExport.jsfl_) for your flash animation. The script optimizes an animation, rasterizes vector graphics and export .swf file which is compatible with the toolset.
![](./Images/user-guide-5.png)
![](./Images/user-guide-6.png)
Move exported .swf file to your unity project (You may find this .swf file at _export folder next to .fla file).
![](./Images/user-guide-7.png)
.swf file will be automatically converted to unity asset with proper settings. Open them to change texture packing settings (by default it uses settings from _"FlashTools/Resources/SwfSettings"_).
![](./Images/user-guide-8.png)
Now you can select exported clip and add it to scene or create a prefab.
![](./Images/user-guide-9.png)
In instance properties you can change any settings like a sorting layer, play mode, current frame and etc.
![](./Images/user-guide-10.png)
Enjoy!

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB