├── Library ├── BuildPlayer.prefs ├── AssetImportState ├── FailedAssetImports.txt ├── ScriptAssemblies │ ├── CompilationCompleted.txt │ ├── Assembly-CSharp-firstpass.dll │ ├── Assembly-CSharp-firstpass.dll.mdb │ ├── Assembly-CSharp-Editor-firstpass.dll │ └── Assembly-CSharp-Editor-firstpass.dll.mdb ├── guidmapper ├── ScriptMapper ├── assetDatabase3 ├── expandedItems ├── AnnotationManager ├── MonoManager.asset ├── AssetServerCacheV3 ├── AssetVersioning.db ├── BuildSettings.asset ├── ProjectSettings.asset ├── EditorUserSettings.asset ├── EditorUserBuildSettings.asset ├── InspectorExpandedItems.asset └── metadata │ ├── 10 │ └── 1003c3e951ef02346ae2e1bb342657c1 │ ├── 21 │ └── 210fbfbe1ec974342bfffed3920cb215 │ ├── 22 │ └── 226cd442a7e375a448ebf5b10224f0b8 │ ├── 26 │ ├── 262cce81981986a4bbabc7a12fa82582 │ └── 262d9c7dbff1f6346bf13d8293edaf04 │ ├── 29 │ └── 2956bdcf1fab42144bd3d8fb6c2087a0 │ ├── 31 │ └── 3145eb6a1c559d94082cf4edf8d59472 │ ├── 32 │ └── 32b7ddfb3efd4634198aa8b62e1404cc │ ├── 35 │ ├── 3520dd72433f66045ab02fe53fad3221 │ ├── 352a30ba84bada34db55ac125e8f3a2d │ └── 3597041b4e0909f43a26421582497e0f │ ├── 42 │ └── 4255c7ceb9a0bfc4fb816992f4cd3194 │ ├── 46 │ └── 46123eb3185eba544ba6b0ce3fe8a0c3 │ ├── 47 │ └── 47117bb6c7da5bf4ca47e8aa1f887f3d │ ├── 50 │ ├── 5085a651a7bae60448e2c1f895e1395c │ └── 50e41c3f3506e334c87161d1405c95b9 │ ├── 52 │ └── 52979745dab685b48a701e68264bd24d │ ├── 54 │ └── 5475bccf723f7044ea5487931e61e6db │ ├── 61 │ └── 616334333883a7047b551aed9599f981 │ ├── 63 │ └── 6376c4347b6fa4743b689bdf5fffcd32 │ ├── 64 │ └── 64b0a3efbdafbeb44975409e16eff754 │ ├── 65 │ └── 65620945c85562144a24194037b27d6f │ ├── 67 │ └── 675d9ec96d7e0e44e88d62bbacbfee91 │ ├── 73 │ └── 73ede8e6c3657dc40ba79fc0621d4897 │ ├── 83 │ └── 8364add24d8ba4e4b9b11762ce0ba789 │ ├── 86 │ └── 86d7d0eac087182488f13b9a8e3723ff │ ├── 92 │ └── 927a59d50fc90dd498f0e1462655b14e │ ├── 00 │ ├── 00000000000000001000000000000000 │ ├── 00000000000000002000000000000000 │ ├── 00000000000000003000000000000000 │ ├── 00000000000000004000000000000000 │ ├── 00000000000000004100000000000000 │ ├── 00000000000000005000000000000000 │ ├── 00000000000000006000000000000000 │ ├── 00000000000000007000000000000000 │ ├── 00000000000000008000000000000000 │ ├── 00000000000000009000000000000000 │ ├── 0000000000000000a000000000000000 │ ├── 0000000000000000b000000000000000 │ └── 0000000000000000c000000000000000 │ ├── 02 │ └── 025d737194d6a9b4893cc701ea335181 │ ├── 05 │ └── 050eed9a3d86e474681cdafce0e9c136 │ ├── 0b │ └── 0b78a69595630954bbb579955e8b959b │ ├── 0f │ └── 0ff381a0cb80aee4bbe42956fe15e092 │ ├── 1c │ └── 1c11d92971aabe34d84a893e3929f5e3 │ ├── 2b │ └── 2b6ca42133a809c47b32dd6942f91174 │ ├── 2c │ └── 2c39531fef554a042897370a501119e3 │ ├── 2e │ └── 2e8b2cf1d1ea8594d9e321def8c76b4a │ ├── 2f │ ├── 2f640b3fea67ca1419e69ddccbb3bee5 │ └── 2f85fedeb99e721439bae5e08c16634f │ ├── 3d │ └── 3dcb22cf075a39c48be96ce8cd1ce606 │ ├── 3f │ └── 3f7277abd6787864298db8a1aac69439 │ ├── 4e │ └── 4ebfc3440ba49e944ba90737a0c015dc │ ├── 5a │ └── 5ad00a5cebe4edd4699d1492e762d8a3 │ ├── 5b │ └── 5b79bc1cdb05fc14da9c4c57bbdb0826 │ ├── 5c │ ├── 5c4ebf381e0f9e348b255afc3eae4d17 │ └── 5cb254462db31db49855568db5096da1 │ ├── 6d │ └── 6dbb92376568c3149ac36fcbb41b8a91 │ ├── 9f │ └── 9fadabcb8a8723741be12f7d2f17516d │ ├── a1 │ └── a12d22cd8ba63444ca643a95cbdadefd │ ├── a5 │ └── a5c9fa12cb4f37f40a7c856e619bcdf0 │ ├── a9 │ └── a9ae2b2f9340f8d48a4643bd12f79e1d │ ├── af │ └── afac81009e0f6264f98a6488548f996f │ ├── b0 │ ├── b009e7f193e45914ab127b0a64141879 │ └── b0d02140b6e685c41a9fab2ac14a6264 │ ├── b8 │ └── b823c77f341b0054bb6caaf0b04f261e │ ├── bc │ └── bce177919c60cf8439878a57887933b1 │ ├── c1 │ └── c1f28645331b29244beaf39116fbfe92 │ ├── c2 │ ├── c27e36b54df54eb439ebdaddfe421781 │ ├── c2d8e4bbd455e4542b55757512d093cc │ └── c2e86bf7b32c8a34caf748919e08bfeb │ ├── c7 │ └── c761bdd461713404ca4f24f46ff381b4 │ ├── c8 │ └── c8aecffce70d8514fa956dec197e3a2e │ ├── cb │ ├── cb5e13c0a85a4f24a8319bd2920c4b42 │ └── cb81a10f3996211458ad8d9dc84a11bb │ ├── cf │ └── cfb79c88b8e3d16489d04f3b7d889491 │ ├── d1 │ └── d10af1c072df2414db0eff758d0c83cb │ ├── d3 │ └── d3cb13517eae3d444b2c210165d71349 │ ├── d9 │ └── d9d2d3e81f3d15d4c8a7d2657f313791 │ ├── db │ └── db4ab1bfd18274049acc712283d959a3 │ ├── dc │ └── dc306af9e7bb2d94eadc49f7609c96b5 │ ├── e6 │ └── e64e4cc9fea07f544b3c88959414f97e │ ├── e7 │ └── e73a04e6a34aea047b0fb34d47c0cfd1 │ ├── e8 │ └── e8ad26c1c6cf40441b4e4c18053fdebf │ ├── e9 │ └── e988b299f305dbb46a87de946ee24d1b │ ├── ea │ └── eadb525c750d01741a5e5843e5119fa9 │ ├── ee │ └── eee8bc5cec8d23742868b2bcdf4e908d │ ├── f2 │ └── f24f73aac0de5b649a094b830777ac36 │ ├── f6 │ └── f678c33859ee8994390db5464c225728 │ └── fa │ └── fa3039a132111204c9c0890060824751 ├── README.md ├── ProjectSettings ├── TagManager.asset ├── TimeManager.asset ├── AudioManager.asset ├── InputManager.asset ├── NavMeshLayers.asset ├── DynamicsManager.asset ├── EditorSettings.asset ├── NetworkManager.asset ├── ProjectSettings.asset ├── QualitySettings.asset └── EditorBuildSettings.asset ├── Assets ├── Resources │ └── Tang │ │ └── Objects │ │ └── SpriteAnimcation.prefab └── Standard Assets │ ├── UUnit │ ├── UUnitTestAttribute.cs │ ├── UUnitSelfTest │ │ ├── TestCaseRunner.cs │ │ ├── TestCaseDummy.cs │ │ └── TestCaseTest.cs │ ├── UUnitTestResult.cs │ ├── UUnitAssertException.cs │ ├── UUnitTestCase.cs │ ├── UUnitTestSuite.cs │ ├── UUnitTestRunner.cs │ └── UUnitAssert.cs │ ├── Editor │ ├── Tang │ │ ├── AtlasParser.cs │ │ ├── MidFrame.cs │ │ ├── AtlasData.cs │ │ ├── AtlasXmlParser.cs │ │ ├── Atlas.cs │ │ ├── AnimationGenerator.cs │ │ ├── TangEditorCommand.cs │ │ ├── AtlasCocos2DParser.cs │ │ └── Maker.cs │ └── UUnit │ │ └── UUnitTestRunner.cs │ ├── Tang │ ├── Sprite │ │ ├── Frame.cs │ │ ├── SingleFrameSprite.cs │ │ ├── FrameSet.cs │ │ ├── MultiFrameSprite.cs │ │ ├── MultiSetSprite.cs │ │ └── Sprite.cs │ ├── Base │ │ ├── Tang.cs │ │ └── MeshOne.cs │ └── Animation │ │ ├── LayerID.cs │ │ ├── BodyLayer.cs │ │ ├── EffectLayer.cs │ │ ├── WingLayer.cs │ │ ├── ClothesLayer.cs │ │ ├── WeaponLayer.cs │ │ ├── MountLayer.cs │ │ ├── CommonLayer.cs │ │ ├── SpriteLayer.cs │ │ └── SpriteAnimation.cs │ └── Tang-Test │ └── Scene │ └── SpriteAnimationTest │ ├── SpriteAnimationTestRunner.cs │ └── SpriteAnimationTestCase.cs ├── Tang.sln ├── Tang-csharp.sln ├── .gitignore ├── Assembly-CSharp-Editor-firstpass.csproj ├── Assembly-CSharp-Editor-firstpass-vs.csproj ├── Assembly-CSharp.csproj ├── Assembly-CSharp-vs.csproj ├── Assembly-CSharp-firstpass-vs.csproj ├── Assembly-CSharp-firstpass.csproj └── LICENSE /Library/BuildPlayer.prefs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Library/AssetImportState: -------------------------------------------------------------------------------- 1 | 5;0;-1 -------------------------------------------------------------------------------- /Library/FailedAssetImports.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Library/ScriptAssemblies/CompilationCompleted.txt: -------------------------------------------------------------------------------- 1 | Completed 2 | -------------------------------------------------------------------------------- /Library/guidmapper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/guidmapper -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Tang 2 | ==== 3 | 4 | A simple sprite animation plugin for Unity3D 5 | -------------------------------------------------------------------------------- /Library/ScriptMapper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/ScriptMapper -------------------------------------------------------------------------------- /Library/assetDatabase3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/assetDatabase3 -------------------------------------------------------------------------------- /Library/expandedItems: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/expandedItems -------------------------------------------------------------------------------- /Library/AnnotationManager: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/AnnotationManager -------------------------------------------------------------------------------- /Library/MonoManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/MonoManager.asset -------------------------------------------------------------------------------- /Library/AssetServerCacheV3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/AssetServerCacheV3 -------------------------------------------------------------------------------- /Library/AssetVersioning.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/AssetVersioning.db -------------------------------------------------------------------------------- /Library/BuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/BuildSettings.asset -------------------------------------------------------------------------------- /Library/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/ProjectSettings.asset -------------------------------------------------------------------------------- /Library/EditorUserSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/EditorUserSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /Library/EditorUserBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/EditorUserBuildSettings.asset -------------------------------------------------------------------------------- /Library/InspectorExpandedItems.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/InspectorExpandedItems.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /Assets/Resources/Tang/Objects/SpriteAnimcation.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Assets/Resources/Tang/Objects/SpriteAnimcation.prefab -------------------------------------------------------------------------------- /Library/metadata/00/00000000000000001000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/00000000000000001000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/00000000000000002000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/00000000000000002000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/00000000000000003000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/00000000000000003000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/00000000000000004000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/00000000000000004000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/00000000000000004100000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/00000000000000004100000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/00000000000000005000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/00000000000000005000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/00000000000000006000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/00000000000000006000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/00000000000000007000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/00000000000000007000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/00000000000000008000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/00000000000000008000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/00000000000000009000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/00000000000000009000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/0000000000000000a000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/0000000000000000a000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/0000000000000000b000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/0000000000000000b000000000000000 -------------------------------------------------------------------------------- /Library/metadata/00/0000000000000000c000000000000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/00/0000000000000000c000000000000000 -------------------------------------------------------------------------------- /Library/metadata/02/025d737194d6a9b4893cc701ea335181: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/02/025d737194d6a9b4893cc701ea335181 -------------------------------------------------------------------------------- /Library/metadata/05/050eed9a3d86e474681cdafce0e9c136: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/05/050eed9a3d86e474681cdafce0e9c136 -------------------------------------------------------------------------------- /Library/metadata/0b/0b78a69595630954bbb579955e8b959b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/0b/0b78a69595630954bbb579955e8b959b -------------------------------------------------------------------------------- /Library/metadata/0f/0ff381a0cb80aee4bbe42956fe15e092: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/0f/0ff381a0cb80aee4bbe42956fe15e092 -------------------------------------------------------------------------------- /Library/metadata/10/1003c3e951ef02346ae2e1bb342657c1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/10/1003c3e951ef02346ae2e1bb342657c1 -------------------------------------------------------------------------------- /Library/metadata/1c/1c11d92971aabe34d84a893e3929f5e3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/1c/1c11d92971aabe34d84a893e3929f5e3 -------------------------------------------------------------------------------- /Library/metadata/21/210fbfbe1ec974342bfffed3920cb215: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/21/210fbfbe1ec974342bfffed3920cb215 -------------------------------------------------------------------------------- /Library/metadata/22/226cd442a7e375a448ebf5b10224f0b8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/22/226cd442a7e375a448ebf5b10224f0b8 -------------------------------------------------------------------------------- /Library/metadata/26/262cce81981986a4bbabc7a12fa82582: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/26/262cce81981986a4bbabc7a12fa82582 -------------------------------------------------------------------------------- /Library/metadata/26/262d9c7dbff1f6346bf13d8293edaf04: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/26/262d9c7dbff1f6346bf13d8293edaf04 -------------------------------------------------------------------------------- /Library/metadata/29/2956bdcf1fab42144bd3d8fb6c2087a0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/29/2956bdcf1fab42144bd3d8fb6c2087a0 -------------------------------------------------------------------------------- /Library/metadata/2b/2b6ca42133a809c47b32dd6942f91174: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/2b/2b6ca42133a809c47b32dd6942f91174 -------------------------------------------------------------------------------- /Library/metadata/2c/2c39531fef554a042897370a501119e3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/2c/2c39531fef554a042897370a501119e3 -------------------------------------------------------------------------------- /Library/metadata/2e/2e8b2cf1d1ea8594d9e321def8c76b4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/2e/2e8b2cf1d1ea8594d9e321def8c76b4a -------------------------------------------------------------------------------- /Library/metadata/2f/2f640b3fea67ca1419e69ddccbb3bee5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/2f/2f640b3fea67ca1419e69ddccbb3bee5 -------------------------------------------------------------------------------- /Library/metadata/2f/2f85fedeb99e721439bae5e08c16634f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/2f/2f85fedeb99e721439bae5e08c16634f -------------------------------------------------------------------------------- /Library/metadata/31/3145eb6a1c559d94082cf4edf8d59472: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/31/3145eb6a1c559d94082cf4edf8d59472 -------------------------------------------------------------------------------- /Library/metadata/32/32b7ddfb3efd4634198aa8b62e1404cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/32/32b7ddfb3efd4634198aa8b62e1404cc -------------------------------------------------------------------------------- /Library/metadata/35/3520dd72433f66045ab02fe53fad3221: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/35/3520dd72433f66045ab02fe53fad3221 -------------------------------------------------------------------------------- /Library/metadata/35/352a30ba84bada34db55ac125e8f3a2d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/35/352a30ba84bada34db55ac125e8f3a2d -------------------------------------------------------------------------------- /Library/metadata/35/3597041b4e0909f43a26421582497e0f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/35/3597041b4e0909f43a26421582497e0f -------------------------------------------------------------------------------- /Library/metadata/3d/3dcb22cf075a39c48be96ce8cd1ce606: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/3d/3dcb22cf075a39c48be96ce8cd1ce606 -------------------------------------------------------------------------------- /Library/metadata/3f/3f7277abd6787864298db8a1aac69439: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/3f/3f7277abd6787864298db8a1aac69439 -------------------------------------------------------------------------------- /Library/metadata/42/4255c7ceb9a0bfc4fb816992f4cd3194: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/42/4255c7ceb9a0bfc4fb816992f4cd3194 -------------------------------------------------------------------------------- /Library/metadata/46/46123eb3185eba544ba6b0ce3fe8a0c3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/46/46123eb3185eba544ba6b0ce3fe8a0c3 -------------------------------------------------------------------------------- /Library/metadata/47/47117bb6c7da5bf4ca47e8aa1f887f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/47/47117bb6c7da5bf4ca47e8aa1f887f3d -------------------------------------------------------------------------------- /Library/metadata/4e/4ebfc3440ba49e944ba90737a0c015dc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/4e/4ebfc3440ba49e944ba90737a0c015dc -------------------------------------------------------------------------------- /Library/metadata/50/5085a651a7bae60448e2c1f895e1395c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/50/5085a651a7bae60448e2c1f895e1395c -------------------------------------------------------------------------------- /Library/metadata/50/50e41c3f3506e334c87161d1405c95b9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/50/50e41c3f3506e334c87161d1405c95b9 -------------------------------------------------------------------------------- /Library/metadata/52/52979745dab685b48a701e68264bd24d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/52/52979745dab685b48a701e68264bd24d -------------------------------------------------------------------------------- /Library/metadata/54/5475bccf723f7044ea5487931e61e6db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/54/5475bccf723f7044ea5487931e61e6db -------------------------------------------------------------------------------- /Library/metadata/5a/5ad00a5cebe4edd4699d1492e762d8a3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/5a/5ad00a5cebe4edd4699d1492e762d8a3 -------------------------------------------------------------------------------- /Library/metadata/5b/5b79bc1cdb05fc14da9c4c57bbdb0826: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/5b/5b79bc1cdb05fc14da9c4c57bbdb0826 -------------------------------------------------------------------------------- /Library/metadata/5c/5c4ebf381e0f9e348b255afc3eae4d17: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/5c/5c4ebf381e0f9e348b255afc3eae4d17 -------------------------------------------------------------------------------- /Library/metadata/5c/5cb254462db31db49855568db5096da1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/5c/5cb254462db31db49855568db5096da1 -------------------------------------------------------------------------------- /Library/metadata/61/616334333883a7047b551aed9599f981: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/61/616334333883a7047b551aed9599f981 -------------------------------------------------------------------------------- /Library/metadata/63/6376c4347b6fa4743b689bdf5fffcd32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/63/6376c4347b6fa4743b689bdf5fffcd32 -------------------------------------------------------------------------------- /Library/metadata/64/64b0a3efbdafbeb44975409e16eff754: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/64/64b0a3efbdafbeb44975409e16eff754 -------------------------------------------------------------------------------- /Library/metadata/65/65620945c85562144a24194037b27d6f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/65/65620945c85562144a24194037b27d6f -------------------------------------------------------------------------------- /Library/metadata/67/675d9ec96d7e0e44e88d62bbacbfee91: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/67/675d9ec96d7e0e44e88d62bbacbfee91 -------------------------------------------------------------------------------- /Library/metadata/6d/6dbb92376568c3149ac36fcbb41b8a91: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/6d/6dbb92376568c3149ac36fcbb41b8a91 -------------------------------------------------------------------------------- /Library/metadata/73/73ede8e6c3657dc40ba79fc0621d4897: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/73/73ede8e6c3657dc40ba79fc0621d4897 -------------------------------------------------------------------------------- /Library/metadata/83/8364add24d8ba4e4b9b11762ce0ba789: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/83/8364add24d8ba4e4b9b11762ce0ba789 -------------------------------------------------------------------------------- /Library/metadata/86/86d7d0eac087182488f13b9a8e3723ff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/86/86d7d0eac087182488f13b9a8e3723ff -------------------------------------------------------------------------------- /Library/metadata/92/927a59d50fc90dd498f0e1462655b14e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/92/927a59d50fc90dd498f0e1462655b14e -------------------------------------------------------------------------------- /Library/metadata/9f/9fadabcb8a8723741be12f7d2f17516d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/9f/9fadabcb8a8723741be12f7d2f17516d -------------------------------------------------------------------------------- /Library/metadata/a1/a12d22cd8ba63444ca643a95cbdadefd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/a1/a12d22cd8ba63444ca643a95cbdadefd -------------------------------------------------------------------------------- /Library/metadata/a5/a5c9fa12cb4f37f40a7c856e619bcdf0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/a5/a5c9fa12cb4f37f40a7c856e619bcdf0 -------------------------------------------------------------------------------- /Library/metadata/a9/a9ae2b2f9340f8d48a4643bd12f79e1d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/a9/a9ae2b2f9340f8d48a4643bd12f79e1d -------------------------------------------------------------------------------- /Library/metadata/af/afac81009e0f6264f98a6488548f996f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/af/afac81009e0f6264f98a6488548f996f -------------------------------------------------------------------------------- /Library/metadata/b0/b009e7f193e45914ab127b0a64141879: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/b0/b009e7f193e45914ab127b0a64141879 -------------------------------------------------------------------------------- /Library/metadata/b0/b0d02140b6e685c41a9fab2ac14a6264: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/b0/b0d02140b6e685c41a9fab2ac14a6264 -------------------------------------------------------------------------------- /Library/metadata/b8/b823c77f341b0054bb6caaf0b04f261e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/b8/b823c77f341b0054bb6caaf0b04f261e -------------------------------------------------------------------------------- /Library/metadata/bc/bce177919c60cf8439878a57887933b1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/bc/bce177919c60cf8439878a57887933b1 -------------------------------------------------------------------------------- /Library/metadata/c1/c1f28645331b29244beaf39116fbfe92: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/c1/c1f28645331b29244beaf39116fbfe92 -------------------------------------------------------------------------------- /Library/metadata/c2/c27e36b54df54eb439ebdaddfe421781: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/c2/c27e36b54df54eb439ebdaddfe421781 -------------------------------------------------------------------------------- /Library/metadata/c2/c2d8e4bbd455e4542b55757512d093cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/c2/c2d8e4bbd455e4542b55757512d093cc -------------------------------------------------------------------------------- /Library/metadata/c2/c2e86bf7b32c8a34caf748919e08bfeb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/c2/c2e86bf7b32c8a34caf748919e08bfeb -------------------------------------------------------------------------------- /Library/metadata/c7/c761bdd461713404ca4f24f46ff381b4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/c7/c761bdd461713404ca4f24f46ff381b4 -------------------------------------------------------------------------------- /Library/metadata/c8/c8aecffce70d8514fa956dec197e3a2e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/c8/c8aecffce70d8514fa956dec197e3a2e -------------------------------------------------------------------------------- /Library/metadata/cb/cb5e13c0a85a4f24a8319bd2920c4b42: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/cb/cb5e13c0a85a4f24a8319bd2920c4b42 -------------------------------------------------------------------------------- /Library/metadata/cb/cb81a10f3996211458ad8d9dc84a11bb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/cb/cb81a10f3996211458ad8d9dc84a11bb -------------------------------------------------------------------------------- /Library/metadata/cf/cfb79c88b8e3d16489d04f3b7d889491: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/cf/cfb79c88b8e3d16489d04f3b7d889491 -------------------------------------------------------------------------------- /Library/metadata/d1/d10af1c072df2414db0eff758d0c83cb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/d1/d10af1c072df2414db0eff758d0c83cb -------------------------------------------------------------------------------- /Library/metadata/d3/d3cb13517eae3d444b2c210165d71349: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/d3/d3cb13517eae3d444b2c210165d71349 -------------------------------------------------------------------------------- /Library/metadata/d9/d9d2d3e81f3d15d4c8a7d2657f313791: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/d9/d9d2d3e81f3d15d4c8a7d2657f313791 -------------------------------------------------------------------------------- /Library/metadata/db/db4ab1bfd18274049acc712283d959a3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/db/db4ab1bfd18274049acc712283d959a3 -------------------------------------------------------------------------------- /Library/metadata/dc/dc306af9e7bb2d94eadc49f7609c96b5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/dc/dc306af9e7bb2d94eadc49f7609c96b5 -------------------------------------------------------------------------------- /Library/metadata/e6/e64e4cc9fea07f544b3c88959414f97e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/e6/e64e4cc9fea07f544b3c88959414f97e -------------------------------------------------------------------------------- /Library/metadata/e7/e73a04e6a34aea047b0fb34d47c0cfd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/e7/e73a04e6a34aea047b0fb34d47c0cfd1 -------------------------------------------------------------------------------- /Library/metadata/e8/e8ad26c1c6cf40441b4e4c18053fdebf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/e8/e8ad26c1c6cf40441b4e4c18053fdebf -------------------------------------------------------------------------------- /Library/metadata/e9/e988b299f305dbb46a87de946ee24d1b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/e9/e988b299f305dbb46a87de946ee24d1b -------------------------------------------------------------------------------- /Library/metadata/ea/eadb525c750d01741a5e5843e5119fa9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/ea/eadb525c750d01741a5e5843e5119fa9 -------------------------------------------------------------------------------- /Library/metadata/ee/eee8bc5cec8d23742868b2bcdf4e908d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/ee/eee8bc5cec8d23742868b2bcdf4e908d -------------------------------------------------------------------------------- /Library/metadata/f2/f24f73aac0de5b649a094b830777ac36: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/f2/f24f73aac0de5b649a094b830777ac36 -------------------------------------------------------------------------------- /Library/metadata/f6/f678c33859ee8994390db5464c225728: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/f6/f678c33859ee8994390db5464c225728 -------------------------------------------------------------------------------- /Library/metadata/fa/fa3039a132111204c9c0890060824751: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/metadata/fa/fa3039a132111204c9c0890060824751 -------------------------------------------------------------------------------- /Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll -------------------------------------------------------------------------------- /Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll.mdb -------------------------------------------------------------------------------- /Library/ScriptAssemblies/Assembly-CSharp-Editor-firstpass.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/ScriptAssemblies/Assembly-CSharp-Editor-firstpass.dll -------------------------------------------------------------------------------- /Library/ScriptAssemblies/Assembly-CSharp-Editor-firstpass.dll.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/Tang/master/Library/ScriptAssemblies/Assembly-CSharp-Editor-firstpass.dll.mdb -------------------------------------------------------------------------------- /Assets/Standard Assets/UUnit/UUnitTestAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | [AttributeUsage(AttributeTargets.Method)] 4 | public class UUnitTestAttribute : Attribute 5 | { 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /Assets/Standard Assets/UUnit/UUnitSelfTest/TestCaseRunner.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class TestCaseRunner : MonoBehaviour 4 | { 5 | 6 | public void Start () 7 | { 8 | UUnitTestSuite suite = new UUnitTestSuite (); 9 | suite.AddAll (typeof(TestCaseTest)); 10 | UUnitTestResult result = suite.Run (); 11 | Debug.Log (result.Summary ()); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Standard Assets/UUnit/UUnitTestResult.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class UUnitTestResult 4 | { 5 | private int runCount = 0; 6 | private int failedCount = 0; 7 | 8 | public void TestStarted () 9 | { 10 | runCount += 1; 11 | } 12 | 13 | public void TestFailed () 14 | { 15 | failedCount += 1; 16 | } 17 | 18 | public string Summary () 19 | { 20 | return runCount + " run, " + failedCount + " failed"; 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/Tang/AtlasParser.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/7/30 5 | * Time: 22:16 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of AtlasImporter. 15 | /// 16 | public interface AtlasParser 17 | { 18 | Atlas Parse(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Sprite/Frame.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Tang { 5 | 6 | [Serializable] 7 | public class Frame { 8 | 9 | public Vector2 size; 10 | public Vector2 offset; 11 | public Vector2[] uv; 12 | 13 | public Frame(){ 14 | } 15 | 16 | public Frame(Vector2 size, Vector2 offset, Vector2[] uv){ 17 | this.size = size; 18 | this.offset = offset; 19 | this.uv = uv; 20 | } 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Sprite/SingleFrameSprite.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace Tang { 5 | 6 | [ExecuteInEditMode] 7 | public class SingleFrameSprite : Sprite { 8 | 9 | public Frame fr; 10 | 11 | // Use this for initialization 12 | void Start () { 13 | if(fr != null){ 14 | base.Init(); 15 | CurrentFrame = fr; 16 | } 17 | } 18 | 19 | void Update(){ 20 | // do nothing 21 | } 22 | 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Base/Tang.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/7/30 5 | * Time: 15:08 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of Tang. 15 | /// 16 | public class Tang 17 | { 18 | /// 19 | /// Common FPS 20 | /// 21 | public const int FPS = 12; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Animation/LayerID.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/5 5 | * Time: 23:14 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of Layer. 15 | /// 16 | public class LayerID 17 | { 18 | public const int CLOTHES = 0; 19 | public const int MOUNT = 1; 20 | public const int WEAPON = 2; 21 | public const int WING = 3; 22 | public const int EFFECT = 4; 23 | public const int BODY = 5; 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Sprite/FrameSet.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/7/29 5 | * Time: 23:35 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of FrameSet. 15 | /// 16 | [Serializable] 17 | public class FrameSet 18 | { 19 | public string name; 20 | 21 | public Frame[] frames; 22 | 23 | public FrameSet(string name, Frame[] frames) 24 | { 25 | this.name = name; 26 | this.frames = frames; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/Tang/MidFrame.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | 4 | 5 | namespace Tang { 6 | 7 | public class MidFrame : Frame 8 | { 9 | 10 | /// 11 | /// This frame's name 12 | /// 13 | public string name; 14 | /// 15 | /// This frame's world rotation modifier 16 | /// 17 | public float rotation; 18 | /// 19 | /// The index of the frame 20 | /// 21 | public int index; 22 | 23 | public MidFrame(){ 24 | } 25 | 26 | public MidFrame(Vector2 size, Vector2 offset, Vector2[] uv) : base(size, offset, uv) 27 | { 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Animation/BodyLayer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/13 5 | * Time: 15:45 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of BodyLayer. 15 | /// 16 | public class BodyLayer : CommonLayer 17 | { 18 | public const int ID = LayerID.BODY; 19 | public const string NAME = "body"; 20 | 21 | public BodyLayer() : base(ID, NAME) 22 | { 23 | } 24 | 25 | public BodyLayer(Sprite spritePrefab) : base(ID, NAME, spritePrefab){ 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Animation/EffectLayer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/12 5 | * Time: 15:22 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of EffectLayer. 15 | /// 16 | public class EffectLayer : CommonLayer 17 | { 18 | public const int ID = LayerID.EFFECT; 19 | public const string NAME = "effect"; 20 | 21 | public EffectLayer() : base(ID, NAME) 22 | { 23 | } 24 | 25 | public EffectLayer(Sprite spritePrefab) : base(ID, NAME, spritePrefab){ 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Animation/WingLayer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/12 5 | * Time: 15:21 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of WingLayer. 15 | /// 16 | public class WingLayer : CommonLayer 17 | { 18 | public const int ID = LayerID.WING; 19 | public const string NAME = "wing"; 20 | 21 | public WingLayer() : base(ID, NAME) 22 | { 23 | } 24 | 25 | public WingLayer(Sprite spritePrefab) : base(ID, NAME, spritePrefab) 26 | { 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Animation/ClothesLayer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/12 5 | * Time: 15:18 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of ClothesLayer. 15 | /// 16 | public class ClothesLayer : CommonLayer 17 | { 18 | public const int ID = LayerID.CLOTHES; 19 | public const string NAME = "clothes"; 20 | 21 | public ClothesLayer() : base(ID, NAME) 22 | { 23 | } 24 | 25 | public ClothesLayer(Sprite spritePrefab) : base(ID, NAME, spritePrefab){ 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Animation/WeaponLayer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/12 5 | * Time: 15:20 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of WeaponLayer. 15 | /// 16 | public class WeaponLayer : CommonLayer 17 | { 18 | public const int ID = LayerID.WEAPON; 19 | public const string NAME = "weapon"; 20 | 21 | public WeaponLayer() : base(ID, NAME) 22 | { 23 | } 24 | 25 | public WeaponLayer(Sprite spritePrefab) : base(ID, NAME, spritePrefab){ 26 | } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Animation/MountLayer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/12 5 | * Time: 15:12 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of MountLayer. 15 | /// 16 | public class MountLayer : CommonLayer 17 | { 18 | public const int ID = LayerID.MOUNT; 19 | public const string NAME = "mount"; 20 | 21 | public MountLayer() : base(ID, NAME) 22 | { 23 | } 24 | 25 | public MountLayer(Sprite spritePrefab) : base(ID, NAME, spritePrefab) 26 | { 27 | } 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Assets/Standard Assets/UUnit/UUnitSelfTest/TestCaseDummy.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class TestCaseDummy : UUnitTestCase 4 | { 5 | public bool wasRun; 6 | public bool wasSetUp; 7 | public string log; 8 | 9 | public TestCaseDummy () 10 | { 11 | } 12 | 13 | public TestCaseDummy (string testMethodName) : base(testMethodName) 14 | { 15 | } 16 | 17 | [UUnitTest] 18 | public void TestMethod () 19 | { 20 | wasRun = true; 21 | } 22 | 23 | protected override void SetUp () 24 | { 25 | wasRun = false; 26 | wasSetUp = true; 27 | log = "setUp "; 28 | } 29 | 30 | [UUnitTest] 31 | public void TestFail () 32 | { 33 | UUnitAssert.True (false, "Expected Fail Result"); 34 | } 35 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang-Test/Scene/SpriteAnimationTest/SpriteAnimationTestRunner.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/9 5 | * Time: 14:07 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using UnityEngine; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of MultiLayerAnimcationTestRunner. 15 | /// 16 | public class SpriteAnimationTestRunner : MonoBehaviour 17 | { 18 | void Start() { 19 | 20 | UUnitTestSuite suite = new UUnitTestSuite(); 21 | suite.AddAll(typeof(SpriteAnimationTestCase)); 22 | UUnitTestResult result = suite.Run (); 23 | Debug.Log (result.Summary ()); 24 | 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Assets/Standard Assets/UUnit/UUnitAssertException.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | 4 | public class UUnitAssertException : Exception 5 | { 6 | public object expected; 7 | public object received; 8 | public string message; 9 | 10 | public UUnitAssertException (string message) : base(message) 11 | { 12 | this.message = message; 13 | } 14 | 15 | public UUnitAssertException (object expected, object received, string message) : base("[UUnit] - Assert Failed - Expected: " + expected + " Received: " + received + "\n\t\t(" + message + ")") 16 | { 17 | this.expected = (expected == null) ? "null" : expected; 18 | this.received = (received == null) ? "null" : received; 19 | this.message = (message == null) ? "" : message; 20 | } 21 | 22 | public UUnitAssertException (object expected, object received) : base("[UUnit] - Assert Failed - Expected: " + expected + " Received: " + received) 23 | { 24 | this.expected = (expected == null) ? "null" : expected; 25 | this.received = (received == null) ? "null" : received; 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Animation/CommonLayer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/12 5 | * Time: 16:08 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | 11 | namespace Tang 12 | { 13 | /// 14 | /// Description of CommonLayer. 15 | /// 16 | public class CommonLayer : SpriteLayer 17 | { 18 | 19 | public const int FRAME_DELAY = 0; 20 | public const bool HIDDEN_BEFORE_BEGIN = true; 21 | public const bool HIDDEN_AFTER_END = true; 22 | 23 | 24 | public CommonLayer(int id, string name) : base(id, name) 25 | { 26 | InitFields(); 27 | } 28 | 29 | public CommonLayer(int id, string name, Sprite spritePrefab) : base(id, name){ 30 | this.spritePrefab = spritePrefab; 31 | InitFields(); 32 | } 33 | 34 | private void InitFields(){ 35 | this.frameDelay = FRAME_DELAY; 36 | this.hiddenBeforeBegin = HIDDEN_BEFORE_BEGIN; 37 | this.hiddenAfterEnd = HIDDEN_AFTER_END; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/Tang/AtlasData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/7/30 5 | * Time: 22:48 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using UnityEngine; 10 | using System.Collections; 11 | 12 | namespace Tang 13 | { 14 | /// 15 | /// Description of AtlasData. 16 | /// 17 | public class AtlasData 18 | { 19 | /// 20 | /// This frame's name 21 | /// 22 | public string name = ""; 23 | /// 24 | /// This frame's atlas position 25 | /// 26 | public Vector2 position = Vector2.zero; 27 | /// 28 | /// This frame's position offset 29 | /// 30 | public Vector2 offset = Vector2.zero; 31 | /// 32 | /// if this image is rotated on Atlas 33 | /// 34 | public bool rotated = false; 35 | /// 36 | /// This frame's atlas size 37 | /// 38 | public Vector2 size = Vector2.zero; 39 | /// 40 | /// atlas frame size 41 | /// 42 | public Vector2 frameSize = Vector2.zero; 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Animation/SpriteLayer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/6 5 | * Time: 17:23 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using UnityEngine; 11 | 12 | namespace Tang 13 | { 14 | /// 15 | /// Description of SpriteLayer. 16 | /// 17 | [Serializable] 18 | public class SpriteLayer 19 | { 20 | 21 | public int id; // ID 22 | public string name; // 名称 23 | public Sprite spritePrefab; // 精灵的 prefab 24 | public int frameDelay; // 延迟多少帧后开始播放,相对于上级动画 25 | public bool hiddenBeforeBegin; // 在开始之前隐藏 26 | public bool hiddenAfterEnd; // 该 sprite 播放完成后是否隐藏 27 | 28 | [HideInInspector] 29 | public Sprite spriteInstance = null; // 精灵的实例 30 | [HideInInspector] 31 | public bool hidden = false; // 目前是否处于隐藏的状态 32 | [HideInInspector] 33 | public int maxIndex = 0; // 帧(层)最大索引值 34 | [HideInInspector] 35 | public GameObject gameObject = null; // 层对应的 GameObject 36 | 37 | public SpriteLayer(int id, string name){ 38 | this.id = id; 39 | this.name = name; 40 | } 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Standard Assets/UUnit/UUnitTestCase.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Reflection; 4 | 5 | public class UUnitTestCase 6 | { 7 | private string testMethodName; 8 | 9 | public UUnitTestCase () 10 | { 11 | } 12 | 13 | public UUnitTestCase (String testMethodName) 14 | { 15 | this.testMethodName = testMethodName; 16 | } 17 | 18 | public void SetTest (string testMethodName) 19 | { 20 | this.testMethodName = testMethodName; 21 | } 22 | 23 | public UUnitTestResult Run () 24 | { 25 | return Run (null); 26 | } 27 | 28 | public UUnitTestResult Run (UUnitTestResult testResult) 29 | { 30 | if (testResult == null) { 31 | testResult = new UUnitTestResult (); 32 | } 33 | 34 | SetUp (); 35 | 36 | testResult.TestStarted (); 37 | try { 38 | Type type = this.GetType (); 39 | MethodInfo method = type.GetMethod (testMethodName); 40 | method.Invoke (this, null); 41 | } catch (TargetInvocationException e) { 42 | testResult.TestFailed (); 43 | Debug.Log (e.InnerException); 44 | } finally { 45 | TearDown (); 46 | } 47 | 48 | return testResult; 49 | } 50 | 51 | protected virtual void SetUp () 52 | { 53 | } 54 | 55 | protected virtual void TearDown () 56 | { 57 | } 58 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/UUnit/UUnitTestSuite.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Reflection; 3 | using System.Collections.Generic; 4 | using System; 5 | 6 | public class UUnitTestSuite 7 | { 8 | 9 | private List tests = new List (); 10 | 11 | public void Add (UUnitTestCase testCase) 12 | { 13 | tests.Add (testCase); 14 | } 15 | 16 | public UUnitTestResult Run () 17 | { 18 | return Run (null); 19 | } 20 | 21 | public UUnitTestResult Run (UUnitTestResult testResult) 22 | { 23 | if (testResult == null) { 24 | testResult = new UUnitTestResult (); 25 | } 26 | 27 | foreach (UUnitTestCase test in tests) { 28 | testResult = test.Run (testResult); 29 | } 30 | return testResult; 31 | } 32 | 33 | public void AddAll (Type testCaseType) 34 | { 35 | foreach (MethodInfo method in testCaseType.GetMethods()) { 36 | foreach (Attribute attribute in method.GetCustomAttributes(false)) { 37 | if (attribute != null) { 38 | ConstructorInfo constructor = testCaseType.GetConstructors () [0]; 39 | UUnitTestCase newTestCase = (UUnitTestCase)constructor.Invoke (null); 40 | newTestCase.SetTest (method.Name); 41 | Add (newTestCase); 42 | } 43 | } 44 | } 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/UUnit/UUnitTestRunner.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Reflection; 7 | 8 | public class UUnitTestRunner 9 | { 10 | private static void FindAndAddAllTestCases (UUnitTestSuite suite) 11 | { 12 | IEnumerable testCasesTypes = AppDomain.CurrentDomain.GetAssemblies () 13 | .Select (x => x.GetTypes ()) 14 | .SelectMany (x => x) 15 | .Where (c => !c.IsAbstract) 16 | .Where (c => c.IsSubclassOf (typeof(UUnitTestCase))); 17 | 18 | foreach (Type testCaseType in testCasesTypes) { 19 | suite.AddAll (testCaseType); 20 | } 21 | } 22 | 23 | private static void ClearDebugLog () 24 | { 25 | Assembly assembly = Assembly.GetAssembly (typeof(SceneView)); 26 | Type type = assembly.GetType ("UnityEditorInternal.LogEntries"); 27 | MethodInfo method = type.GetMethod ("Clear"); 28 | method.Invoke (new object (), null); 29 | } 30 | 31 | [MenuItem("UUnit/Run All Tests %#t")] 32 | private static void RunAllTests () 33 | { 34 | ClearDebugLog (); 35 | 36 | UUnitTestSuite suite = new UUnitTestSuite (); 37 | FindAndAddAllTestCases (suite); 38 | UUnitTestResult result = suite.Run (); 39 | 40 | Debug.Log (result.Summary ()); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/UUnit/UUnitTestRunner.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Reflection; 7 | 8 | public class UUnitTestRunner 9 | { 10 | private static void FindAndAddAllTestCases (UUnitTestSuite suite) 11 | { 12 | IEnumerable testCasesTypes = AppDomain.CurrentDomain.GetAssemblies () 13 | .Select (x => x.GetTypes ()) 14 | .SelectMany (x => x) 15 | .Where (c => !c.IsAbstract) 16 | .Where (c => c.IsSubclassOf (typeof(UUnitTestCase))); 17 | 18 | foreach (Type testCaseType in testCasesTypes) { 19 | suite.AddAll (testCaseType); 20 | } 21 | } 22 | 23 | private static void ClearDebugLog () 24 | { 25 | Assembly assembly = Assembly.GetAssembly (typeof(SceneView)); 26 | Type type = assembly.GetType ("UnityEditorInternal.LogEntries"); 27 | MethodInfo method = type.GetMethod ("Clear"); 28 | method.Invoke (new object (), null); 29 | } 30 | 31 | [MenuItem("UUnit/Run All Tests %#t")] 32 | private static void RunAllTests () 33 | { 34 | ClearDebugLog (); 35 | 36 | UUnitTestSuite suite = new UUnitTestSuite (); 37 | FindAndAddAllTestCases (suite); 38 | UUnitTestResult result = suite.Run (); 39 | 40 | Debug.Log (result.Summary ()); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Base/MeshOne.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/7/29 5 | * Time: 23:48 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using UnityEngine; 11 | 12 | namespace Tang 13 | { 14 | /// 15 | /// Description of MeshOne. 16 | /// 17 | public class MeshOne 18 | { 19 | 20 | 21 | private static Vector3[] vertices = new Vector3[]{ 22 | new Vector3(-0.5F,0F,0.5F), 23 | new Vector3(0.5F,0F,0.5F), 24 | new Vector3(0.5F,0F,-0.5F), 25 | new Vector3(-0.5F,0F,-0.5F) 26 | }; 27 | private static Vector2[] uv = new Vector2[]{ 28 | new Vector2(0,1), 29 | new Vector2(1,1), 30 | new Vector2(1,0), 31 | new Vector2(0,0) 32 | }; 33 | private static Vector3[] normals = new Vector3[]{ 34 | Vector3.up, 35 | Vector3.up, 36 | Vector3.up, 37 | Vector3.up 38 | }; 39 | private static int[] triangles = { 0,1,2,0,2,3 }; 40 | 41 | public static Mesh NewMesh() 42 | { 43 | Mesh mesh = new Mesh(); 44 | mesh.vertices = vertices; 45 | mesh.triangles = triangles; 46 | mesh.uv = uv; 47 | mesh.normals = normals; 48 | return mesh; 49 | } 50 | 51 | 52 | public static void Fix(ref Mesh mesh){ 53 | mesh.vertices = vertices; 54 | mesh.triangles = triangles; 55 | mesh.uv = uv; 56 | mesh.normals = normals; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Sprite/MultiFrameSprite.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | namespace Tang { 6 | 7 | [ExecuteInEditMode] 8 | public class MultiFrameSprite : Sprite { 9 | 10 | #region Public Fields 11 | public Frame[] frames; 12 | #endregion 13 | 14 | #region Public Properties 15 | public override int currentIndex { 16 | get { 17 | return m_currentIndex; 18 | } 19 | set { 20 | if( value != m_currentIndex ) { 21 | if( value > m_maxIndex ){ 22 | if( m_currentIndex != m_maxIndex ) { 23 | m_currentIndex = m_maxIndex; 24 | CurrentFrame = frames[currentIndex]; 25 | } 26 | } else if( value < 0 ){ 27 | if( m_currentIndex != 0 ){ 28 | m_currentIndex = 0; 29 | CurrentFrame = frames[m_currentIndex]; 30 | } 31 | } else { 32 | m_currentIndex = value; 33 | CurrentFrame = frames[m_currentIndex]; 34 | 35 | } 36 | } 37 | } 38 | } 39 | #endregion 40 | 41 | #region Mono Methods 42 | 43 | // Use this for initialization 44 | void Awake () { 45 | 46 | if( frames != null && frames.Length > 0 ){ 47 | 48 | // init --- 49 | base.Init(); 50 | 51 | m_maxIndex = frames.Length - 1; 52 | 53 | if( m_currentIndex > m_maxIndex ){ 54 | m_currentIndex = m_maxIndex; 55 | } else if(m_currentIndex < 0){ 56 | m_currentIndex = 0; 57 | } 58 | 59 | CurrentFrame = frames[m_currentIndex]; 60 | // --- 61 | } 62 | } 63 | 64 | #endregion 65 | } 66 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/Tang/AtlasXmlParser.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/7/30 5 | * Time: 22:18 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System.Xml; 10 | using UnityEngine; 11 | 12 | namespace Tang 13 | { 14 | /// 15 | /// Description of AtlasXmlImporter. 16 | /// 17 | public abstract class AtlasXmlParser : AtlasParser 18 | { 19 | protected string text; 20 | protected XmlDocument xml = new XmlDocument(); 21 | 22 | protected string AttrS(XmlNode node, string field) 23 | { 24 | try 25 | { 26 | return node.Attributes[field].InnerText; 27 | } 28 | catch (System.Exception) 29 | { 30 | return ""; 31 | } 32 | } 33 | 34 | protected int AttrI(XmlNode node, string field) 35 | { 36 | try 37 | { 38 | return System.Convert.ToInt16(node.Attributes[field].InnerText); 39 | } 40 | catch (System.Exception) 41 | { 42 | return -1; 43 | } 44 | } 45 | 46 | 47 | /// 48 | /// Check if xml provided is valid 49 | /// 50 | /// Array with atlas frame data 51 | protected bool ValidXML() 52 | { 53 | try 54 | { 55 | xml.LoadXml(text); 56 | return true; 57 | } 58 | catch (System.Exception err) 59 | { 60 | Debug.LogError("Orthello : Atlas XML file could not be read!"); 61 | Debug.LogError(err.Message); 62 | } 63 | return false; 64 | } 65 | 66 | 67 | public abstract Atlas Parse(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/Tang/Atlas.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace Tang { 6 | 7 | public class Atlas { 8 | 9 | public string name; 10 | public Vector2 sheetSize = Vector2.zero; 11 | public AtlasData[] atlasData = null; 12 | 13 | 14 | public MidFrame[] GetMidFrames() { 15 | 16 | MidFrame[] frames = new MidFrame[atlasData.Length]; 17 | 18 | for (int i = 0; i < atlasData.Length; i++) 19 | { 20 | AtlasData data = atlasData[i]; 21 | MidFrame frame = new MidFrame(); 22 | frame.name = data.name; 23 | frame.offset = data.offset; 24 | frame.size = data.size; 25 | // uv --- 26 | frame.uv = new Vector2[4]; 27 | float sx = data.position.x / sheetSize.x; 28 | float sy = 1 - ((data.position.y + data.size.y) / sheetSize.y); 29 | float scx = data.size.x / sheetSize.x; 30 | float scy = data.size.y / sheetSize.y; 31 | if ( data.rotated ) 32 | { 33 | sy = 1 - ((data.position.y + data.size.x) / sheetSize.y); 34 | scx = data.size.y / sheetSize.x; 35 | scy = data.size.x / sheetSize.y; 36 | frame.uv[3] = new Vector2(sx, sy + scy); 37 | frame.uv[0] = new Vector2(sx + scx, sy + scy); 38 | frame.uv[1] = new Vector2(sx + scx, sy); 39 | frame.uv[2] = new Vector2(sx, sy); 40 | } else { 41 | frame.uv[0] = new Vector2(sx, sy + scy); 42 | frame.uv[1] = new Vector2(sx + scx, sy + scy); 43 | frame.uv[2] = new Vector2(sx + scx, sy); 44 | frame.uv[3] = new Vector2(sx, sy); 45 | } 46 | // --- 47 | 48 | frames[i] = frame; 49 | } 50 | return frames; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/Tang/AnimationGenerator.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/12 5 | * Time: 17:24 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using UnityEngine; 11 | using UnityEditor; 12 | 13 | namespace Tang 14 | { 15 | /// 16 | /// Description of AnimationGenerator. 17 | /// 18 | public class AnimationGenerator 19 | { 20 | 21 | private const string npcPrefabDirPath = "Assets/Resources/Tang/Objects/Animations"; 22 | 23 | /// 24 | /// 生成 NPC 动画 25 | /// 26 | /// npc 的 prefab 27 | public static void GenerateAnimation(GameObject obj){ 28 | 29 | 30 | // 判断该对象是不是 31 | Sprite sprite = obj.GetComponent(); 32 | Debug.Log(sprite); 33 | if(sprite != null) { 34 | 35 | GameObject animationObj = new GameObject(); 36 | animationObj.name = obj.name + "-animation"; 37 | SpriteAnimation animation = animationObj.AddComponent(); 38 | 39 | // animation. 40 | SpriteLayer clothesLayer = new ClothesLayer(obj.GetComponent()); 41 | animation.PutLayer(clothesLayer); 42 | 43 | string prefabPath = npcPrefabDirPath + "/" + animationObj.name + ".prefab"; 44 | UnityEngine.Object prefab = PrefabUtility.CreateEmptyPrefab(prefabPath); 45 | PrefabUtility.ReplacePrefab(animationObj, prefab, ReplacePrefabOptions.ConnectToPrefab); 46 | 47 | // destory game object 48 | GameObject.DestroyImmediate(animationObj); 49 | 50 | } 51 | 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/Standard Assets/UUnit/UUnitSelfTest/TestCaseTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class TestCaseTest : UUnitTestCase 4 | { 5 | 6 | [UUnitTest] 7 | public void TestRunning () 8 | { 9 | TestCaseDummy local = new TestCaseDummy ("TestMethod"); 10 | UUnitAssert.False (local.wasRun, " not wasRun"); 11 | local.Run (); 12 | UUnitAssert.True (local.wasRun, "wasRun"); 13 | } 14 | 15 | [UUnitTest] 16 | void TestSetUp () 17 | { 18 | TestCaseDummy local = new TestCaseDummy ("TestMethod"); 19 | local.Run (); 20 | UUnitAssert.True (local.wasSetUp, "wasSetUp"); 21 | UUnitAssert.Equals (local.log, "setUp ", "setup"); 22 | } 23 | 24 | [UUnitTest] 25 | public void TestResult () 26 | { 27 | TestCaseDummy local = new TestCaseDummy ("TestMethod"); 28 | UUnitTestResult result = local.Run (); 29 | UUnitAssert.Equals ("1 run, 0 failed", result.Summary (), "testResult"); 30 | } 31 | 32 | [UUnitTest] 33 | public void TestFailure () 34 | { 35 | TestCaseDummy local = new TestCaseDummy ("TestFail"); 36 | UUnitTestResult result = local.Run (); 37 | UUnitAssert.Equals ("1 run, 1 failed", result.Summary (), "Failure"); 38 | } 39 | 40 | [UUnitTest] 41 | public void TestTestSuiteAdd () 42 | { 43 | UUnitTestSuite suite = new UUnitTestSuite (); 44 | suite.Add (new TestCaseDummy ("TestMethod")); 45 | suite.Add (new TestCaseDummy ("TestFail")); 46 | UUnitTestResult result = suite.Run (); 47 | UUnitAssert.Equals ("2 run, 1 failed", result.Summary (), "Suite"); 48 | } 49 | 50 | [UUnitTest] 51 | public void TestTestSuiteAddAll () 52 | { 53 | UUnitTestSuite suite = new UUnitTestSuite (); 54 | suite.AddAll (typeof(TestCaseDummy)); 55 | UUnitTestResult result = suite.Run (); 56 | UUnitAssert.Equals ("2 run, 1 failed", result.Summary (), "Suite"); 57 | } 58 | 59 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Sprite/MultiSetSprite.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | namespace Tang { 5 | 6 | [ExecuteInEditMode] 7 | public class MultiSetSprite : MultiFrameSprite { 8 | 9 | #region Public Fields 10 | public FrameSet[] frameSets; 11 | public string m_currentSetName = null; 12 | #endregion 13 | 14 | #region Private Fields 15 | private Dictionary frameSetTable = new Dictionary(); 16 | #endregion 17 | 18 | #region Public Properties 19 | public string currentSetName { 20 | get{ 21 | return m_currentSetName; 22 | } 23 | set{ 24 | if( frameSetTable.ContainsKey(value) && m_currentSetName != value ){ 25 | m_currentSetName = value; 26 | frames = frameSetTable[m_currentSetName].frames; 27 | CurrentFrame = frames[0]; 28 | } 29 | } 30 | } 31 | #endregion 32 | 33 | #region Mono Method 34 | // Use this for initialization 35 | void Awake () { 36 | 37 | if( frameSets != null && frameSets.Length > 0 ) { 38 | 39 | // init --- 40 | base.Init(); 41 | 42 | foreach ( FrameSet frameSet in frameSets ) { 43 | frameSetTable.Add(frameSet.name, frameSet); 44 | } 45 | 46 | if ( m_currentSetName == null || !frameSetTable.ContainsKey(m_currentSetName) ) { 47 | m_currentSetName = frameSets[0].name; 48 | } 49 | 50 | frames = frameSetTable[m_currentSetName].frames; 51 | 52 | m_maxIndex = frames.Length - 1; 53 | 54 | if( m_currentIndex > m_maxIndex ){ 55 | m_currentIndex = m_maxIndex; 56 | } else if( m_currentIndex < 0 ){ 57 | m_currentIndex = 0; 58 | } 59 | 60 | CurrentFrame = frames[m_currentIndex]; 61 | 62 | // --- 63 | } 64 | } 65 | #endregion 66 | 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /Tang.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2008 3 | 4 | Project("{F7F873BE-EF2F-6B2E-FC35-3CDB25DA76D0}") = "Tang", "Assembly-CSharp-firstpass.csproj", "{268B973C-9BCD-9946-9C18-9C10ABB81B5C}" 5 | EndProject 6 | Project("{F7F873BE-EF2F-6B2E-FC35-3CDB25DA76D0}") = "Tang", "Assembly-CSharp-Editor-firstpass.csproj", "{FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | GlobalSection(MonoDevelopProperties) = preSolution 27 | StartupItem = Assembly-CSharp.csproj 28 | Policies = $0 29 | $0.TextStylePolicy = $1 30 | $1.inheritsSet = null 31 | $1.scope = text/x-csharp 32 | $0.CSharpFormattingPolicy = $2 33 | $2.inheritsSet = Mono 34 | $2.inheritsScope = text/x-csharp 35 | $2.scope = text/x-csharp 36 | $0.TextStylePolicy = $3 37 | $3.FileWidth = 120 38 | $3.TabWidth = 4 39 | $3.EolMarker = Unix 40 | $3.inheritsSet = Mono 41 | $3.inheritsScope = text/plain 42 | $3.scope = text/plain 43 | EndGlobalSection 44 | 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /Tang-csharp.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2008 3 | 4 | Project("{F7F873BE-EF2F-6B2E-FC35-3CDB25DA76D0}") = "Tang", "Assembly-CSharp-firstpass-vs.csproj", "{268B973C-9BCD-9946-9C18-9C10ABB81B5C}" 5 | EndProject 6 | Project("{F7F873BE-EF2F-6B2E-FC35-3CDB25DA76D0}") = "Tang", "Assembly-CSharp-Editor-firstpass-vs.csproj", "{FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | GlobalSection(MonoDevelopProperties) = preSolution 27 | StartupItem = Assembly-CSharp.csproj 28 | Policies = $0 29 | $0.TextStylePolicy = $1 30 | $1.inheritsSet = null 31 | $1.scope = text/x-csharp 32 | $0.CSharpFormattingPolicy = $2 33 | $2.inheritsSet = Mono 34 | $2.inheritsScope = text/x-csharp 35 | $2.scope = text/x-csharp 36 | $0.TextStylePolicy = $3 37 | $3.FileWidth = 120 38 | $3.TabWidth = 4 39 | $3.EolMarker = Unix 40 | $3.inheritsSet = Mono 41 | $3.inheritsScope = text/plain 42 | $3.scope = text/plain 43 | EndGlobalSection 44 | 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]in/ 3 | [Oo]bj/ 4 | Library/ 5 | Temp/ 6 | 7 | # mstest test results 8 | TestResults 9 | 10 | ## Ignore Visual Studio temporary files, build results, and 11 | ## files generated by popular Visual Studio add-ons. 12 | 13 | # User-specific files 14 | *.suo 15 | *.user 16 | *.sln.docstates 17 | 18 | # Build results 19 | [Dd]ebug/ 20 | [Rr]elease/ 21 | x64/ 22 | *_i.c 23 | *_p.c 24 | *.ilk 25 | *.meta 26 | *.obj 27 | *.pch 28 | *.pdb 29 | *.pgc 30 | *.pgd 31 | *.rsp 32 | *.sbr 33 | *.tlb 34 | *.tli 35 | *.tlh 36 | *.tmp 37 | *.log 38 | *.vspscc 39 | *.vssscc 40 | .builds 41 | 42 | # Visual C++ cache files 43 | ipch/ 44 | *.aps 45 | *.ncb 46 | *.opensdf 47 | *.sdf 48 | 49 | # Visual Studio profiler 50 | *.psess 51 | *.vsp 52 | *.vspx 53 | 54 | # Guidance Automation Toolkit 55 | *.gpState 56 | 57 | # ReSharper is a .NET coding add-in 58 | _ReSharper* 59 | 60 | # NCrunch 61 | *.ncrunch* 62 | .*crunch*.local.xml 63 | 64 | # Installshield output folder 65 | [Ee]xpress 66 | 67 | # DocProject is a documentation generator add-in 68 | DocProject/buildhelp/ 69 | DocProject/Help/*.HxT 70 | DocProject/Help/*.HxC 71 | DocProject/Help/*.hhc 72 | DocProject/Help/*.hhk 73 | DocProject/Help/*.hhp 74 | DocProject/Help/Html2 75 | DocProject/Help/html 76 | 77 | # Click-Once directory 78 | publish 79 | 80 | # Publish Web Output 81 | *.Publish.xml 82 | 83 | # NuGet Packages Directory 84 | packages 85 | 86 | # Windows Azure Build Output 87 | csx 88 | *.build.csdef 89 | 90 | # Windows Store app package directory 91 | AppPackages/ 92 | 93 | # Others 94 | [Bb]in 95 | [Oo]bj 96 | sql 97 | TestResults 98 | [Tt]est[Rr]esult* 99 | *.Cache 100 | ClientBin 101 | [Ss]tyle[Cc]op.* 102 | ~$* 103 | *.dbmdl 104 | Generated_Code #added for RIA/Silverlight projects 105 | 106 | # Backup & report files from converting an old project file to a newer 107 | # Visual Studio version. Backup files are not needed, because we have git ;-) 108 | _UpgradeReport_Files/ 109 | Backup*/ 110 | UpgradeLog*.XML 111 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/Tang/TangEditorCommand.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections; 4 | 5 | namespace Tang { 6 | 7 | public class EditorCommand { 8 | 9 | [MenuItem ("Tang/1. Make Sprites From Selection")] 10 | public static void MakePrefabs(){ 11 | 12 | foreach(Object obj in Selection.objects){ 13 | if(obj is TextAsset){ 14 | Maker.Make(obj as TextAsset); 15 | } 16 | } 17 | } 18 | 19 | [MenuItem("Tang/2. Generate Animations From Selection")] 20 | public static void GenerateAnimation(){ 21 | 22 | foreach(Object obj in Selection.objects){ 23 | AnimationGenerator.GenerateAnimation(obj as GameObject); 24 | } 25 | } 26 | 27 | [MenuItem("Tang/3.0 Build AssetBundles From - Track dependencies Selection - Android")] 28 | public static void BuildAssetBundlesAndroid(){ 29 | 30 | string dirPath = EditorUtility.SaveFolderPanel("Save AssetBundles to directory", "", ""); 31 | if (dirPath.Length != 0) { 32 | 33 | foreach(UnityEngine.Object obj in Selection.objects){ 34 | 35 | string filepath = dirPath + "/" + obj.name + ".assetbundle"; 36 | 37 | BuildPipeline.BuildAssetBundle(obj, null, filepath 38 | , BuildAssetBundleOptions.CollectDependencies 39 | | BuildAssetBundleOptions.CompleteAssets 40 | ,BuildTarget.Android); 41 | 42 | } 43 | 44 | } 45 | } 46 | 47 | [MenuItem("Tang/3.1 Build AssetBundles From - Track dependencies Selection - WebPlayerStreamed")] 48 | public static void BuildAssetBundlesWebPlayer(){ 49 | 50 | string dirPath = EditorUtility.SaveFolderPanel("Save AssetBundles to directory", "", ""); 51 | if (dirPath.Length != 0) { 52 | 53 | foreach(UnityEngine.Object obj in Selection.objects){ 54 | 55 | string filepath = dirPath + "/" + obj.name + ".assetbundle"; 56 | 57 | BuildPipeline.BuildAssetBundle(obj, null, filepath 58 | , BuildAssetBundleOptions.CollectDependencies 59 | | BuildAssetBundleOptions.CompleteAssets 60 | ,BuildTarget.WebPlayerStreamed); 61 | } 62 | } 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang-Test/Scene/SpriteAnimationTest/SpriteAnimationTestCase.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace Tang 5 | { 6 | 7 | public class SpriteAnimationTestCase : UUnitTestCase { 8 | 9 | private string clothesPath = "Tang-Test/Output/MultiSet/Prefab/player_lygf0"; 10 | private string weaponPath = "Tang-Test/Output/MultiSet/Prefab/weapon_hf3"; 11 | private string clothesPath1 = "Tang-Test/Output/MultiSet/Prefab/player_lygf1"; 12 | 13 | private Sprite clothesPrefab = null; 14 | private Sprite weaponPrefab = null; 15 | private Sprite clothesPrefab1 = null; 16 | 17 | private SpriteAnimation animation = null; 18 | 19 | protected override void SetUp(){ 20 | 21 | animation = GameObject.FindObjectOfType(typeof(SpriteAnimation)) as SpriteAnimation; 22 | UUnitAssert.NotNull(Resources.Load(clothesPath)); 23 | GameObject clothesGo = Resources.Load(clothesPath) as GameObject; 24 | GameObject weaponGo = Resources.Load(weaponPath) as GameObject; 25 | GameObject clothesGo1 = Resources.Load(clothesPath1) as GameObject; 26 | 27 | clothesPrefab = clothesGo.GetComponent(); 28 | weaponPrefab = weaponGo.GetComponent(); 29 | clothesPrefab1 = clothesGo1.GetComponent(); 30 | 31 | } 32 | 33 | [UUnitTest] 34 | public void TestAllMethods(){ 35 | 36 | PrefixTest(); 37 | 38 | SpriteLayer clothesLayer = new ClothesLayer(); 39 | 40 | SpriteLayer weaponLayer = new WeaponLayer(); 41 | 42 | animation.PutLayer(clothesLayer); 43 | animation.PutLayer(weaponLayer); 44 | 45 | 46 | if(animation.IsPlaying){ 47 | animation.Stop(); 48 | UUnitAssert.False(animation.IsPlaying); 49 | animation.Play(); 50 | UUnitAssert.True(animation.IsPlaying); 51 | } else { 52 | animation.Play(); 53 | UUnitAssert.True(animation.IsPlaying); 54 | animation.Stop(); 55 | UUnitAssert.False(animation.IsPlaying); 56 | } 57 | 58 | weaponLayer = animation.GetLayer(LayerID.WEAPON); 59 | UUnitAssert.NotNull(weaponLayer); 60 | animation.Clear(weaponLayer); 61 | 62 | weaponLayer = animation.GetLayer(weaponLayer.id); 63 | UUnitAssert.NotNull(weaponLayer); 64 | weaponLayer.spritePrefab = weaponPrefab; 65 | animation.PutLayer(weaponLayer); 66 | 67 | animation.Open(clothesPrefab1, LayerID.CLOTHES); 68 | 69 | 70 | } 71 | 72 | 73 | 74 | private void PrefixTest(){ 75 | 76 | UUnitAssert.NotNull(animation); 77 | UUnitAssert.NotNull(clothesPrefab); 78 | UUnitAssert.NotNull(weaponPrefab); 79 | 80 | } 81 | 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Sprite/Sprite.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace Tang { 5 | 6 | public class Sprite : MonoBehaviour { 7 | 8 | #region Public Fields 9 | public bool m_flipHorizontal = false; 10 | public bool m_flipVertical = false; 11 | public int m_currentIndex = 0; 12 | #endregion 13 | 14 | #region Protected Fields 15 | protected int m_maxIndex = 0; 16 | #endregion 17 | 18 | #region Private Fields 19 | private MeshFilter mf = null; 20 | private bool frameUpdated = false; 21 | private Frame m_currentFrame = null; 22 | #endregion 23 | 24 | #region Public Properties 25 | public int maxIndex { 26 | get { return m_maxIndex;} 27 | } 28 | public virtual int currentIndex { 29 | get { return m_currentIndex; } 30 | set { m_currentIndex = value; } 31 | } 32 | public Frame CurrentFrame { 33 | get { 34 | return m_currentFrame; 35 | } 36 | set { 37 | if(value != null){ 38 | m_currentFrame = value; 39 | frameUpdated = true; 40 | } 41 | } 42 | } 43 | public bool flipHorizontal { 44 | get { return m_flipHorizontal; } 45 | set { 46 | if( m_flipHorizontal != value ) { 47 | m_flipHorizontal = value; 48 | frameUpdated = true; 49 | } 50 | } 51 | } 52 | public bool flipVertical { 53 | get { return m_flipVertical; } 54 | set { 55 | if( m_flipVertical != value ){ 56 | m_flipVertical = value; 57 | frameUpdated = true; 58 | } 59 | } 60 | } 61 | #endregion 62 | 63 | #region Protected Methods 64 | protected void Init(){ 65 | InitComponents(); 66 | } 67 | 68 | protected void InitComponents(){ 69 | 70 | mf = gameObject.GetComponent(); 71 | if(mf == null) 72 | mf = gameObject.AddComponent(); 73 | Mesh mesh = MeshOne.NewMesh(); 74 | mf.mesh = mesh; 75 | 76 | } 77 | 78 | protected void UpdateMesh(Frame fr){ 79 | 80 | Vector2[] uv = fr.uv; 81 | 82 | if( flipHorizontal ){ 83 | uv = new Vector2[fr.uv.Length]; 84 | for(int i=0; i 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-Editor-firstpass 13 | v3.5 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | Temp\bin\Debug\ 21 | DEBUG;TRACE;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PHYSICS;ENABLE_TERRAIN;ENABLE_CACHING;ENABLE_SUBSTANCE;ENABLE_GENERICS;ENABLE_CLOTH;ENABLE_MOVIES;ENABLE_AUDIO;ENABLE_WWW;ENABLE_SHADOWS;ENABLE_DUCK_TYPING;UNITY_4_1_0;UNITY_4_1;ENABLE_PROFILER;UNITY_EDITOR;UNITY_TEAM_LICENSE 22 | prompt 23 | 4 24 | 0169 25 | 26 | 27 | pdbonly 28 | true 29 | Temp\bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 0169 34 | 35 | 36 | 37 | 38 | 39 | 40 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll 41 | 42 | 43 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | C:\Program Files (x86)\Unity\Editor\Data\Managed\UnityEditor.Graphs.dll 59 | 60 | 61 | 62 | 63 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C} Assembly-CSharp-firstpass 64 | 65 | 66 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Assembly-CSharp-Editor-firstpass-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {FFA8E0F0-89AF-52B5-3DD4-2E3FA2C3005E} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-Editor-firstpass 13 | v3.5 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | Temp\bin\Debug\ 21 | DEBUG;TRACE;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PHYSICS;ENABLE_TERRAIN;ENABLE_CACHING;ENABLE_SUBSTANCE;ENABLE_GENERICS;ENABLE_CLOTH;ENABLE_MOVIES;ENABLE_AUDIO;ENABLE_WWW;ENABLE_SHADOWS;ENABLE_DUCK_TYPING;UNITY_4_1_0;UNITY_4_1;ENABLE_PROFILER;UNITY_EDITOR;UNITY_TEAM_LICENSE 22 | prompt 23 | 4 24 | 0169 25 | 26 | 27 | pdbonly 28 | true 29 | Temp\bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 0169 34 | 35 | 36 | 37 | 38 | 39 | 40 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll 41 | 42 | 43 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | C:\Program Files (x86)\Unity\Editor\Data\Managed\UnityEditor.Graphs.dll 59 | 60 | 61 | 62 | 63 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C} Assembly-CSharp-firstpass-vs 64 | 65 | 66 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Assets/Standard Assets/UUnit/UUnitAssert.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | 4 | public class UUnitAssert 5 | { 6 | public static double DEFAULT_DOUBLE_PRECISION = 0.000001; 7 | 8 | private UUnitAssert () 9 | { 10 | } 11 | 12 | public static void Fail () 13 | { 14 | throw new UUnitAssertException ("fail"); 15 | } 16 | 17 | public static void True (bool boolean, string message) 18 | { 19 | if (boolean) { 20 | return; 21 | } 22 | throw new UUnitAssertException (true, false, message); 23 | } 24 | 25 | public static void True (bool boolean) 26 | { 27 | if (boolean) { 28 | return; 29 | } 30 | throw new UUnitAssertException (true, false); 31 | } 32 | 33 | public static void False (bool boolean, string message) 34 | { 35 | if (!boolean) { 36 | return; 37 | } 38 | throw new UUnitAssertException (false, true, message); 39 | } 40 | 41 | public static void False (bool boolean) 42 | { 43 | if (!boolean) { 44 | return; 45 | } 46 | throw new UUnitAssertException (false, true); 47 | } 48 | 49 | public static void NotNull (object something) 50 | { 51 | if (something != null) { 52 | return; 53 | } 54 | throw new UUnitAssertException ("Null object"); 55 | } 56 | 57 | public static void Null (object something) 58 | { 59 | if (something == null) { 60 | return; 61 | } 62 | throw new UUnitAssertException ("Not null object"); 63 | } 64 | 65 | public static void Equals (string wanted, string got, string message) 66 | { 67 | if (wanted == got) { 68 | return; 69 | } 70 | throw new UUnitAssertException (wanted, got, message); 71 | } 72 | 73 | public static void Equals (string wanted, string got) 74 | { 75 | if (wanted == got) 76 | return; 77 | throw new UUnitAssertException (wanted, got); 78 | } 79 | 80 | public static void Equals (int wanted, int got, string message) 81 | { 82 | if (wanted == got) { 83 | return; 84 | } 85 | throw new UUnitAssertException (wanted, got, message); 86 | } 87 | 88 | public static void Equals (int wanted, int got) 89 | { 90 | if (wanted == got) { 91 | return; 92 | } 93 | throw new UUnitAssertException (wanted, got); 94 | } 95 | 96 | public static void Equals (double wanted, double got, double precision) 97 | { 98 | if (Math.Abs (wanted - got) < precision) { 99 | return; 100 | } 101 | throw new UUnitAssertException (wanted, got); 102 | } 103 | 104 | public static void Equals (double wanted, double got) 105 | { 106 | Equals (wanted, got, DEFAULT_DOUBLE_PRECISION); 107 | } 108 | 109 | public static void Equals (char wanted, char got) 110 | { 111 | if (wanted == got) { 112 | return; 113 | } 114 | throw new UUnitAssertException (wanted, got); 115 | } 116 | 117 | public static void Equals (Vector3 wanted, Vector3 got) 118 | { 119 | Equals (wanted, got, DEFAULT_DOUBLE_PRECISION); 120 | } 121 | 122 | public static void Equals (Vector3 wanted, Vector3 got, double precision) 123 | { 124 | if (Math.Abs (wanted.x - got.x) < precision && 125 | Math.Abs (wanted.y - got.y) < precision && 126 | Math.Abs (wanted.z - got.z) < precision) 127 | return; 128 | throw new UUnitAssertException (wanted, got); 129 | } 130 | 131 | public static void Equals (Vector3 wanted, Vector3 got, string message) 132 | { 133 | Equals (wanted, got, message, DEFAULT_DOUBLE_PRECISION); 134 | } 135 | 136 | public static void Equals (Vector3 wanted, Vector3 got, string message, double precision) 137 | { 138 | if (Math.Abs (wanted.x - got.x) < precision && 139 | Math.Abs (wanted.y - got.y) < precision && 140 | Math.Abs (wanted.z - got.z) < precision) 141 | return; 142 | throw new UUnitAssertException (wanted, got, message); 143 | } 144 | 145 | public static void Equals (object wanted, object got, string message) 146 | { 147 | if (wanted == got) { 148 | return; 149 | } 150 | throw new UUnitAssertException (wanted, got, message); 151 | } 152 | 153 | public new static void Equals (object wanted, object got) 154 | { 155 | if (wanted == got) { 156 | return; 157 | } 158 | throw new UUnitAssertException (wanted, got); 159 | } 160 | 161 | } 162 | -------------------------------------------------------------------------------- /Assembly-CSharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {DEA6BE0E-5DF3-A509-429F-1D54AAE83DAB} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp 13 | v3.5 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | Temp\bin\Debug\ 21 | DEBUG;TRACE;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PHYSICS;ENABLE_TERRAIN;ENABLE_CACHING;ENABLE_SUBSTANCE;ENABLE_GENERICS;ENABLE_CLOTH;ENABLE_MOVIES;ENABLE_AUDIO;ENABLE_WWW;ENABLE_SHADOWS;ENABLE_DUCK_TYPING;UNITY_4_1_0;UNITY_4_1;ENABLE_PROFILER;UNITY_EDITOR;UNITY_TEAM_LICENSE 22 | prompt 23 | 4 24 | 0169 25 | 26 | 27 | pdbonly 28 | true 29 | Temp\bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 0169 34 | 35 | 36 | 37 | 38 | 39 | 40 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll 41 | 42 | 43 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C} Assembly-CSharp-firstpass 69 | 70 | 71 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /Assembly-CSharp-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {DEA6BE0E-5DF3-A509-429F-1D54AAE83DAB} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp 13 | v3.5 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | Temp\bin\Debug\ 21 | DEBUG;TRACE;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PHYSICS;ENABLE_TERRAIN;ENABLE_CACHING;ENABLE_SUBSTANCE;ENABLE_GENERICS;ENABLE_CLOTH;ENABLE_MOVIES;ENABLE_AUDIO;ENABLE_WWW;ENABLE_SHADOWS;ENABLE_DUCK_TYPING;UNITY_4_1_0;UNITY_4_1;ENABLE_PROFILER;UNITY_EDITOR;UNITY_TEAM_LICENSE 22 | prompt 23 | 4 24 | 0169 25 | 26 | 27 | pdbonly 28 | true 29 | Temp\bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 0169 34 | 35 | 36 | 37 | 38 | 39 | 40 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll 41 | 42 | 43 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C} Assembly-CSharp-firstpass-vs 69 | 70 | 71 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/Tang/AtlasCocos2DParser.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/7/30 5 | * Time: 22:31 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using UnityEngine; 10 | using System.Collections; 11 | using System.Collections.Generic; 12 | using System.Xml; 13 | 14 | 15 | namespace Tang 16 | { 17 | /// 18 | /// Description of AtlasCocos2DImporter. 19 | /// 20 | public class AtlasCocos2DParser : AtlasXmlParser 21 | { 22 | 23 | public XmlNode subTexture = null; 24 | 25 | public AtlasCocos2DParser(string text){ 26 | this.text = text; 27 | } 28 | 29 | public override Atlas Parse() { 30 | 31 | if (!ValidXML()) 32 | return null; 33 | 34 | Vector2 sheetSize = Vector2.zero; 35 | List data = new List(); 36 | string name = null; 37 | 38 | if ( xml.DocumentElement.Name == "plist" ) { 39 | XmlNodeList nodeList = xml.DocumentElement.SelectNodes("dict/key"); 40 | for (int i=0; i0) 89 | name = sa[0]; 90 | } 91 | } 92 | } 93 | } 94 | 95 | Atlas atlas = new Atlas(); 96 | atlas.atlasData = data.ToArray(); 97 | atlas.sheetSize = sheetSize; 98 | atlas.name = name; 99 | 100 | return atlas; 101 | } 102 | 103 | private Vector2 StringToVector2(string s) 104 | { 105 | string _s = s.Substring(1, s.Length - 2); 106 | string[] sa = _s.Split(','); 107 | return new Vector2(System.Convert.ToSingle(sa[0]), System.Convert.ToSingle(sa[1])); 108 | } 109 | 110 | private Rect StringToRect(string s) 111 | { 112 | string _s = s.Substring(1, s.Length - 2); 113 | string[] sa = _s.Split(new string[] { "},{" }, System.StringSplitOptions.None); 114 | Vector2 v1 = StringToVector2(sa[0]+"}"); 115 | Vector2 v2 = StringToVector2("{"+sa[1]); 116 | return new Rect(v1.x, v1.y, v2.x, v2.y); 117 | } 118 | 119 | private Rect GetRect(string name) 120 | { 121 | XmlNode nameNode = subTexture.SelectSingleNode("key[.='" + name + "']"); 122 | if (nameNode != null) 123 | { 124 | XmlNode stringNode = nameNode.NextSibling; 125 | return StringToRect(stringNode.InnerText); 126 | } 127 | return new Rect(0, 0, 0, 0); 128 | } 129 | 130 | private Vector2 GetVector2(string name) 131 | { 132 | XmlNode nameNode = subTexture.SelectSingleNode("key[.='" + name + "']"); 133 | if (nameNode != null) 134 | { 135 | XmlNode stringNode = nameNode.NextSibling; 136 | return StringToVector2(stringNode.InnerText); 137 | } 138 | return Vector2.zero; 139 | } 140 | 141 | private bool GetBool(string name) 142 | { 143 | XmlNode nameNode = subTexture.SelectSingleNode("key[.='" + name + "']"); 144 | if (nameNode != null) 145 | { 146 | XmlNode boolNode = nameNode.NextSibling; 147 | return (boolNode.Name.ToLower() == "true"); 148 | } 149 | return false; 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /Assembly-CSharp-firstpass-vs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-firstpass 13 | v3.5 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | Temp\bin\Debug\ 21 | DEBUG;TRACE;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PHYSICS;ENABLE_TERRAIN;ENABLE_CACHING;ENABLE_SUBSTANCE;ENABLE_GENERICS;ENABLE_CLOTH;ENABLE_MOVIES;ENABLE_AUDIO;ENABLE_WWW;ENABLE_SHADOWS;ENABLE_DUCK_TYPING;UNITY_4_1_0;UNITY_4_1;ENABLE_PROFILER;UNITY_EDITOR;UNITY_TEAM_LICENSE 22 | prompt 23 | 4 24 | 0169 25 | 26 | 27 | pdbonly 28 | true 29 | Temp\bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 0169 34 | 35 | 36 | 37 | 38 | 39 | 40 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll 41 | 42 | 43 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /Assembly-CSharp-firstpass.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {268B973C-9BCD-9946-9C18-9C10ABB81B5C} 9 | Library 10 | Properties 11 | 12 | Assembly-CSharp-firstpass 13 | v3.5 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | Temp\bin\Debug\ 21 | DEBUG;TRACE;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_IMAGEEFFECTS;ENABLE_WEBCAM;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PHYSICS;ENABLE_TERRAIN;ENABLE_CACHING;ENABLE_SUBSTANCE;ENABLE_GENERICS;ENABLE_CLOTH;ENABLE_MOVIES;ENABLE_AUDIO;ENABLE_WWW;ENABLE_SHADOWS;ENABLE_DUCK_TYPING;UNITY_4_1_0;UNITY_4_1;ENABLE_PROFILER;UNITY_EDITOR;UNITY_TEAM_LICENSE 22 | prompt 23 | 4 24 | 0169 25 | 26 | 27 | pdbonly 28 | true 29 | Temp\bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 0169 34 | 35 | 36 | 37 | 38 | 39 | 40 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEngine.dll 41 | 42 | 43 | C:/Program Files (x86)/Unity/Editor/Data/Managed/UnityEditor.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Editor/Tang/Maker.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/7/30 5 | * Time: 23:40 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Collections.Generic; 11 | using UnityEngine; 12 | using UnityEditor; 13 | 14 | namespace Tang 15 | { 16 | /// 17 | /// Description of Maker. 18 | /// 19 | public class Maker 20 | { 21 | 22 | 23 | public static void Make(TextAsset textAsset){ 24 | 25 | // input 26 | // Assets/Tang/Input/MultiSet/Data/mount_0.xml 27 | string textAssetPath = AssetDatabase.GetAssetPath(textAsset); 28 | string textAssetDirPath = textAssetPath.Substring(0,textAssetPath.LastIndexOf('/')); 29 | string texturePath = textAssetPath.Replace("Data","Textures").Replace(".xml",".png"); 30 | // output 31 | string matAlphaPath = textAssetPath.Replace("Input","Output").Replace("Data","Materials").Replace(".xml","-alpha.mat"); 32 | string prefabDirPath = textAssetDirPath.Replace("Input","Output").Replace("Data","Prefabs"); 33 | // parameters 34 | string[] splits = textAssetPath.Split(new Char[]{'/'}); 35 | string resName = splits[splits.Length - 1].Split(new Char[]{'.'})[0]; 36 | 37 | // parse data 38 | AtlasParser parser = new AtlasCocos2DParser(textAsset.text); 39 | Atlas atls = parser.Parse(); 40 | MidFrame[] midFrames = atls.GetMidFrames(); 41 | 42 | // create material 43 | Material matAlpha = new Material(Shader.Find("Mobile/Particles/Alpha Blended")); 44 | matAlpha.name = resName + "_alpha"; 45 | matAlpha.mainTexture = AssetDatabase.LoadAssetAtPath(texturePath, typeof(Texture)) as Texture; 46 | AssetDatabase.CreateAsset(matAlpha, matAlphaPath); 47 | 48 | string spriteType = splits[splits.Length-3]; 49 | 50 | if( "MultiSet".Equals(spriteType) ){ 51 | 52 | Dictionary> frameTable = new Dictionary>(); 53 | foreach( MidFrame frame in midFrames ){ 54 | 55 | string[] frameNamesplits = frame.name.Split(new Char[]{ '_' }); 56 | string key = frameNamesplits[0]; 57 | //string index = frameNamesplits[1]; 58 | 59 | List frameList = null; 60 | if( !frameTable.ContainsKey(key) ) { 61 | frameList = new List(); 62 | frameTable.Add(key, frameList); 63 | } else { 64 | frameList = frameTable[key]; 65 | } 66 | 67 | frameList.Add(frame); 68 | 69 | } 70 | 71 | List frameSets = new List(); 72 | foreach( KeyValuePair> kvp in frameTable ) 73 | { 74 | FrameSet frameSet = new FrameSet(kvp.Key, kvp.Value.ToArray()); 75 | frameSets.Add(frameSet); 76 | } 77 | 78 | 79 | // create game object 80 | GameObject go = new GameObject(); 81 | go.name = resName; 82 | 83 | MultiSetSprite sprite = go.AddComponent(); 84 | sprite.frameSets = frameSets.ToArray(); 85 | 86 | // mesh reader 87 | MeshRenderer mr = go.AddComponent(); 88 | mr.material = matAlpha; 89 | mr.castShadows = false; 90 | mr.receiveShadows = false; 91 | 92 | // create prefab 93 | // output prefab path 94 | string prefabPath = prefabDirPath + "/" + resName + ".prefab"; 95 | UnityEngine.Object prefab = PrefabUtility.CreateEmptyPrefab(prefabPath); 96 | PrefabUtility.ReplacePrefab(go, prefab, ReplacePrefabOptions.ConnectToPrefab); 97 | 98 | // destory game object 99 | GameObject.DestroyImmediate(go); 100 | 101 | } else if( "MultiFrame".Equals(spriteType) ){ 102 | 103 | // create game object 104 | GameObject go = new GameObject(); 105 | go.name = resName; 106 | 107 | MultiFrameSprite sprite = go.AddComponent(); 108 | sprite.frames = midFrames; 109 | 110 | // mesh reader 111 | MeshRenderer mr = go.AddComponent(); 112 | mr.material = matAlpha; 113 | mr.castShadows = false; 114 | mr.receiveShadows = false; 115 | 116 | // create prefab 117 | // output prefab path 118 | string prefabPath = prefabDirPath + "/" + resName + ".prefab"; 119 | UnityEngine.Object prefab = PrefabUtility.CreateEmptyPrefab(prefabPath); 120 | PrefabUtility.ReplacePrefab(go, prefab, ReplacePrefabOptions.ConnectToPrefab); 121 | 122 | // destory game object 123 | GameObject.DestroyImmediate(go); 124 | 125 | 126 | 127 | } else if( "SingleFrame".Equals(spriteType) ){ 128 | 129 | foreach( MidFrame frame in midFrames ){ 130 | GameObject go = new GameObject(); 131 | go.name = resName + frame.name.Replace('/','_'); 132 | 133 | SingleFrameSprite sprite = go.AddComponent(); 134 | sprite.fr = frame; 135 | 136 | // mesh reader 137 | MeshRenderer mr = go.AddComponent(); 138 | mr.material = matAlpha; 139 | mr.castShadows = false; 140 | mr.receiveShadows = false; 141 | 142 | // create prefab 143 | // output prefab path 144 | string prefabPath = prefabDirPath + "/" + go.name + ".prefab"; 145 | UnityEngine.Object prefab = PrefabUtility.CreateEmptyPrefab(prefabPath); 146 | PrefabUtility.ReplacePrefab(go, prefab, ReplacePrefabOptions.ConnectToPrefab); 147 | 148 | // destory game object 149 | GameObject.DestroyImmediate(go); 150 | 151 | } 152 | 153 | } 154 | 155 | } 156 | 157 | 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Tang/Animation/SpriteAnimation.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Created by SharpDevelop. 3 | * User: zzc 4 | * Date: 2013/8/6 5 | * Time: 17:48 6 | * 7 | * To change this template use Tools | Options | Coding | Edit Standard Headers. 8 | */ 9 | using System; 10 | using System.Collections.Generic; 11 | using UnityEngine; 12 | 13 | namespace Tang 14 | { 15 | /// 16 | /// Description of Animation. 17 | /// 18 | [ExecuteInEditMode] 19 | public class SpriteAnimation : MonoBehaviour 20 | { 21 | /// 22 | /// Prefab 23 | /// 24 | public SpriteLayer[] layers; // 层 1...* 25 | public int loop = -1; // 播放次数,<0 表示无限循环播放 26 | public int fps = Tang.FPS; // FPS,每秒多少帧 27 | public int m_currentIndex = 0; // 当前放到第几帧 28 | public bool m_flipHorizontal = false; // 是否水平翻转 29 | public bool m_flipVertical = false; // 是否垂直翻转 30 | public float delay = 0F; // 延迟多少秒开始 31 | public bool playOnStart = false; // 在 Mono 的 Start() 方法执行播放 32 | 33 | // 委派 --- 34 | public delegate void Callback(SpriteAnimation animation); // 播放状态回调 35 | public Callback OnFirstFrame; // 播放最后一帧前回调 36 | public Callback OnLastFrame; // 播放第一帧前回调 37 | 38 | #region Private Fields 39 | private int maxIndex = 0; // 当前动画的最大帧的索引值,从0开始 40 | 41 | private float currentTime = 0F; // 当前帧已显示的时间,每一帧的现实时间不能超过 1F/FPS 42 | private bool playing = false; // 是否正在播放 43 | private float delayTimer = 0F; // 延迟计时器, 当计时器初始值 =delay,递减到0后开始播放内容 44 | private int loopCounter = 0; // 播放次数计算器 45 | #endregion 46 | 47 | #region Public Properties 48 | /// 49 | /// 当前帧索引,从0开始到 maxIndex 50 | /// 51 | public int currentIndex { 52 | get { 53 | return m_currentIndex; 54 | } 55 | private set { 56 | m_currentIndex = value; 57 | UpdateSpriteIndexes(); 58 | } 59 | } 60 | /// 61 | /// 是否水平翻转 62 | /// 63 | public bool flipHorizontal { 64 | get { return m_flipHorizontal; } 65 | set { 66 | m_flipHorizontal = value; 67 | foreach(SpriteLayer layer in layers){ 68 | if(layer.spriteInstance != null) 69 | layer.spriteInstance.flipHorizontal = m_flipHorizontal; 70 | } 71 | } 72 | } 73 | /// 74 | /// 是否垂直翻转 75 | /// 76 | public bool flipVertical { 77 | get { return m_flipVertical; } 78 | set { 79 | m_flipVertical = value; 80 | foreach(SpriteLayer layer in layers){ 81 | if(layer.spriteInstance != null) 82 | layer.spriteInstance.flipVertical = m_flipVertical; 83 | } 84 | } 85 | } 86 | /// 87 | /// 是否正在播放 88 | /// 89 | public bool IsPlaying{ 90 | get{ 91 | return playing; 92 | } 93 | } 94 | #endregion 95 | 96 | #region Public Method 97 | 98 | /// 99 | /// 将一个精灵层放入动画中 100 | /// 101 | /// 精灵层 102 | public void PutLayer(SpriteLayer layer){ 103 | 104 | if(layers == null || layers.Length == 0){ 105 | 106 | layers = new SpriteLayer[1]; 107 | layers[0] = layer; 108 | 109 | } else { 110 | 111 | // 判断是替换还是追加 112 | bool replace = false; 113 | for(int i=0; i(ref layers, layers.Length + 1); 124 | layers[layers.Length-1] = layer; 125 | } 126 | } 127 | 128 | InitLayer(layer); 129 | } 130 | 131 | /// 132 | /// 获取指定层,没有则返回 null 133 | /// 134 | /// 层ID 135 | /// 指定层,没有返回 null 136 | public SpriteLayer GetLayer( int layerId ){ 137 | 138 | foreach( SpriteLayer layer in layers ){ 139 | if( layer.id == layerId ) 140 | return layer; 141 | } 142 | return null; 143 | 144 | } 145 | 146 | /// 147 | /// 在指定层打开一个精灵 148 | /// 149 | /// 精灵 sprite 150 | /// 所在层 151 | public void Open( Sprite spritePrefab, int layerId ){ 152 | 153 | foreach( SpriteLayer layer in layers ){ 154 | if( layer.id == layerId ){ 155 | // 如果该层有内容,则重置该层的内容 156 | if(layer.spritePrefab != null){ 157 | Clear(layer); 158 | } 159 | 160 | layer.spritePrefab = spritePrefab; 161 | InitLayer(layer); 162 | break; 163 | } 164 | } 165 | } 166 | 167 | /// 168 | /// 清除指定层的精灵 169 | /// 170 | /// 层ID 171 | public void Clear(int layerId){ 172 | SpriteLayer layer = GetLayer(layerId); 173 | if( layer != null ){ 174 | Clear(layer); 175 | } 176 | } 177 | 178 | /// 179 | /// 清除指定层的精灵 180 | /// 181 | /// 层ID 182 | public void Clear(SpriteLayer layer){ 183 | if(layer.gameObject != null) { 184 | DestroyGobj(layer.gameObject); 185 | layer.gameObject = null; 186 | } 187 | layer.hidden = true; 188 | layer.maxIndex = 0; 189 | layer.spritePrefab = null; 190 | layer.spriteInstance = null; 191 | } 192 | /// 193 | /// 播放 194 | /// 195 | public void Play(){ 196 | playing = true; 197 | } 198 | /// 199 | /// 停止 200 | /// 201 | public void Stop(){ 202 | playing = false; 203 | Reset(); 204 | } 205 | #endregion 206 | 207 | #region Private Methods 208 | private void UpdateSpriteIndexes(){ 209 | 210 | if(layers != null) { 211 | 212 | foreach(SpriteLayer layer in layers){ 213 | 214 | if (layer.spriteInstance != null){ 215 | 216 | // 需要保证 sprite instance 不为 null 217 | 218 | int index = m_currentIndex - layer.frameDelay; 219 | if(index < 0 ){ 220 | if(layer.hiddenBeforeBegin && !layer.hidden){ 221 | HideLayer(layer, true); 222 | } 223 | } else if( index > layer.spriteInstance.maxIndex ){ 224 | if(layer.hiddenAfterEnd && !layer.hidden){ 225 | HideLayer(layer, true); 226 | } 227 | } else if( layer.hidden ) { 228 | HideLayer(layer, false); 229 | } 230 | 231 | layer.spriteInstance.currentIndex = index; 232 | } 233 | 234 | } 235 | } 236 | } 237 | private void Reset(){ 238 | currentIndex = 0; 239 | currentTime = 0F; 240 | delayTimer = delay; 241 | loopCounter = loop; 242 | } 243 | private void HideLayer(SpriteLayer layer, bool yes){ 244 | if(yes) { 245 | layer.hidden = true; 246 | layer.gameObject.transform.localScale = Vector3.zero; 247 | } else { 248 | layer.hidden = false; 249 | layer.gameObject.transform.localScale = Vector3.one; 250 | } 251 | } 252 | private void InitLayer(SpriteLayer layer){ 253 | 254 | // 确保层 gameObject 存在,没有则生成 255 | Transform layerTransform = transform.FindChild(layer.name); 256 | if( layerTransform == null ){ 257 | // game object of layer 258 | GameObject layerGo = new GameObject(); 259 | layerGo.transform.parent = transform; 260 | layerGo.name = layer.name; 261 | 262 | layer.gameObject = layerGo; 263 | 264 | } else { 265 | layer.gameObject = layerTransform.gameObject; 266 | // 获取精灵实例 267 | if(layerTransform.childCount > 0) 268 | { 269 | Sprite sprite = null; 270 | foreach(Transform child in layerTransform) 271 | { 272 | sprite = child.GetComponent(); 273 | if(sprite != null) 274 | { 275 | layer.spriteInstance = sprite; 276 | break; 277 | } 278 | } 279 | } 280 | } 281 | 282 | 283 | if( layer.spritePrefab != null ) 284 | { 285 | if( layer.spriteInstance != null ) 286 | { 287 | InitLayerBySpriteInstance(layer); 288 | } 289 | else 290 | { 291 | // 初始化 sprite 部分 292 | InitLayerBySprite(layer); 293 | 294 | } 295 | 296 | // 计算动画最大索引 297 | if( maxIndex < layer.maxIndex ) 298 | maxIndex = layer.maxIndex; 299 | 300 | // 该层是否需要隐藏 301 | if( layer.hiddenBeforeBegin ) { 302 | HideLayer(layer, true); 303 | } 304 | 305 | } 306 | else 307 | { 308 | HideLayer(layer, true); 309 | } 310 | 311 | } 312 | private void InitLayerBySprite(SpriteLayer layer){ 313 | 314 | if( layer.spritePrefab != null ){ 315 | Sprite sprite = Instantiate(layer.spritePrefab) as Sprite; 316 | layer.spriteInstance = sprite; 317 | sprite.transform.parent = layer.gameObject.transform; 318 | layer.maxIndex = sprite.maxIndex + layer.frameDelay; 319 | sprite.flipHorizontal = flipHorizontal; 320 | sprite.flipVertical = flipVertical; 321 | 322 | } 323 | } 324 | private void InitLayerBySpriteInstance(SpriteLayer layer) 325 | { 326 | if( layer.spriteInstance != null ) 327 | { 328 | Sprite sprite = layer.spriteInstance; 329 | layer.maxIndex = sprite.maxIndex + layer.frameDelay; 330 | sprite.flipHorizontal = flipHorizontal; 331 | sprite.flipVertical = flipVertical; 332 | } 333 | } 334 | private void DestoryChildren(GameObject parentObject){ 335 | foreach(Transform child in parentObject.transform){ 336 | DestroyGobj(child.gameObject); 337 | } 338 | } 339 | private void DestroyGobj(GameObject gobj){ 340 | #if UNITY_EDITOR 341 | DestroyImmediate(gobj); 342 | #else 343 | Destroy(gobj); 344 | #endif 345 | } 346 | #endregion 347 | 348 | #region Mono Methods 349 | 350 | void Start(){ 351 | 352 | 353 | // init layers --- 354 | 355 | for(int i=0; i 0 ) { 381 | 382 | 383 | if( delayTimer > 0F ) { 384 | 385 | delayTimer -= Time.deltaTime; 386 | 387 | } else { 388 | 389 | currentTime += Time.deltaTime; 390 | int nextIndex = (int)(fps * currentTime); 391 | 392 | if( currentIndex != nextIndex ){ 393 | 394 | currentIndex = nextIndex; 395 | 396 | if( currentIndex == maxIndex ){ 397 | 398 | // 要播放到最后一帧了 399 | 400 | if( loopCounter == 0 ) 401 | Stop(); 402 | else if( loopCounter > 0) 403 | loopCounter--; 404 | 405 | if( OnLastFrame != null) 406 | OnLastFrame(this); 407 | 408 | } else if( currentIndex > maxIndex ){ 409 | 410 | // 超过最大帧,将转到第一帧 411 | 412 | currentIndex = 0; 413 | currentTime = 0F; 414 | } 415 | } 416 | } 417 | } 418 | } 419 | 420 | #endregion 421 | } 422 | } 423 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | a sprite animation framework 294 | Copyright (C) 2013 Zhong ZiChang 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | --------------------------------------------------------------------------------