mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-15 12:29:49 +07:00
controller wip
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<ProductVersion>10.0.20506</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<RootNamespace></RootNamespace>
|
||||
<ProjectGuid>{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}</ProjectGuid>
|
||||
<ProjectGuid>{7FF03E09-4B14-EFF9-4F08-36E102F327D3}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<AssemblyName>Assembly-CSharp-Editor</AssemblyName>
|
||||
@@ -19,7 +19,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>Temp\bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_6;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants>
|
||||
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_5;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>0169</NoWarn>
|
||||
@@ -47,7 +47,9 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfAnimationAssetEditor.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfAnimationAssetPostprocessor.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfAnimationControllerEditor.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfAnimationEditor.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfManagerEditor.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfPostprocessor.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfPropertyDrawers.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfTools\SwfContext.cs" />
|
||||
@@ -117,17 +119,32 @@
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/TreeEditor/Editor/UnityEditor.TreeEditor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip.Unity">
|
||||
<HintPath>/Users/matov/Projects/UnityFlash/Assets/FlashTools/Plugins/Ionic.Zip.Unity.dll</HintPath>
|
||||
<HintPath>/Users/matov/Programming/Projects/unityflash/Assets/FlashTools/Plugins/Ionic.Zip.Unity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.Graphs">
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.Android.Extensions">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.iOS.Extensions">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.AppleTV.Extensions">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.AppleTV.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.Tizen.Extensions">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/TizenPlayer/UnityEditor.Tizen.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.SamsungTV.Extensions">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/STVPlayer/UnityEditor.SamsungTV.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.WebGL.Extensions">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.LinuxStandalone.Extensions">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -135,6 +152,12 @@
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.iOS.Extensions.Xcode">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.iOS.Extensions.Common">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/AppleTVSupport/UnityEditor.iOS.Extensions.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.iOS.Extensions.Xcode">
|
||||
<HintPath>/Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.iOS.Extensions.Common">
|
||||
@@ -143,7 +166,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="Assembly-CSharp.csproj">
|
||||
<Project>{906D3FD6-5699-A169-2DA9-91E0C813728E}</Project> <Name>Assembly-CSharp</Name> </ProjectReference>
|
||||
<Project>{ED48043C-7BE9-40F3-EC3C-3D4369E54740}</Project> <Name>Assembly-CSharp</Name> </ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<ProductVersion>10.0.20506</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<RootNamespace></RootNamespace>
|
||||
<ProjectGuid>{906D3FD6-5699-A169-2DA9-91E0C813728E}</ProjectGuid>
|
||||
<ProjectGuid>{ED48043C-7BE9-40F3-EC3C-3D4369E54740}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<AssemblyName>Assembly-CSharp</AssemblyName>
|
||||
@@ -19,7 +19,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>Temp\bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_6;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants>
|
||||
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_3_5;UNITY_5_3;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_STANDALONE_OSX;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_LOG_MIXED_STACKTRACE;ENABLE_UNITYWEBREQUEST;ENABLE_CLUSTERINPUT;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>0169</NoWarn>
|
||||
@@ -47,8 +47,10 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\SwfConverterSettings.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\SwfPropertyAttributes.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\Internal\SwfSettings.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\SwfAnimation.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\SwfAnimationAsset.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\SwfAnimationController.cs" />
|
||||
<Compile Include="Assets\FlashTools\Scripts\SwfManager.cs" />
|
||||
<None Include="Assets\FlashTools\Resources\Shaders\SwfDecrMask.shader" />
|
||||
<None Include="Assets\FlashTools\Resources\Shaders\SwfSimple.shader" />
|
||||
@@ -61,7 +63,7 @@
|
||||
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip.Unity">
|
||||
<HintPath>/Users/matov/Projects/UnityFlash/Assets/FlashTools/Plugins/Ionic.Zip.Unity.dll</HintPath>
|
||||
<HintPath>/Users/matov/Programming/Projects/unityflash/Assets/FlashTools/Plugins/Ionic.Zip.Unity.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6da591d87f967451298a275621e1fd5d, type: 3}
|
||||
m_Name: SwfConverterSettings
|
||||
m_EditorClassIdentifier:
|
||||
DefaultSettings:
|
||||
MaxAtlasSize: 1024
|
||||
AtlasPadding: 1
|
||||
PixelsPerUnit: 100
|
||||
GenerateMipMaps: 1
|
||||
AtlasPowerOfTwo: 1
|
||||
AtlasForceSquare: 0
|
||||
AtlasTextureFilter: 1
|
||||
AtlasTextureFormat: 2
|
||||
SimpleMaterial: {fileID: 2100000, guid: e92fbe00d5b6d4a3aa9355a4b23f107d, type: 2}
|
||||
IncrMaskMaterial: {fileID: 2100000, guid: e62e8efca5cac42c9a323961b58d05d6, type: 2}
|
||||
DecrMaskMaterial: {fileID: 2100000, guid: d63a68532164d470d887fd2603e79ffa, type: 2}
|
||||
MaskedMaterials:
|
||||
- {fileID: 2100000, guid: 3902e0561ba6046079e975f4b8340dbd, type: 2}
|
||||
- {fileID: 2100000, guid: 362db403211244f70830b07296318936, type: 2}
|
||||
- {fileID: 2100000, guid: 43234b460d10f41088cbd327c045074b, type: 2}
|
||||
- {fileID: 2100000, guid: f9e8b8b157ffa4866812a11237c48758, type: 2}
|
||||
- {fileID: 2100000, guid: 04597a59523be4b939c0a5dfd05b973e, type: 2}
|
||||
- {fileID: 2100000, guid: 502586963b8c243d48808238fb1210ef, type: 2}
|
||||
- {fileID: 2100000, guid: dfbc0da8152b047b58270d40b138b36c, type: 2}
|
||||
- {fileID: 2100000, guid: efeaba40d10a4417eb27036131ba80b1, type: 2}
|
||||
- {fileID: 2100000, guid: 0f131b0532a4e4feaba67826153a42b7, type: 2}
|
||||
- {fileID: 2100000, guid: ccd8fc1b2c96543ff9dc43ed384704a2, type: 2}
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea1dd488b8903439b90ce209ff82574c
|
||||
timeCreated: 1472140695
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -4,7 +4,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace FlashTools.Internal {
|
||||
[CustomEditor(typeof(SwfAnimationAsset))]
|
||||
[CustomEditor(typeof(SwfAnimationAsset)), CanEditMultipleObjects]
|
||||
public class SwfAnimationAssetEditor : Editor {
|
||||
SwfAnimationAsset _asset = null;
|
||||
bool _settingsFoldout = false;
|
||||
@@ -64,7 +64,10 @@ namespace FlashTools.Internal {
|
||||
var anim_go = new GameObject(_asset.name);
|
||||
anim_go.AddComponent<MeshFilter>();
|
||||
anim_go.AddComponent<MeshRenderer>();
|
||||
anim_go.AddComponent<SwfAnimation>().InitWithAsset(_asset);
|
||||
anim_go.AddComponent<SwfAnimation>();
|
||||
anim_go.AddComponent<SwfAnimationController>();
|
||||
|
||||
anim_go.GetComponent<SwfAnimation>().InitWithAsset(_asset);
|
||||
return anim_go;
|
||||
}
|
||||
return null;
|
||||
@@ -91,7 +94,7 @@ namespace FlashTools.Internal {
|
||||
void CreateAnimationOnScene() {
|
||||
var anim_go = CreateAnimationGO();
|
||||
if ( anim_go ) {
|
||||
Undo.RegisterCreatedObjectUndo(anim_go, "Create SwfAnimation");
|
||||
Undo.RegisterCreatedObjectUndo(anim_go, "Instance SwfAnimation");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +119,7 @@ namespace FlashTools.Internal {
|
||||
}
|
||||
|
||||
void DrawGUISettings() {
|
||||
var last_gui_enabled = GUI.enabled;
|
||||
GUI.enabled = false;
|
||||
var script_prop = serializedObject.FindProperty("m_Script");
|
||||
if ( script_prop != null ) {
|
||||
@@ -125,11 +129,11 @@ namespace FlashTools.Internal {
|
||||
if ( atlas_prop != null ) {
|
||||
EditorGUILayout.PropertyField(atlas_prop, true);
|
||||
}
|
||||
var baked_frames_prop = serializedObject.FindProperty("BakedFrames");
|
||||
if ( baked_frames_prop != null && baked_frames_prop.isArray ) {
|
||||
EditorGUILayout.IntField("Frame count", baked_frames_prop.arraySize);
|
||||
var frames_prop = serializedObject.FindProperty("Frames");
|
||||
if ( frames_prop != null && frames_prop.isArray ) {
|
||||
EditorGUILayout.IntField("Frame count", frames_prop.arraySize);
|
||||
}
|
||||
GUI.enabled = true;
|
||||
GUI.enabled = last_gui_enabled;
|
||||
_settingsFoldout = EditorGUILayout.Foldout(_settingsFoldout, "Settings");
|
||||
if ( _settingsFoldout ) {
|
||||
var it = serializedObject.FindProperty("Overridden");
|
||||
@@ -165,10 +169,10 @@ namespace FlashTools.Internal {
|
||||
void DrawGUIAnimation() {
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
if ( GUILayout.Button("Create animation prefab") ) {
|
||||
if ( GUILayout.Button("Create prefab") ) {
|
||||
CreateAnimationPrefab();
|
||||
}
|
||||
if ( GUILayout.Button("Create animation on scene") ) {
|
||||
if ( GUILayout.Button("Instance to scene") ) {
|
||||
CreateAnimationOnScene();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace FlashTools.Internal {
|
||||
}
|
||||
|
||||
static void ConfigureBakedFrames(string asset_path, SwfAnimationAsset asset) {
|
||||
var baked_frames = new List<SwfAnimationAsset.BakedFrame>();
|
||||
var baked_frames = new List<SwfAnimationAsset.Frame>();
|
||||
if ( asset && asset.Atlas && asset.Data != null && asset.Data.Frames.Count > 0 ) {
|
||||
for ( var i = 0; i < asset.Data.Frames.Count; ++i ) {
|
||||
var frame = asset.Data.Frames[i];
|
||||
@@ -157,10 +157,10 @@ namespace FlashTools.Internal {
|
||||
baked_frames.Add(baked_frame);
|
||||
}
|
||||
}
|
||||
asset.BakedFrames = baked_frames;
|
||||
asset.Frames = baked_frames;
|
||||
}
|
||||
|
||||
static SwfAnimationAsset.BakedFrame BakeFrameFromAnimationFrame(SwfAnimationAsset asset, SwfAnimationFrameData frame) {
|
||||
static SwfAnimationAsset.Frame BakeFrameFromAnimationFrame(SwfAnimationAsset asset, SwfAnimationFrameData frame) {
|
||||
List<Vector2> _uvs = new List<Vector2>();
|
||||
List<Color> _mulcolors = new List<Color>();
|
||||
List<Vector4> _addcolors = new List<Vector4>();
|
||||
@@ -265,7 +265,7 @@ namespace FlashTools.Internal {
|
||||
|
||||
AssetDatabase.AddObjectToAsset(mesh, asset);
|
||||
|
||||
return new SwfAnimationAsset.BakedFrame{
|
||||
return new SwfAnimationAsset.Frame{
|
||||
Mesh = mesh,
|
||||
Materials = _materials.ToArray()};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace FlashTools.Internal {
|
||||
[CustomEditor(typeof(SwfAnimationController)), CanEditMultipleObjects]
|
||||
public class SwfAnimationControllerEditor : Editor {
|
||||
SwfAnimationController _controller = null;
|
||||
|
||||
void DrawAnimationControls() {
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
{
|
||||
if ( GUILayout.Button("Stop") ) {
|
||||
_controller.Stop();
|
||||
}
|
||||
if ( GUILayout.Button("Pause") ) {
|
||||
_controller.Pause();
|
||||
}
|
||||
if ( GUILayout.Button("Resume") ) {
|
||||
_controller.Resume();
|
||||
}
|
||||
if ( GUILayout.Button("Play") ) {
|
||||
_controller.Play();
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// Messages
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
void OnEnable() {
|
||||
_controller = target as SwfAnimationController;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
DrawDefaultInspector();
|
||||
if ( Application.isPlaying ) {
|
||||
DrawAnimationControls();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7973baab2bb7c4b2a8701d1abf799d4e
|
||||
timeCreated: 1472192166
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -3,17 +3,11 @@ using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlashTools.Internal {
|
||||
[CustomEditor(typeof(SwfAnimation))]
|
||||
[CustomEditor(typeof(SwfAnimation)), CanEditMultipleObjects]
|
||||
public class SwfAnimationEditor : Editor {
|
||||
SwfAnimation _animation = null;
|
||||
|
||||
void OnEnable() {
|
||||
_animation = target as SwfAnimation;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
DrawDefaultInspector();
|
||||
|
||||
void DrawCurrentFrame() {
|
||||
if ( _animation.Asset && _animation.frameCount > 1 ) {
|
||||
var new_current_frame = EditorGUILayout.IntSlider(
|
||||
"Frame", _animation.currentFrame,
|
||||
@@ -23,5 +17,20 @@ namespace FlashTools.Internal {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// Messages
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
void OnEnable() {
|
||||
_animation = target as SwfAnimation;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
DrawDefaultInspector();
|
||||
DrawCurrentFrame();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace FlashTools.Internal {
|
||||
[CustomEditor(typeof(SwfManager))]
|
||||
public class SwfManagerEditor : Editor {
|
||||
SwfManager _manager = null;
|
||||
|
||||
void DrawAnimationCount() {
|
||||
var last_gui_enabled = GUI.enabled;
|
||||
GUI.enabled = false;
|
||||
EditorGUILayout.IntField(
|
||||
"Animation count",
|
||||
_manager.AllAnimationCount);
|
||||
GUI.enabled = last_gui_enabled;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// Messages
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
void OnEnable() {
|
||||
_manager = target as SwfManager;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
DrawDefaultInspector();
|
||||
DrawAnimationCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a0802fa57f064e7590d56a471759ed9
|
||||
timeCreated: 1472188711
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -53,6 +53,22 @@ namespace FlashTools.Internal.SwfEditorTools {
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// SwfReadOnlyDrawer
|
||||
//
|
||||
|
||||
[CustomPropertyDrawer(typeof(SwfReadOnlyAttribute))]
|
||||
public class SwfReadOnlyDrawer : PropertyDrawer {
|
||||
public override void OnGUI(
|
||||
Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
var last_gui_enabled = GUI.enabled;
|
||||
GUI.enabled = false;
|
||||
EditorGUI.PropertyField(position, property, label, true);
|
||||
GUI.enabled = last_gui_enabled;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// SwfSortingLayerDrawer
|
||||
//
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace FlashTools.Internal {
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
void FillMaterialsCache() {
|
||||
SimpleMaterial = SafeLoadMaterial(SwfSimpleMatPath, true);
|
||||
SimpleMaterial = SafeLoadMaterial(SwfSimpleMatPath, true);
|
||||
IncrMaskMaterial = SafeLoadMaterial(SwfIncrMaskMatPath, true);
|
||||
DecrMaskMaterial = SafeLoadMaterial(SwfDecrMaskMatPath, true);
|
||||
MaskedMaterials = new List<Material>();
|
||||
@@ -58,6 +58,8 @@ namespace FlashTools.Internal {
|
||||
break;
|
||||
}
|
||||
}
|
||||
EditorUtility.SetDirty(this);
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
|
||||
Material SafeLoadMaterial(string path, bool exception) {
|
||||
@@ -67,6 +69,9 @@ namespace FlashTools.Internal {
|
||||
"SwfManager. Material not found: {0}",
|
||||
path));
|
||||
}
|
||||
if ( material ) {
|
||||
material.hideFlags = HideFlags.HideInInspector;
|
||||
}
|
||||
return material;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ namespace FlashTools.Internal {
|
||||
}
|
||||
}
|
||||
|
||||
public class SwfReadOnlyAttribute : PropertyAttribute {
|
||||
}
|
||||
|
||||
public class SwfSortingLayerAttribute : PropertyAttribute {
|
||||
}
|
||||
|
||||
@@ -26,10 +29,10 @@ namespace FlashTools.Internal {
|
||||
public int MinPow2;
|
||||
public int MaxPow2;
|
||||
public string BoolProp;
|
||||
public SwfPowerOfTwoIfAttribute(int min_pow2, int max_pow2, string prop) {
|
||||
public SwfPowerOfTwoIfAttribute(int min_pow2, int max_pow2, string bool_prop) {
|
||||
MinPow2 = min_pow2;
|
||||
MaxPow2 = max_pow2;
|
||||
BoolProp = prop;
|
||||
BoolProp = bool_prop;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,74 +3,70 @@ using System.Collections.Generic;
|
||||
using FlashTools.Internal;
|
||||
|
||||
namespace FlashTools {
|
||||
[ExecuteInEditMode]
|
||||
[ExecuteInEditMode, DisallowMultipleComponent]
|
||||
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
|
||||
public class SwfAnimation : MonoBehaviour {
|
||||
[SwfReadOnly]
|
||||
public SwfAnimationAsset Asset = null;
|
||||
[SwfSortingLayer]
|
||||
public string SortingLayer = "Default";
|
||||
public int SortingOrder = 0;
|
||||
|
||||
bool _inited = false;
|
||||
MaterialPropertyBlock _matPropBlock = null;
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
MeshFilter _meshFilter = null;
|
||||
MeshRenderer _meshRenderer = null;
|
||||
MaterialPropertyBlock _matPropBlock = null;
|
||||
|
||||
int _current_frame = 0;
|
||||
float _frame_timer = 0.0f;
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
int _currentFrame = 0;
|
||||
public int currentFrame {
|
||||
get { return _currentFrame; }
|
||||
set {
|
||||
_currentFrame = frameCount > 0
|
||||
? Mathf.Clamp(value, 0, frameCount - 1)
|
||||
: 0;
|
||||
UpdateCurrentMesh();
|
||||
}
|
||||
}
|
||||
|
||||
public int frameCount {
|
||||
get { return Asset ? Asset.Data.Frames.Count : 0; }
|
||||
get {
|
||||
return Asset ? Asset.Data.Frames.Count : 0;
|
||||
}
|
||||
}
|
||||
|
||||
public int currentFrame {
|
||||
get { return _current_frame; }
|
||||
set {
|
||||
_current_frame = Mathf.Clamp(value, 0, frameCount - 1);
|
||||
FixCurrentMesh();
|
||||
public float frameRate {
|
||||
get {
|
||||
return Asset ? Asset.Data.FrameRate : 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// Stuff
|
||||
// Private
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public void InitWithAsset(SwfAnimationAsset asset) {
|
||||
Asset = asset;
|
||||
if ( Asset && !_inited ) {
|
||||
_inited = true;
|
||||
_matPropBlock = new MaterialPropertyBlock();
|
||||
_matPropBlock.SetTexture("_MainTex", Asset.Atlas);
|
||||
}
|
||||
FixCurrentMesh();
|
||||
SwfAnimationAsset.Frame GetCurrentBakedFrame() {
|
||||
var frames = Asset ? Asset.Frames : null;
|
||||
return frames != null && frames.Count > 0
|
||||
? frames[Mathf.Clamp(currentFrame, 0, frames.Count)]
|
||||
: null;
|
||||
}
|
||||
|
||||
void UpdateFrameTimer() {
|
||||
if ( Asset ) {
|
||||
_frame_timer += Asset.Data.FrameRate * Time.deltaTime;
|
||||
while ( _frame_timer > 1.0f ) {
|
||||
_frame_timer -= 1.0f;
|
||||
++_current_frame;
|
||||
if ( _current_frame > frameCount - 1 ) {
|
||||
_current_frame = 0;
|
||||
}
|
||||
FixCurrentMesh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FixCurrentMesh() {
|
||||
if ( Asset && Asset.BakedFrames.Count > 0 ) {
|
||||
var frame = Asset.BakedFrames[Mathf.Clamp(currentFrame, 0, Asset.BakedFrames.Count)];
|
||||
_meshFilter.sharedMesh = frame.Mesh;
|
||||
_meshRenderer.sharedMaterials = frame.Materials;
|
||||
_meshRenderer.sortingOrder = SortingOrder;
|
||||
_meshRenderer.sortingLayerName = SortingLayer;
|
||||
_meshRenderer.SetPropertyBlock(_matPropBlock);
|
||||
}
|
||||
void UpdateCurrentMesh() {
|
||||
var baked_frame = GetCurrentBakedFrame();
|
||||
_meshFilter.sharedMesh = baked_frame != null ? baked_frame.Mesh : null;
|
||||
_meshRenderer.sharedMaterials = baked_frame != null ? baked_frame.Materials : new Material[0];
|
||||
_meshRenderer.sortingOrder = SortingOrder;
|
||||
_meshRenderer.sortingLayerName = SortingLayer;
|
||||
_meshRenderer.SetPropertyBlock(_matPropBlock);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
@@ -79,8 +75,17 @@ namespace FlashTools {
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
public void InternalUpdate() {
|
||||
UpdateFrameTimer();
|
||||
public void InitWithAsset(SwfAnimationAsset asset) {
|
||||
Asset = asset;
|
||||
if ( asset ) {
|
||||
_matPropBlock = new MaterialPropertyBlock();
|
||||
_matPropBlock.SetTexture("_MainTex", asset.Atlas);
|
||||
}
|
||||
var controller = GetComponent<SwfAnimationController>();
|
||||
if ( controller ) {
|
||||
controller.InitWithAsset();
|
||||
}
|
||||
UpdateCurrentMesh();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
@@ -71,23 +71,23 @@ namespace FlashTools {
|
||||
|
||||
public class SwfAnimationAsset : ScriptableObject {
|
||||
[System.Serializable]
|
||||
public class BakedFrame {
|
||||
public class Frame {
|
||||
public Mesh Mesh;
|
||||
public Material[] Materials;
|
||||
}
|
||||
public SwfAnimationData Data;
|
||||
public Texture2D Atlas;
|
||||
public List<BakedFrame> BakedFrames;
|
||||
public List<Frame> Frames;
|
||||
public SwfSettings Settings;
|
||||
public SwfSettings Overridden;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void Reset() {
|
||||
Data = new SwfAnimationData();
|
||||
Atlas = null;
|
||||
BakedFrames = new List<BakedFrame>();
|
||||
Settings = SwfConverterSettings.GetDefaultSettings();
|
||||
Overridden = SwfConverterSettings.GetDefaultSettings();
|
||||
Data = new SwfAnimationData();
|
||||
Atlas = null;
|
||||
Frames = new List<Frame>();
|
||||
Settings = SwfConverterSettings.GetDefaultSettings();
|
||||
Overridden = SwfConverterSettings.GetDefaultSettings();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
146
Assets/FlashTools/Scripts/SwfAnimationController.cs
Normal file
146
Assets/FlashTools/Scripts/SwfAnimationController.cs
Normal file
@@ -0,0 +1,146 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlashTools {
|
||||
[ExecuteInEditMode, DisallowMultipleComponent]
|
||||
[RequireComponent(typeof(SwfAnimation))]
|
||||
public class SwfAnimationController : MonoBehaviour {
|
||||
public enum LoopModes {
|
||||
Once,
|
||||
Loop
|
||||
}
|
||||
|
||||
public enum States {
|
||||
Stopped,
|
||||
Paused,
|
||||
Playing
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
public bool AutoPlay = false;
|
||||
public LoopModes LoopMode = LoopModes.Once;
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
SwfAnimation _animation = null;
|
||||
float _frameTimer = 0.0f;
|
||||
States _currentState = States.Stopped;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Internal
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
public void InitWithAsset() {
|
||||
_animation = GetComponent<SwfAnimation>();
|
||||
if ( AutoPlay ) {
|
||||
Play();
|
||||
}
|
||||
}
|
||||
|
||||
public void InternalUpdate(float dt) {
|
||||
if ( !_animation ) {
|
||||
return;
|
||||
}
|
||||
if ( currentState == States.Playing ) {
|
||||
var frame_rate = _animation.frameRate;
|
||||
var frame_count = _animation.frameCount;
|
||||
var current_frame = _animation.currentFrame;
|
||||
_frameTimer += frame_rate * dt;
|
||||
if ( _frameTimer > 1.0f ) {
|
||||
while ( _frameTimer > 1.0f ) {
|
||||
_frameTimer -= 1.0f;
|
||||
++current_frame;
|
||||
if ( current_frame > frame_count - 1 ) {
|
||||
switch ( LoopMode ) {
|
||||
case LoopModes.Once:
|
||||
current_frame = frame_count > 0 ? frame_count - 1 : 0;
|
||||
_currentState = States.Stopped;
|
||||
break;
|
||||
case LoopModes.Loop:
|
||||
current_frame = 0;
|
||||
break;
|
||||
default:
|
||||
throw new UnityException(string.Format(
|
||||
"SwfAnimationController. Incorrect loop mode: {0}",
|
||||
LoopMode));
|
||||
}
|
||||
}
|
||||
}
|
||||
_animation.currentFrame = current_frame;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Functions
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
public void Stop() {
|
||||
_frameTimer = 0.0f;
|
||||
_animation.currentFrame = 0;
|
||||
_currentState = States.Stopped;
|
||||
}
|
||||
|
||||
public void Pause() {
|
||||
if ( currentState == States.Playing ) {
|
||||
_currentState = States.Paused;
|
||||
}
|
||||
}
|
||||
|
||||
public void Resume() {
|
||||
if ( currentState == States.Paused ) {
|
||||
_currentState = States.Playing;
|
||||
}
|
||||
}
|
||||
|
||||
public void Play() {
|
||||
_frameTimer = 0.0f;
|
||||
_animation.currentFrame = 0;
|
||||
_currentState = States.Playing;
|
||||
}
|
||||
|
||||
public bool isStopped {
|
||||
get { return currentState == States.Stopped; }
|
||||
}
|
||||
|
||||
public bool isPaused {
|
||||
get { return currentState == States.Paused; }
|
||||
}
|
||||
|
||||
public bool isPlaying {
|
||||
get { return currentState == States.Playing; }
|
||||
}
|
||||
|
||||
public States currentState {
|
||||
get { return _currentState; }
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Messages
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
void OnEnable() {
|
||||
var swf_manager = SwfManager.GetInstance(true);
|
||||
if ( swf_manager ) {
|
||||
swf_manager.AddSwfAnimationController(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable() {
|
||||
var swf_manager = SwfManager.GetInstance(false);
|
||||
if ( swf_manager ) {
|
||||
swf_manager.RemoveSwfAnimationController(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/FlashTools/Scripts/SwfAnimationController.cs.meta
Normal file
12
Assets/FlashTools/Scripts/SwfAnimationController.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aedb1b4cb4ec34540952f7e8624fea8e
|
||||
timeCreated: 1472188170
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +1,12 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace FlashTools {
|
||||
[ExecuteInEditMode]
|
||||
[ExecuteInEditMode, DisallowMultipleComponent]
|
||||
public class SwfManager : MonoBehaviour {
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
@@ -10,7 +14,8 @@ namespace FlashTools {
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
HashSet<SwfAnimation> _animations = new HashSet<SwfAnimation>();
|
||||
HashSet<SwfAnimation> _animations = new HashSet<SwfAnimation>();
|
||||
HashSet<SwfAnimationController> _controllers = new HashSet<SwfAnimationController>();
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
@@ -36,6 +41,10 @@ namespace FlashTools {
|
||||
//
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
public int AllAnimationCount {
|
||||
get { return _animations.Count; }
|
||||
}
|
||||
|
||||
public void AddSwfAnimation(SwfAnimation animation) {
|
||||
_animations.Add(animation);
|
||||
}
|
||||
@@ -44,6 +53,18 @@ namespace FlashTools {
|
||||
_animations.Remove(animation);
|
||||
}
|
||||
|
||||
public int AllAnimationControllerCount {
|
||||
get { return _controllers.Count; }
|
||||
}
|
||||
|
||||
public void AddSwfAnimationController(SwfAnimationController controller) {
|
||||
_controllers.Add(controller);
|
||||
}
|
||||
|
||||
public void RemoveSwfAnimationController(SwfAnimationController controller) {
|
||||
_controllers.Remove(controller);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
//
|
||||
// Private
|
||||
@@ -60,14 +81,29 @@ namespace FlashTools {
|
||||
}
|
||||
}
|
||||
|
||||
void GrabEnabledControllers() {
|
||||
var all_controllers = FindObjectsOfType<SwfAnimationController>();
|
||||
for ( int i = 0, e = all_controllers.Length; i < e; ++i ) {
|
||||
var controller = all_controllers[i];
|
||||
if ( controller.enabled ) {
|
||||
_controllers.Add(controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DropAnimations() {
|
||||
_animations.Clear();
|
||||
}
|
||||
|
||||
void UpdateAnimations() {
|
||||
var iter = _animations.GetEnumerator();
|
||||
void DropControllers() {
|
||||
_controllers.Clear();
|
||||
}
|
||||
|
||||
void UpdateControllers() {
|
||||
var dt = Time.deltaTime;
|
||||
var iter = _controllers.GetEnumerator();
|
||||
while ( iter.MoveNext() ) {
|
||||
iter.Current.InternalUpdate();
|
||||
iter.Current.InternalUpdate(dt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,14 +115,16 @@ namespace FlashTools {
|
||||
|
||||
void OnEnable() {
|
||||
GrabEnabledAnimations();
|
||||
GrabEnabledControllers();
|
||||
}
|
||||
|
||||
void OnDisable() {
|
||||
DropAnimations();
|
||||
DropControllers();
|
||||
}
|
||||
|
||||
void Update() {
|
||||
UpdateAnimations();
|
||||
UpdateControllers();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,14 +64,12 @@ PlayerSettings:
|
||||
xboxEnableHeadOrientation: 0
|
||||
xboxEnableGuest: 0
|
||||
xboxEnablePIXSampling: 0
|
||||
xboxEnableEnableRenderThreadRunsJobs: 0
|
||||
n3dsDisableStereoscopicView: 0
|
||||
n3dsEnableSharedListOpt: 1
|
||||
n3dsEnableVSync: 0
|
||||
uiUse16BitDepthBuffer: 0
|
||||
ignoreAlphaClear: 0
|
||||
xboxOneResolution: 0
|
||||
xboxOneMonoLoggingLevel: 0
|
||||
ps3SplashScreen: {fileID: 0}
|
||||
videoMemoryForVertexBuffers: 0
|
||||
psp2PowerMode: 0
|
||||
@@ -260,7 +258,6 @@ PlayerSettings:
|
||||
ps4NPtitleDatPath:
|
||||
ps4RemotePlayKeyAssignment: -1
|
||||
ps4RemotePlayKeyMappingDir:
|
||||
ps4PlayTogetherPlayerCount: 0
|
||||
ps4EnterButtonAssignment: 1
|
||||
ps4ApplicationParam1: 0
|
||||
ps4ApplicationParam2: 0
|
||||
@@ -287,8 +284,6 @@ PlayerSettings:
|
||||
ps4attribMoveSupport: 0
|
||||
ps4attrib3DSupport: 0
|
||||
ps4attribShareSupport: 0
|
||||
ps4attribExclusiveVR: 0
|
||||
ps4disableAutoHideSplash: 0
|
||||
ps4IncludedModules: []
|
||||
monoEnv:
|
||||
psp2Splashimage: {fileID: 0}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
m_EditorVersion: 5.3.6f1
|
||||
m_EditorVersion: 5.3.5f1
|
||||
m_StandardAssetsVersion: 0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2008
|
||||
|
||||
Project("{9B8160E9-8D55-B2EC-285E-1DC603FB178E}") = "UnityFlash", "Assembly-CSharp.csproj", "{906D3FD6-5699-A169-2DA9-91E0C813728E}"
|
||||
Project("{D58E310B-CC7A-56FA-675C-024D435EF77E}") = "unityflash", "Assembly-CSharp.csproj", "{ED48043C-7BE9-40F3-EC3C-3D4369E54740}"
|
||||
EndProject
|
||||
Project("{9B8160E9-8D55-B2EC-285E-1DC603FB178E}") = "UnityFlash", "Assembly-CSharp-Editor.csproj", "{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}"
|
||||
Project("{D58E310B-CC7A-56FA-675C-024D435EF77E}") = "unityflash", "Assembly-CSharp-Editor.csproj", "{7FF03E09-4B14-EFF9-4F08-36E102F327D3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -11,14 +11,14 @@ Global
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{906D3FD6-5699-A169-2DA9-91E0C813728E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{906D3FD6-5699-A169-2DA9-91E0C813728E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{906D3FD6-5699-A169-2DA9-91E0C813728E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{906D3FD6-5699-A169-2DA9-91E0C813728E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<Properties StartupItem="Assembly-CSharp.csproj">
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/FlashTools/Scripts/Internal/Editor/SwfPropertyDrawers.cs">
|
||||
<MonoDevelop.Ide.Workbench>
|
||||
<Files>
|
||||
<File FileName="Assets/FlashTools/Scripts/Internal/SwfConverterSettings.cs" Line="24" Column="27" />
|
||||
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/SwfPropertyDrawers.cs" Line="128" Column="42" />
|
||||
<File FileName="Assets/FlashTools/Scripts/Internal/SwfPropertyAttributes.cs" Line="17" Column="2" NotebookId="1" />
|
||||
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/SwfAnimationControllerEditor.cs" Line="1" Column="1" />
|
||||
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/SwfAnimationAssetEditor.cs" Line="1" Column="1" />
|
||||
</Files>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
|
||||
Reference in New Issue
Block a user