controller wip

This commit is contained in:
2016-08-26 23:02:18 +07:00
parent 4d0a94dc4d
commit 9575d1eb91
23 changed files with 469 additions and 153 deletions

View File

@@ -6,7 +6,7 @@
<ProductVersion>10.0.20506</ProductVersion> <ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<RootNamespace></RootNamespace> <RootNamespace></RootNamespace>
<ProjectGuid>{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}</ProjectGuid> <ProjectGuid>{7FF03E09-4B14-EFF9-4F08-36E102F327D3}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>Assembly-CSharp-Editor</AssemblyName> <AssemblyName>Assembly-CSharp-Editor</AssemblyName>
@@ -19,7 +19,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath> <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> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn> <NoWarn>0169</NoWarn>
@@ -47,7 +47,9 @@
<ItemGroup> <ItemGroup>
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfAnimationAssetEditor.cs" /> <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\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\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\SwfPostprocessor.cs" />
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfPropertyDrawers.cs" /> <Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfPropertyDrawers.cs" />
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfTools\SwfContext.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> <HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/TreeEditor/Editor/UnityEditor.TreeEditor.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ionic.Zip.Unity"> <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>
<Reference Include="UnityEditor.Graphs"> <Reference Include="UnityEditor.Graphs">
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll</HintPath> <HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.Graphs.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.Android.Extensions">
<HintPath>/Applications/Unity/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.iOS.Extensions"> <Reference Include="UnityEditor.iOS.Extensions">
<HintPath>/Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll</HintPath> <HintPath>/Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.dll</HintPath>
</Reference> </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"> <Reference Include="UnityEditor.WebGL.Extensions">
<HintPath>/Applications/Unity/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll</HintPath> <HintPath>/Applications/Unity/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.LinuxStandalone.Extensions">
<HintPath>/Applications/Unity/PlaybackEngines/LinuxStandaloneSupport/UnityEditor.LinuxStandalone.Extensions.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.WindowsStandalone.Extensions"> <Reference Include="UnityEditor.WindowsStandalone.Extensions">
<HintPath>/Applications/Unity/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath> <HintPath>/Applications/Unity/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
</Reference> </Reference>
@@ -135,6 +152,12 @@
<HintPath>/Applications/Unity/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll</HintPath> <HintPath>/Applications/Unity/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode"> <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> <HintPath>/Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.iOS.Extensions.Common"> <Reference Include="UnityEditor.iOS.Extensions.Common">
@@ -143,7 +166,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="Assembly-CSharp.csproj"> <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> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -6,7 +6,7 @@
<ProductVersion>10.0.20506</ProductVersion> <ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<RootNamespace></RootNamespace> <RootNamespace></RootNamespace>
<ProjectGuid>{906D3FD6-5699-A169-2DA9-91E0C813728E}</ProjectGuid> <ProjectGuid>{ED48043C-7BE9-40F3-EC3C-3D4369E54740}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>Assembly-CSharp</AssemblyName> <AssemblyName>Assembly-CSharp</AssemblyName>
@@ -19,7 +19,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath> <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> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn> <NoWarn>0169</NoWarn>
@@ -47,8 +47,10 @@
<ItemGroup> <ItemGroup>
<Compile Include="Assets\FlashTools\Scripts\Internal\SwfConverterSettings.cs" /> <Compile Include="Assets\FlashTools\Scripts\Internal\SwfConverterSettings.cs" />
<Compile Include="Assets\FlashTools\Scripts\Internal\SwfPropertyAttributes.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\SwfAnimation.cs" />
<Compile Include="Assets\FlashTools\Scripts\SwfAnimationAsset.cs" /> <Compile Include="Assets\FlashTools\Scripts\SwfAnimationAsset.cs" />
<Compile Include="Assets\FlashTools\Scripts\SwfAnimationController.cs" />
<Compile Include="Assets\FlashTools\Scripts\SwfManager.cs" /> <Compile Include="Assets\FlashTools\Scripts\SwfManager.cs" />
<None Include="Assets\FlashTools\Resources\Shaders\SwfDecrMask.shader" /> <None Include="Assets\FlashTools\Resources\Shaders\SwfDecrMask.shader" />
<None Include="Assets\FlashTools\Resources\Shaders\SwfSimple.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> <HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ionic.Zip.Unity"> <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>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@@ -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}

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ea1dd488b8903439b90ce209ff82574c
timeCreated: 1472140695
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -4,7 +4,7 @@ using System.IO;
using System.Linq; using System.Linq;
namespace FlashTools.Internal { namespace FlashTools.Internal {
[CustomEditor(typeof(SwfAnimationAsset))] [CustomEditor(typeof(SwfAnimationAsset)), CanEditMultipleObjects]
public class SwfAnimationAssetEditor : Editor { public class SwfAnimationAssetEditor : Editor {
SwfAnimationAsset _asset = null; SwfAnimationAsset _asset = null;
bool _settingsFoldout = false; bool _settingsFoldout = false;
@@ -64,7 +64,10 @@ namespace FlashTools.Internal {
var anim_go = new GameObject(_asset.name); var anim_go = new GameObject(_asset.name);
anim_go.AddComponent<MeshFilter>(); anim_go.AddComponent<MeshFilter>();
anim_go.AddComponent<MeshRenderer>(); 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 anim_go;
} }
return null; return null;
@@ -91,7 +94,7 @@ namespace FlashTools.Internal {
void CreateAnimationOnScene() { void CreateAnimationOnScene() {
var anim_go = CreateAnimationGO(); var anim_go = CreateAnimationGO();
if ( anim_go ) { if ( anim_go ) {
Undo.RegisterCreatedObjectUndo(anim_go, "Create SwfAnimation"); Undo.RegisterCreatedObjectUndo(anim_go, "Instance SwfAnimation");
} }
} }
@@ -116,6 +119,7 @@ namespace FlashTools.Internal {
} }
void DrawGUISettings() { void DrawGUISettings() {
var last_gui_enabled = GUI.enabled;
GUI.enabled = false; GUI.enabled = false;
var script_prop = serializedObject.FindProperty("m_Script"); var script_prop = serializedObject.FindProperty("m_Script");
if ( script_prop != null ) { if ( script_prop != null ) {
@@ -125,11 +129,11 @@ namespace FlashTools.Internal {
if ( atlas_prop != null ) { if ( atlas_prop != null ) {
EditorGUILayout.PropertyField(atlas_prop, true); EditorGUILayout.PropertyField(atlas_prop, true);
} }
var baked_frames_prop = serializedObject.FindProperty("BakedFrames"); var frames_prop = serializedObject.FindProperty("Frames");
if ( baked_frames_prop != null && baked_frames_prop.isArray ) { if ( frames_prop != null && frames_prop.isArray ) {
EditorGUILayout.IntField("Frame count", baked_frames_prop.arraySize); EditorGUILayout.IntField("Frame count", frames_prop.arraySize);
} }
GUI.enabled = true; GUI.enabled = last_gui_enabled;
_settingsFoldout = EditorGUILayout.Foldout(_settingsFoldout, "Settings"); _settingsFoldout = EditorGUILayout.Foldout(_settingsFoldout, "Settings");
if ( _settingsFoldout ) { if ( _settingsFoldout ) {
var it = serializedObject.FindProperty("Overridden"); var it = serializedObject.FindProperty("Overridden");
@@ -165,10 +169,10 @@ namespace FlashTools.Internal {
void DrawGUIAnimation() { void DrawGUIAnimation() {
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
{ {
if ( GUILayout.Button("Create animation prefab") ) { if ( GUILayout.Button("Create prefab") ) {
CreateAnimationPrefab(); CreateAnimationPrefab();
} }
if ( GUILayout.Button("Create animation on scene") ) { if ( GUILayout.Button("Instance to scene") ) {
CreateAnimationOnScene(); CreateAnimationOnScene();
} }
} }

View File

@@ -149,7 +149,7 @@ namespace FlashTools.Internal {
} }
static void ConfigureBakedFrames(string asset_path, SwfAnimationAsset asset) { 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 ) { if ( asset && asset.Atlas && asset.Data != null && asset.Data.Frames.Count > 0 ) {
for ( var i = 0; i < asset.Data.Frames.Count; ++i ) { for ( var i = 0; i < asset.Data.Frames.Count; ++i ) {
var frame = asset.Data.Frames[i]; var frame = asset.Data.Frames[i];
@@ -157,10 +157,10 @@ namespace FlashTools.Internal {
baked_frames.Add(baked_frame); 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<Vector2> _uvs = new List<Vector2>();
List<Color> _mulcolors = new List<Color>(); List<Color> _mulcolors = new List<Color>();
List<Vector4> _addcolors = new List<Vector4>(); List<Vector4> _addcolors = new List<Vector4>();
@@ -265,7 +265,7 @@ namespace FlashTools.Internal {
AssetDatabase.AddObjectToAsset(mesh, asset); AssetDatabase.AddObjectToAsset(mesh, asset);
return new SwfAnimationAsset.BakedFrame{ return new SwfAnimationAsset.Frame{
Mesh = mesh, Mesh = mesh,
Materials = _materials.ToArray()}; Materials = _materials.ToArray()};
} }

View File

@@ -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();
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 7973baab2bb7c4b2a8701d1abf799d4e
timeCreated: 1472192166
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -3,17 +3,11 @@ using UnityEditor;
using System.Collections.Generic; using System.Collections.Generic;
namespace FlashTools.Internal { namespace FlashTools.Internal {
[CustomEditor(typeof(SwfAnimation))] [CustomEditor(typeof(SwfAnimation)), CanEditMultipleObjects]
public class SwfAnimationEditor : Editor { public class SwfAnimationEditor : Editor {
SwfAnimation _animation = null; SwfAnimation _animation = null;
void OnEnable() { void DrawCurrentFrame() {
_animation = target as SwfAnimation;
}
public override void OnInspectorGUI() {
DrawDefaultInspector();
if ( _animation.Asset && _animation.frameCount > 1 ) { if ( _animation.Asset && _animation.frameCount > 1 ) {
var new_current_frame = EditorGUILayout.IntSlider( var new_current_frame = EditorGUILayout.IntSlider(
"Frame", _animation.currentFrame, "Frame", _animation.currentFrame,
@@ -23,5 +17,20 @@ namespace FlashTools.Internal {
} }
} }
} }
// ------------------------------------------------------------------------
//
// Messages
//
// ------------------------------------------------------------------------
void OnEnable() {
_animation = target as SwfAnimation;
}
public override void OnInspectorGUI() {
DrawDefaultInspector();
DrawCurrentFrame();
}
} }
} }

View File

@@ -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();
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9a0802fa57f064e7590d56a471759ed9
timeCreated: 1472188711
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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 // SwfSortingLayerDrawer
// //

View File

@@ -46,7 +46,7 @@ namespace FlashTools.Internal {
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
void FillMaterialsCache() { void FillMaterialsCache() {
SimpleMaterial = SafeLoadMaterial(SwfSimpleMatPath, true); SimpleMaterial = SafeLoadMaterial(SwfSimpleMatPath, true);
IncrMaskMaterial = SafeLoadMaterial(SwfIncrMaskMatPath, true); IncrMaskMaterial = SafeLoadMaterial(SwfIncrMaskMatPath, true);
DecrMaskMaterial = SafeLoadMaterial(SwfDecrMaskMatPath, true); DecrMaskMaterial = SafeLoadMaterial(SwfDecrMaskMatPath, true);
MaskedMaterials = new List<Material>(); MaskedMaterials = new List<Material>();
@@ -58,6 +58,8 @@ namespace FlashTools.Internal {
break; break;
} }
} }
EditorUtility.SetDirty(this);
AssetDatabase.SaveAssets();
} }
Material SafeLoadMaterial(string path, bool exception) { Material SafeLoadMaterial(string path, bool exception) {
@@ -67,6 +69,9 @@ namespace FlashTools.Internal {
"SwfManager. Material not found: {0}", "SwfManager. Material not found: {0}",
path)); path));
} }
if ( material ) {
material.hideFlags = HideFlags.HideInInspector;
}
return material; return material;
} }

View File

@@ -19,6 +19,9 @@ namespace FlashTools.Internal {
} }
} }
public class SwfReadOnlyAttribute : PropertyAttribute {
}
public class SwfSortingLayerAttribute : PropertyAttribute { public class SwfSortingLayerAttribute : PropertyAttribute {
} }
@@ -26,10 +29,10 @@ namespace FlashTools.Internal {
public int MinPow2; public int MinPow2;
public int MaxPow2; public int MaxPow2;
public string BoolProp; 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; MinPow2 = min_pow2;
MaxPow2 = max_pow2; MaxPow2 = max_pow2;
BoolProp = prop; BoolProp = bool_prop;
} }
} }
} }

View File

@@ -3,74 +3,70 @@ using System.Collections.Generic;
using FlashTools.Internal; using FlashTools.Internal;
namespace FlashTools { namespace FlashTools {
[ExecuteInEditMode] [ExecuteInEditMode, DisallowMultipleComponent]
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))] [RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
public class SwfAnimation : MonoBehaviour { public class SwfAnimation : MonoBehaviour {
[SwfReadOnly]
public SwfAnimationAsset Asset = null; public SwfAnimationAsset Asset = null;
[SwfSortingLayer] [SwfSortingLayer]
public string SortingLayer = "Default"; public string SortingLayer = "Default";
public int SortingOrder = 0; public int SortingOrder = 0;
bool _inited = false; //
MaterialPropertyBlock _matPropBlock = null; //
//
MeshFilter _meshFilter = null; MeshFilter _meshFilter = null;
MeshRenderer _meshRenderer = 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 { public int frameCount {
get { return Asset ? Asset.Data.Frames.Count : 0; } get {
return Asset ? Asset.Data.Frames.Count : 0;
}
} }
public int currentFrame { public float frameRate {
get { return _current_frame; } get {
set { return Asset ? Asset.Data.FrameRate : 1.0f;
_current_frame = Mathf.Clamp(value, 0, frameCount - 1);
FixCurrentMesh();
} }
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// //
// Stuff // Private
// //
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
public void InitWithAsset(SwfAnimationAsset asset) { SwfAnimationAsset.Frame GetCurrentBakedFrame() {
Asset = asset; var frames = Asset ? Asset.Frames : null;
if ( Asset && !_inited ) { return frames != null && frames.Count > 0
_inited = true; ? frames[Mathf.Clamp(currentFrame, 0, frames.Count)]
_matPropBlock = new MaterialPropertyBlock(); : null;
_matPropBlock.SetTexture("_MainTex", Asset.Atlas);
}
FixCurrentMesh();
} }
void UpdateFrameTimer() { void UpdateCurrentMesh() {
if ( Asset ) { var baked_frame = GetCurrentBakedFrame();
_frame_timer += Asset.Data.FrameRate * Time.deltaTime; _meshFilter.sharedMesh = baked_frame != null ? baked_frame.Mesh : null;
while ( _frame_timer > 1.0f ) { _meshRenderer.sharedMaterials = baked_frame != null ? baked_frame.Materials : new Material[0];
_frame_timer -= 1.0f; _meshRenderer.sortingOrder = SortingOrder;
++_current_frame; _meshRenderer.sortingLayerName = SortingLayer;
if ( _current_frame > frameCount - 1 ) { _meshRenderer.SetPropertyBlock(_matPropBlock);
_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);
}
} }
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
@@ -79,8 +75,17 @@ namespace FlashTools {
// //
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
public void InternalUpdate() { public void InitWithAsset(SwfAnimationAsset asset) {
UpdateFrameTimer(); Asset = asset;
if ( asset ) {
_matPropBlock = new MaterialPropertyBlock();
_matPropBlock.SetTexture("_MainTex", asset.Atlas);
}
var controller = GetComponent<SwfAnimationController>();
if ( controller ) {
controller.InitWithAsset();
}
UpdateCurrentMesh();
} }
// --------------------------------------------------------------------- // ---------------------------------------------------------------------

View File

@@ -71,23 +71,23 @@ namespace FlashTools {
public class SwfAnimationAsset : ScriptableObject { public class SwfAnimationAsset : ScriptableObject {
[System.Serializable] [System.Serializable]
public class BakedFrame { public class Frame {
public Mesh Mesh; public Mesh Mesh;
public Material[] Materials; public Material[] Materials;
} }
public SwfAnimationData Data; public SwfAnimationData Data;
public Texture2D Atlas; public Texture2D Atlas;
public List<BakedFrame> BakedFrames; public List<Frame> Frames;
public SwfSettings Settings; public SwfSettings Settings;
public SwfSettings Overridden; public SwfSettings Overridden;
#if UNITY_EDITOR #if UNITY_EDITOR
void Reset() { void Reset() {
Data = new SwfAnimationData(); Data = new SwfAnimationData();
Atlas = null; Atlas = null;
BakedFrames = new List<BakedFrame>(); Frames = new List<Frame>();
Settings = SwfConverterSettings.GetDefaultSettings(); Settings = SwfConverterSettings.GetDefaultSettings();
Overridden = SwfConverterSettings.GetDefaultSettings(); Overridden = SwfConverterSettings.GetDefaultSettings();
} }
#endif #endif
} }

View 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);
}
}
}
}

View 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:

View File

@@ -1,8 +1,12 @@
using UnityEngine; using UnityEngine;
using System.Collections.Generic; using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace FlashTools { namespace FlashTools {
[ExecuteInEditMode] [ExecuteInEditMode, DisallowMultipleComponent]
public class SwfManager : MonoBehaviour { 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) { public void AddSwfAnimation(SwfAnimation animation) {
_animations.Add(animation); _animations.Add(animation);
} }
@@ -44,6 +53,18 @@ namespace FlashTools {
_animations.Remove(animation); _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 // 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() { void DropAnimations() {
_animations.Clear(); _animations.Clear();
} }
void UpdateAnimations() { void DropControllers() {
var iter = _animations.GetEnumerator(); _controllers.Clear();
}
void UpdateControllers() {
var dt = Time.deltaTime;
var iter = _controllers.GetEnumerator();
while ( iter.MoveNext() ) { while ( iter.MoveNext() ) {
iter.Current.InternalUpdate(); iter.Current.InternalUpdate(dt);
} }
} }
@@ -79,14 +115,16 @@ namespace FlashTools {
void OnEnable() { void OnEnable() {
GrabEnabledAnimations(); GrabEnabledAnimations();
GrabEnabledControllers();
} }
void OnDisable() { void OnDisable() {
DropAnimations(); DropAnimations();
DropControllers();
} }
void Update() { void Update() {
UpdateAnimations(); UpdateControllers();
} }
} }
} }

View File

@@ -64,14 +64,12 @@ PlayerSettings:
xboxEnableHeadOrientation: 0 xboxEnableHeadOrientation: 0
xboxEnableGuest: 0 xboxEnableGuest: 0
xboxEnablePIXSampling: 0 xboxEnablePIXSampling: 0
xboxEnableEnableRenderThreadRunsJobs: 0
n3dsDisableStereoscopicView: 0 n3dsDisableStereoscopicView: 0
n3dsEnableSharedListOpt: 1 n3dsEnableSharedListOpt: 1
n3dsEnableVSync: 0 n3dsEnableVSync: 0
uiUse16BitDepthBuffer: 0 uiUse16BitDepthBuffer: 0
ignoreAlphaClear: 0 ignoreAlphaClear: 0
xboxOneResolution: 0 xboxOneResolution: 0
xboxOneMonoLoggingLevel: 0
ps3SplashScreen: {fileID: 0} ps3SplashScreen: {fileID: 0}
videoMemoryForVertexBuffers: 0 videoMemoryForVertexBuffers: 0
psp2PowerMode: 0 psp2PowerMode: 0
@@ -260,7 +258,6 @@ PlayerSettings:
ps4NPtitleDatPath: ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1 ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir: ps4RemotePlayKeyMappingDir:
ps4PlayTogetherPlayerCount: 0
ps4EnterButtonAssignment: 1 ps4EnterButtonAssignment: 1
ps4ApplicationParam1: 0 ps4ApplicationParam1: 0
ps4ApplicationParam2: 0 ps4ApplicationParam2: 0
@@ -287,8 +284,6 @@ PlayerSettings:
ps4attribMoveSupport: 0 ps4attribMoveSupport: 0
ps4attrib3DSupport: 0 ps4attrib3DSupport: 0
ps4attribShareSupport: 0 ps4attribShareSupport: 0
ps4attribExclusiveVR: 0
ps4disableAutoHideSplash: 0
ps4IncludedModules: [] ps4IncludedModules: []
monoEnv: monoEnv:
psp2Splashimage: {fileID: 0} psp2Splashimage: {fileID: 0}

View File

@@ -1,2 +1,2 @@
m_EditorVersion: 5.3.6f1 m_EditorVersion: 5.3.5f1
m_StandardAssetsVersion: 0 m_StandardAssetsVersion: 0

View File

@@ -1,9 +1,9 @@
Microsoft Visual Studio Solution File, Format Version 11.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2008 # 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 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 EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,14 +11,14 @@ Global
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{906D3FD6-5699-A169-2DA9-91E0C813728E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{906D3FD6-5699-A169-2DA9-91E0C813728E}.Debug|Any CPU.Build.0 = Debug|Any CPU {ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Debug|Any CPU.Build.0 = Debug|Any CPU
{906D3FD6-5699-A169-2DA9-91E0C813728E}.Release|Any CPU.ActiveCfg = Release|Any CPU {ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Release|Any CPU.ActiveCfg = Release|Any CPU
{906D3FD6-5699-A169-2DA9-91E0C813728E}.Release|Any CPU.Build.0 = Release|Any CPU {ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Release|Any CPU.Build.0 = Release|Any CPU
{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}.Debug|Any CPU.Build.0 = Debug|Any CPU {7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}.Release|Any CPU.ActiveCfg = Release|Any CPU {7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3F6CCE6-092A-767C-ECC7-83C51FCCFC00}.Release|Any CPU.Build.0 = Release|Any CPU {7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -1,10 +1,9 @@
<Properties StartupItem="Assembly-CSharp.csproj"> <Properties StartupItem="Assembly-CSharp.csproj">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" /> <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> <Files>
<File FileName="Assets/FlashTools/Scripts/Internal/SwfConverterSettings.cs" Line="24" Column="27" /> <File FileName="Assets/FlashTools/Scripts/Internal/Editor/SwfAnimationControllerEditor.cs" Line="1" Column="1" />
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/SwfPropertyDrawers.cs" Line="128" Column="42" /> <File FileName="Assets/FlashTools/Scripts/Internal/Editor/SwfAnimationAssetEditor.cs" Line="1" Column="1" />
<File FileName="Assets/FlashTools/Scripts/Internal/SwfPropertyAttributes.cs" Line="17" Column="2" NotebookId="1" />
</Files> </Files>
</MonoDevelop.Ide.Workbench> </MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints> <MonoDevelop.Ide.DebuggingService.Breakpoints>