├── .editorconfig ├── .gitattributes ├── .gitignore ├── FutileProject ├── .gitignore ├── .vsconfig ├── Assets │ ├── Futile.meta │ ├── Futile │ │ ├── Core.meta │ │ ├── Core │ │ │ ├── FAtlas.cs │ │ │ ├── FAtlas.cs.meta │ │ │ ├── FAtlasManager.cs │ │ │ ├── FAtlasManager.cs.meta │ │ │ ├── FFacetRenderLayer.cs │ │ │ ├── FFacetRenderLayer.cs.meta │ │ │ ├── FFacetType.cs │ │ │ ├── FFacetType.cs.meta │ │ │ ├── FFont.cs │ │ │ ├── FFont.cs.meta │ │ │ ├── FMatrix.cs │ │ │ ├── FMatrix.cs.meta │ │ │ ├── FNodeEnabler.cs │ │ │ ├── FNodeEnabler.cs.meta │ │ │ ├── FRenderer.cs │ │ │ ├── FRenderer.cs.meta │ │ │ ├── FScreen.cs │ │ │ ├── FScreen.cs.meta │ │ │ ├── FShader.cs │ │ │ ├── FShader.cs.meta │ │ │ ├── FTouchManager.cs │ │ │ ├── FTouchManager.cs.meta │ │ │ ├── FutileException.cs │ │ │ ├── FutileException.cs.meta │ │ │ ├── FutileParams.cs │ │ │ └── FutileParams.cs.meta │ │ ├── Display.meta │ │ ├── Display │ │ │ ├── FContainer.cs │ │ │ ├── FContainer.cs.meta │ │ │ ├── FFacetNode.cs │ │ │ ├── FFacetNode.cs.meta │ │ │ ├── FFlipbookSprite.cs │ │ │ ├── FFlipbookSprite.cs.meta │ │ │ ├── FGameObjectNode.cs │ │ │ ├── FGameObjectNode.cs.meta │ │ │ ├── FLabel.cs │ │ │ ├── FLabel.cs.meta │ │ │ ├── FNode.cs │ │ │ ├── FNode.cs.meta │ │ │ ├── FSprite.cs │ │ │ ├── FSprite.cs.meta │ │ │ ├── FStage.cs │ │ │ ├── FStage.cs.meta │ │ │ ├── MeshNodes.meta │ │ │ └── MeshNodes │ │ │ │ ├── FMeshData.cs │ │ │ │ ├── FMeshData.cs.meta │ │ │ │ ├── FMeshNode.cs │ │ │ │ └── FMeshNode.cs.meta │ │ ├── Extras.meta │ │ ├── Extras │ │ │ ├── FButton.cs │ │ │ ├── FButton.cs.meta │ │ │ ├── FParticleSystem.cs │ │ │ ├── FParticleSystem.cs.meta │ │ │ ├── FRadialWipeSprite.cs │ │ │ ├── FRadialWipeSprite.cs.meta │ │ │ ├── FRepeatMeshSprite.cs │ │ │ ├── FRepeatMeshSprite.cs.meta │ │ │ ├── FRepeatSprite.cs │ │ │ ├── FRepeatSprite.cs.meta │ │ │ ├── FSimpleTileMap.cs │ │ │ ├── FSimpleTileMap.cs.meta │ │ │ ├── FSliceButton.cs │ │ │ ├── FSliceButton.cs.meta │ │ │ ├── FSliceSprite.cs │ │ │ ├── FSliceSprite.cs.meta │ │ │ ├── FSortYContainer.cs │ │ │ ├── FSortYContainer.cs.meta │ │ │ ├── FSoundManager.cs │ │ │ ├── FSoundManager.cs.meta │ │ │ ├── FUnityParticleSystemNode.cs │ │ │ ├── FUnityParticleSystemNode.cs.meta │ │ │ ├── FWipeSprite.cs │ │ │ └── FWipeSprite.cs.meta │ │ ├── Futile.cs │ │ ├── Futile.cs.meta │ │ ├── Helpers.meta │ │ ├── Helpers │ │ │ ├── FDebugFramerateGraph.cs │ │ │ └── FDebugFramerateGraph.cs.meta │ │ ├── Physics.meta │ │ ├── Physics │ │ │ ├── FPDebugRenderer.cs │ │ │ ├── FPDebugRenderer.cs.meta │ │ │ ├── FPDecomposer.cs │ │ │ ├── FPDecomposer.cs.meta │ │ │ ├── FPNodeLink.cs │ │ │ ├── FPNodeLink.cs.meta │ │ │ ├── FPPolygonalCollider.cs │ │ │ ├── FPPolygonalCollider.cs.meta │ │ │ ├── FPPolygonalData.cs │ │ │ ├── FPPolygonalData.cs.meta │ │ │ ├── FPUtils.cs │ │ │ ├── FPUtils.cs.meta │ │ │ ├── FPWorld.cs │ │ │ ├── FPWorld.cs.meta │ │ │ ├── FPhysics.cs │ │ │ └── FPhysics.cs.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ │ ├── Shaders.meta │ │ │ └── Shaders │ │ │ │ ├── Additive.shader │ │ │ │ ├── Additive.shader.meta │ │ │ │ ├── AdditiveColor.shader │ │ │ │ ├── AdditiveColor.shader.meta │ │ │ │ ├── Basic.shader │ │ │ │ ├── Basic.shader.meta │ │ │ │ ├── Basic_PixelSnap.shader │ │ │ │ ├── Basic_PixelSnap.shader.meta │ │ │ │ ├── Blur.shader │ │ │ │ ├── Blur.shader.meta │ │ │ │ ├── Solid.shader │ │ │ │ ├── Solid.shader.meta │ │ │ │ ├── SolidColored.shader │ │ │ │ └── SolidColored.shader.meta │ │ ├── Rix.meta │ │ ├── Rix │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ │ ├── RXProfilerEditor.cs │ │ │ │ ├── RXProfilerEditor.cs.meta │ │ │ │ ├── RXWatcherLinkEditor.cs │ │ │ │ └── RXWatcherLinkEditor.cs.meta │ │ │ ├── Experimental.meta │ │ │ ├── Experimental │ │ │ │ ├── RXGCTrigger.cs │ │ │ │ ├── RXGCTrigger.cs.meta │ │ │ │ ├── RXSignal.cs │ │ │ │ ├── RXSignal.cs.meta │ │ │ │ ├── RXWeak.cs │ │ │ │ └── RXWeak.cs.meta │ │ │ ├── RXDebug.cs │ │ │ ├── RXDebug.cs.meta │ │ │ ├── RXDestroyOnAwake.cs │ │ │ ├── RXDestroyOnAwake.cs.meta │ │ │ ├── RXDivider.cs │ │ │ ├── RXDivider.cs.meta │ │ │ ├── RXExtensions.cs │ │ │ ├── RXExtensions.cs.meta │ │ │ ├── RXPerformanceTester.cs │ │ │ ├── RXPerformanceTester.cs.meta │ │ │ ├── RXProfiler.cs │ │ │ ├── RXProfiler.cs.meta │ │ │ ├── RXRect.cs │ │ │ ├── RXRect.cs.meta │ │ │ ├── RXScroller.cs │ │ │ ├── RXScroller.cs.meta │ │ │ ├── RXUtils.cs │ │ │ ├── RXUtils.cs.meta │ │ │ ├── RXWatcher.cs │ │ │ └── RXWatcher.cs.meta │ │ ├── ThirdParty.meta │ │ └── ThirdParty │ │ │ ├── GoKit.dll │ │ │ ├── GoKit.dll.meta │ │ │ ├── MiniJson.cs │ │ │ ├── MiniJson.cs.meta │ │ │ ├── Packrat.meta │ │ │ └── Packrat │ │ │ ├── Editor.meta │ │ │ └── Editor │ │ │ ├── PRAtlasElement.cs │ │ │ ├── PRAtlasElement.cs.meta │ │ │ ├── PRAtlasGenerator.cs │ │ │ ├── PRAtlasGenerator.cs.meta │ │ │ ├── PRAtlasLink.cs │ │ │ ├── PRAtlasLink.cs.meta │ │ │ ├── PRPacker.cs │ │ │ ├── PRPacker.cs.meta │ │ │ ├── PRUtils.cs │ │ │ ├── PRUtils.cs.meta │ │ │ ├── PRWindow.cs │ │ │ └── PRWindow.cs.meta │ ├── FutileDemos.meta │ ├── FutileDemos │ │ ├── BananaGame.meta │ │ ├── BananaGame │ │ │ ├── BMain.cs │ │ │ ├── BMain.cs.meta │ │ │ ├── Game.meta │ │ │ ├── Game │ │ │ │ ├── BBanana.cs │ │ │ │ ├── BBanana.cs.meta │ │ │ │ ├── BMonkey.cs │ │ │ │ └── BMonkey.cs.meta │ │ │ ├── Pages.meta │ │ │ └── Pages │ │ │ │ ├── BInGamePage.cs │ │ │ │ ├── BInGamePage.cs.meta │ │ │ │ ├── BPage.cs │ │ │ │ ├── BPage.cs.meta │ │ │ │ ├── BScorePage.cs │ │ │ │ ├── BScorePage.cs.meta │ │ │ │ ├── BTitlePage.cs │ │ │ │ └── BTitlePage.cs.meta │ │ ├── Resources.meta │ │ └── Resources │ │ │ ├── Atlases.meta │ │ │ ├── Atlases │ │ │ ├── BananaGameAtlas_Scale1.png │ │ │ ├── BananaGameAtlas_Scale1.png.meta │ │ │ ├── BananaGameAtlas_Scale1.txt │ │ │ ├── BananaGameAtlas_Scale1.txt.meta │ │ │ ├── BananaGameAtlas_Scale2.png │ │ │ ├── BananaGameAtlas_Scale2.png.meta │ │ │ ├── BananaGameAtlas_Scale2.txt │ │ │ ├── BananaGameAtlas_Scale2.txt.meta │ │ │ ├── BananaGameAtlas_Scale4.png │ │ │ ├── BananaGameAtlas_Scale4.png.meta │ │ │ ├── BananaGameAtlas_Scale4.txt │ │ │ ├── BananaGameAtlas_Scale4.txt.meta │ │ │ ├── BananaLargeAtlas_Scale1.json │ │ │ ├── BananaLargeAtlas_Scale1.json.meta │ │ │ ├── BananaLargeAtlas_Scale1.png │ │ │ ├── BananaLargeAtlas_Scale1.png.meta │ │ │ ├── BananaLargeAtlas_Scale1.txt │ │ │ ├── BananaLargeAtlas_Scale1.txt.meta │ │ │ ├── BananaLargeAtlas_Scale2.png │ │ │ ├── BananaLargeAtlas_Scale2.png.meta │ │ │ ├── BananaLargeAtlas_Scale2.txt │ │ │ ├── BananaLargeAtlas_Scale2.txt.meta │ │ │ ├── BananaLargeAtlas_Scale4.png │ │ │ ├── BananaLargeAtlas_Scale4.png.meta │ │ │ ├── BananaLargeAtlas_Scale4.txt │ │ │ ├── BananaLargeAtlas_Scale4.txt.meta │ │ │ ├── FranchiseFont_Scale1.txt │ │ │ ├── FranchiseFont_Scale1.txt.meta │ │ │ ├── FranchiseFont_Scale2.txt │ │ │ ├── FranchiseFont_Scale2.txt.meta │ │ │ ├── FranchiseFont_Scale4.txt │ │ │ ├── FranchiseFont_Scale4.txt.meta │ │ │ ├── GameAtlas_Scale1.png │ │ │ ├── GameAtlas_Scale1.png.meta │ │ │ ├── GameAtlas_Scale1.txt │ │ │ ├── GameAtlas_Scale1.txt.meta │ │ │ ├── GameAtlas_Scale2.png │ │ │ ├── GameAtlas_Scale2.png.meta │ │ │ ├── GameAtlas_Scale2.txt │ │ │ ├── GameAtlas_Scale2.txt.meta │ │ │ ├── GameAtlas_Scale4.png │ │ │ ├── GameAtlas_Scale4.png.meta │ │ │ ├── GameAtlas_Scale4.txt │ │ │ └── GameAtlas_Scale4.txt.meta │ │ │ ├── Audio.meta │ │ │ ├── Audio │ │ │ ├── BananaSound.wav │ │ │ ├── BananaSound.wav.meta │ │ │ ├── ClickSound.wav │ │ │ ├── ClickSound.wav.meta │ │ │ ├── NormalMusic.wav │ │ │ ├── NormalMusic.wav.meta │ │ │ ├── VictoryMusic.wav │ │ │ └── VictoryMusic.wav.meta │ │ │ ├── Particles.meta │ │ │ └── Particles │ │ │ ├── BananaParticles.prefab │ │ │ ├── BananaParticles.prefab.meta │ │ │ ├── BasicParticleMaterial.mat │ │ │ └── BasicParticleMaterial.mat.meta │ ├── FutileScene.unity │ └── FutileScene.unity.meta ├── Packages │ ├── manifest.json │ └── packages-lock.json ├── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NavMeshLayers.asset │ ├── NetworkManager.asset │ ├── PackageManagerSettings.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ └── VersionControlSettings.asset └── UserSettings │ └── EditorUserSettings.asset └── README.md /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | indent_style = tab 3 | indent_size = 4 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Unity3D .gitignore file. 2 | # Store this file at the root of your local repository. 3 | 4 | # From Unity3D 5 | [Ll]ibrary/ 6 | [Tt]emp/ 7 | [Bb]uild/ 8 | [Ll]ogs/ 9 | *.pidb 10 | *.DS_Store 11 | 12 | 13 | 14 | # From Visual Studio 15 | [Oo]bj/ 16 | *.csproj 17 | *.sln 18 | *.suo 19 | *.user 20 | *.sln.docstates 21 | .vs/ 22 | 23 | 24 | # From ? 25 | *.unityproj 26 | 27 | FutileDev/ 28 | FutileDev.meta -------------------------------------------------------------------------------- /FutileProject/.gitignore: -------------------------------------------------------------------------------- 1 | Library/ 2 | Temp/ 3 | Output/ 4 | BananaDemoProject.sln 5 | BananaDemoProject-csharp.sln 6 | Assembly-CSharp.csproj 7 | Assembly-CSharp-vs.csproj 8 | Assembly-CSharp-firstpass.csproj 9 | Assembly-CSharp-firstpass-vs.csproj 10 | Assembly-CSharp.pidb 11 | Assembly-CSharp-firstpass.pidb 12 | *.userprefs 13 | *.DS_Store -------------------------------------------------------------------------------- /FutileProject/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4de05cb23b12a7e46a6844fbb2932630 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89404637fe6e3d6409d7bb572c555f86 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FAtlas.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a601a8b042406dc46afd32b7415c653f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FAtlasManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6bb63a23529cf5e4cb631733ca6c8f5b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FFacetRenderLayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce42ac26620a7db438aab8727c9343a6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FFacetType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | public class FFacetType 7 | { 8 | static public FFacetType defaultFacetType; 9 | 10 | //facetType types 11 | public static FFacetType Quad; 12 | public static FFacetType Triangle; 13 | 14 | private static int _nextFacetTypeIndex = 0; 15 | private static List _facetTypes = new List(); 16 | 17 | public int index; 18 | public string name; 19 | 20 | public int initialAmount; 21 | public int expansionAmount; 22 | public int maxEmptyAmount; 23 | 24 | public delegate FFacetRenderLayer CreateRenderLayerDelegate(FStage stage, FFacetType facetType, FAtlas atlas, FShader shader); 25 | 26 | public CreateRenderLayerDelegate createRenderLayer; 27 | 28 | private FFacetType (string name, int index, int initialAmount, int expansionAmount, int maxEmptyAmount, CreateRenderLayerDelegate createRenderLayer) //only to be constructed by using CreateFacetType() 29 | { 30 | this.index = index; 31 | this.name = name; 32 | 33 | this.initialAmount = initialAmount; 34 | this.expansionAmount = expansionAmount; 35 | this.maxEmptyAmount = maxEmptyAmount; 36 | 37 | this.createRenderLayer = createRenderLayer; 38 | } 39 | 40 | public static void Init() //called by Futile 41 | { 42 | Quad = CreateFacetType("Quad", 10, 10, 60, CreateQuadLayer); 43 | Triangle = CreateFacetType("Triangle", 16, 16, 64,CreateTriLayer); 44 | 45 | defaultFacetType = Quad; 46 | } 47 | 48 | //create your own FFacetTypes by creating them here 49 | public static FFacetType CreateFacetType(string facetTypeShortName, int initialAmount, int expansionAmount, int maxEmptyAmount, CreateRenderLayerDelegate createRenderLayer) 50 | { 51 | for(int s = 0; s<_facetTypes.Count; s++) 52 | { 53 | if(_facetTypes[s].name == facetTypeShortName) return _facetTypes[s]; //don't add it if we have it already 54 | } 55 | 56 | FFacetType newFacetType = new FFacetType(facetTypeShortName, _nextFacetTypeIndex++, initialAmount, expansionAmount, maxEmptyAmount, createRenderLayer); 57 | _facetTypes.Add (newFacetType); 58 | 59 | return newFacetType; 60 | } 61 | 62 | static private FFacetRenderLayer CreateQuadLayer(FStage stage, FFacetType facetType, FAtlas atlas, FShader shader) 63 | { 64 | return new FQuadRenderLayer(stage,facetType,atlas,shader); 65 | } 66 | 67 | static private FFacetRenderLayer CreateTriLayer(FStage stage, FFacetType facetType, FAtlas atlas, FShader shader) 68 | { 69 | return new FTriangleRenderLayer(stage,facetType,atlas,shader); 70 | } 71 | 72 | } 73 | 74 | 75 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FFacetType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5ba8c19ed4cd6444a9c8d0b7181ec30 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FFont.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f1770b842656a84eb1654a25607a87b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FMatrix.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00e433fa8b9f65a42bca709924caf6d5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FNodeEnabler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e0dd23244ac7a549a542eb9ce21b055 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08c87f4c56caae64ab88ad6598ef42a0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FScreen.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad4ba81748021544f9ef019b1cb107ee 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FShader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | public class FShader 7 | { 8 | static public FShader defaultShader; 9 | 10 | //shader types 11 | public static FShader Basic; 12 | public static FShader Additive; 13 | public static FShader AdditiveColor; 14 | public static FShader Solid; 15 | public static FShader SolidColored; 16 | 17 | public static FShader Basic_PixelSnap; 18 | 19 | public string name; 20 | public Shader shader; 21 | public bool needsApply = false; 22 | 23 | public FShader (string name, Shader shader) //only to be constructed inside this class using CreateShader() 24 | { 25 | this.name = name; 26 | this.shader = shader; 27 | 28 | if(shader == null) 29 | { 30 | throw new FutileException("Couldn't find Futile shader '"+name+"'"); 31 | } 32 | } 33 | 34 | virtual public void Apply(Material mat) 35 | { 36 | 37 | } 38 | 39 | public static void Init() //called by Futile 40 | { 41 | Basic = new FShader("Basic", Shader.Find("Futile/Basic")); 42 | Additive = new FShader("Additive", Shader.Find("Futile/Additive")); 43 | AdditiveColor = new FShader("AdditiveColor", Shader.Find("Futile/AdditiveColor")); 44 | Solid = new FShader("Solid", Shader.Find("Futile/Solid")); 45 | SolidColored = new FShader("SolidColored", Shader.Find("Futile/SolidColored")); 46 | 47 | Basic_PixelSnap = new FShader("Basic_PixelSnap", Shader.Find("Futile/Basic_PixelSnap")); 48 | 49 | defaultShader = Basic; 50 | } 51 | } 52 | 53 | 54 | public class FBlurShader : FShader 55 | { 56 | private float _blurAmount; 57 | 58 | public FBlurShader(float blurAmount) : base("BlurShader", Shader.Find("Futile/Blur")) 59 | { 60 | _blurAmount = blurAmount; 61 | needsApply = true; 62 | } 63 | 64 | override public void Apply(Material mat) 65 | { 66 | mat.SetFloat("_BlurForce",_blurAmount); 67 | } 68 | 69 | public float blurAmount 70 | { 71 | get {return _blurAmount;} 72 | set {if(_blurAmount != value) {_blurAmount = value; needsApply = true;}} 73 | } 74 | } 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FShader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e772372e580fee40b95ecf9c544e272 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FTouchManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7844346d740fa82439e5cefe7233ae49 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FutileException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public class FutileException : Exception 4 | { 5 | public FutileException (string message) : base(message) 6 | { 7 | } 8 | 9 | public FutileException () : base() 10 | { 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FutileException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8552c34a859dd640b7a204464e16b25 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Core/FutileParams.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections.Generic; 4 | 5 | public class FResolutionLevel 6 | { 7 | public float maxLength = 1000f; 8 | public float displayScale = 1f; 9 | public float resourceScale = 1f; 10 | public string resourceSuffix = ""; 11 | } 12 | 13 | public class FutileParams 14 | { 15 | public List resLevels = new List(); 16 | 17 | public Vector2 origin = new Vector2(0.5f,0.5f); 18 | 19 | public int targetFrameRate = 60; 20 | 21 | public ScreenOrientation singleOrientation = ScreenOrientation.AutoRotation; 22 | 23 | public bool supportsLandscapeLeft; 24 | public bool supportsLandscapeRight; 25 | public bool supportsPortrait; 26 | public bool supportsPortraitUpsideDown; 27 | 28 | public Color backgroundColor = Color.black; 29 | 30 | public bool shouldLerpToNearestResolutionLevel = true; 31 | public FResolutionLevelPickMode resolutionLevelPickMode = FResolutionLevelPickMode.Upwards; 32 | 33 | public FResolutionLevelPickDimension resolutionLevelPickDimension = FResolutionLevelPickDimension.Longest; 34 | 35 | public Func resolutionLevelPicker = null; //can optionally specify this for exact control over resolutionlevel 36 | 37 | public FutileParams(bool supportsLandscapeLeft, bool supportsLandscapeRight, bool supportsPortrait, bool supportsPortraitUpsideDown) 38 | { 39 | this.supportsLandscapeLeft = supportsLandscapeLeft; 40 | this.supportsLandscapeRight = supportsLandscapeRight; 41 | this.supportsPortrait = supportsPortrait; 42 | this.supportsPortraitUpsideDown = supportsPortraitUpsideDown; 43 | } 44 | 45 | public FResolutionLevel AddResolutionLevel (float maxLength, float displayScale, float resourceScale, string resourceSuffix) 46 | { 47 | FResolutionLevel resLevel = new FResolutionLevel(); 48 | 49 | resLevel.maxLength = maxLength; 50 | resLevel.displayScale = displayScale; 51 | resLevel.resourceScale = resourceScale; 52 | resLevel.resourceSuffix = resourceSuffix; 53 | 54 | bool wasAdded = false; 55 | 56 | //we've gotta have the resLevels sorted low to high by maxLength 57 | for(int r = 0; r= frameTime) 57 | { 58 | _timer -= frameTime; 59 | 60 | if (shouldUseRandomFrames) 61 | { 62 | var nextIndex = RXRandom.Int(_flipbookIndices.Length); 63 | while (nextIndex == _curIndex) 64 | { 65 | nextIndex = RXRandom.Int(_flipbookIndices.Length); 66 | } 67 | _curIndex = nextIndex; 68 | } 69 | else 70 | { 71 | _curIndex = (_curIndex + 1) % _flipbookElements.Length; 72 | } 73 | element = _flipbookElements[_flipbookIndices[_curIndex]]; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Display/FFlipbookSprite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbec59b836d562940a69f3e0aa38efc4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Display/FGameObjectNode.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | 4 | public class FGameObjectNode : FNode, FRenderableLayerInterface 5 | { 6 | protected GameObject _gameObject; 7 | 8 | protected int _renderQueueDepth = -1; 9 | 10 | protected bool _shouldLinkPosition; 11 | protected bool _shouldLinkRotation; 12 | protected bool _shouldLinkScale; 13 | 14 | protected Vector3 _initialGameObjectScale = new Vector3(1.0f,1.0f,1.0f); 15 | protected float _initialGameObjectRotationZ = 0.0f; 16 | protected float _previousGameObjectRotationZ = 0.0f; 17 | 18 | public bool shouldDestroyOnRemoveFromStage = true; 19 | 20 | public FGameObjectNode (GameObject gameObject, bool shouldLinkPosition, bool shouldLinkRotation, bool shouldLinkScale) 21 | { 22 | Init (gameObject,shouldLinkPosition,shouldLinkRotation, shouldLinkScale); 23 | } 24 | 25 | protected FGameObjectNode() //for easy overriding 26 | { 27 | 28 | } 29 | 30 | protected void Init(GameObject gameObject, bool shouldLinkPosition, bool shouldLinkRotation, bool shouldLinkScale) 31 | { 32 | _gameObject = gameObject; 33 | _shouldLinkPosition = shouldLinkPosition; 34 | _shouldLinkRotation = shouldLinkRotation; 35 | _shouldLinkScale = shouldLinkScale; 36 | 37 | _initialGameObjectScale = gameObject.transform.localScale; 38 | _initialGameObjectRotationZ = gameObject.transform.rotation.eulerAngles.z; 39 | _previousGameObjectRotationZ = _initialGameObjectRotationZ; 40 | 41 | Setup(); 42 | } 43 | 44 | protected void Setup() 45 | { 46 | if(_isOnStage) 47 | { 48 | _gameObject.transform.parent = Futile.instance.gameObject.transform; 49 | 50 | if(_gameObject.GetComponent() != null && _gameObject.GetComponent().material != null) 51 | { 52 | _gameObject.GetComponent().material.renderQueue = _renderQueueDepth; 53 | } 54 | 55 | _gameObject.layer = _stage.layer; 56 | 57 | UpdateGameObject(); 58 | } 59 | } 60 | 61 | protected void Unsetup() 62 | { 63 | if(_gameObject != null) 64 | { 65 | _gameObject.transform.parent = null; 66 | } 67 | } 68 | 69 | override public void HandleAddedToStage() 70 | { 71 | if(!_isOnStage) 72 | { 73 | base.HandleAddedToStage(); 74 | 75 | _stage.HandleFacetsChanged(); 76 | _gameObject.transform.parent = Futile.instance.gameObject.transform; 77 | UpdateGameObject(); 78 | } 79 | } 80 | 81 | override public void HandleRemovedFromStage() 82 | { 83 | if(_isOnStage) 84 | { 85 | base.HandleRemovedFromStage(); 86 | 87 | _gameObject.transform.parent = null; 88 | 89 | if(shouldDestroyOnRemoveFromStage) 90 | { 91 | UnityEngine.Object.Destroy(_gameObject); 92 | } 93 | 94 | _stage.HandleFacetsChanged(); 95 | } 96 | } 97 | 98 | override public void Redraw(bool shouldForceDirty, bool shouldUpdateDepth) 99 | { 100 | // Game Object Nodes MUST force themselves to update every frame, otherwise 101 | // their positions will get out of sync with the stage if the stage moves 102 | // and no nodes are being added/removed to cause the dirty flag to be set. 103 | shouldForceDirty = true; 104 | 105 | bool wasMatrixDirty = _isMatrixDirty; 106 | bool wasAlphaDirty = _isAlphaDirty; 107 | 108 | bool needsUpdate = false; 109 | 110 | UpdateDepthMatrixAlpha(shouldForceDirty, shouldUpdateDepth); 111 | 112 | if(shouldUpdateDepth) 113 | { 114 | needsUpdate = true; 115 | UpdateDepth(); 116 | } 117 | 118 | if(wasMatrixDirty || shouldForceDirty || shouldUpdateDepth) 119 | { 120 | needsUpdate = true; 121 | } 122 | 123 | if(wasAlphaDirty || shouldForceDirty) 124 | { 125 | needsUpdate = true; 126 | } 127 | 128 | if(needsUpdate) 129 | { 130 | UpdateGameObject(); 131 | } 132 | } 133 | 134 | protected void UpdateDepth() 135 | { 136 | stage.renderer.AddRenderableLayer(this); 137 | } 138 | 139 | virtual public void Update(int depth) 140 | { 141 | _renderQueueDepth = Futile.baseRenderQueueDepth+depth; 142 | 143 | if(_gameObject.GetComponent() != null && _gameObject.GetComponent().material != null) 144 | { 145 | _gameObject.GetComponent().material.renderQueue = _renderQueueDepth; 146 | } 147 | } 148 | 149 | virtual public void PostUpdate() 150 | { 151 | 152 | } 153 | 154 | public void UpdateGameObject() 155 | { 156 | if(_isOnStage) 157 | { 158 | FMatrix matrix = this.screenConcatenatedMatrix; 159 | 160 | if(_shouldLinkPosition) _gameObject.transform.localPosition = matrix.GetVector3FromLocalVector2(Vector2.zero,0); 161 | if(_shouldLinkRotation) 162 | { 163 | float newRotation = matrix.GetRotation(); 164 | //_gameObject.transform.eulerAngles = new Vector3(_gameObject.transform.eulerAngles.x,_gameObject.transform.eulerAngles.y,matrix.GetRotation()); 165 | _gameObject.transform.Rotate(0,0,_previousGameObjectRotationZ - _initialGameObjectRotationZ - newRotation, Space.World); 166 | _previousGameObjectRotationZ = _initialGameObjectRotationZ + newRotation; 167 | 168 | } 169 | if(_shouldLinkScale) 170 | { 171 | //_gameObject.transform.localScale = new Vector3(matrix.GetScaleX(), matrix.GetScaleY (), _gameObject.transform.localScale.z); 172 | 173 | _gameObject.transform.localScale = new Vector3 174 | ( 175 | _initialGameObjectScale.x * matrix.GetScaleX(), 176 | _initialGameObjectScale.y * matrix.GetScaleY(), 177 | _initialGameObjectScale.z 178 | ); 179 | } 180 | 181 | _gameObject.layer = _stage.layer; 182 | } 183 | } 184 | 185 | public GameObject gameObject 186 | { 187 | get {return _gameObject;} 188 | set 189 | { 190 | if(_gameObject != value) 191 | { 192 | Unsetup(); 193 | _gameObject = value; 194 | Setup(); 195 | } 196 | } 197 | } 198 | 199 | public int renderQueueDepth 200 | { 201 | get { return _renderQueueDepth;} 202 | } 203 | 204 | } 205 | 206 | 207 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Display/FGameObjectNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b05d7d6e82bba64587be20c351e10c0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Display/FLabel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe6de5c3c8f02ed49bb82b324c2237f1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Display/FNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 282cdd64558f94c4f8083a5407aff1ef 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Display/FSprite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4da82b4c8b493542a29061e6f9baa99 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Display/FStage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ade2e51f12fa4824b8337162f1d6ca71 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Display/MeshNodes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ccecba2eb8858584a941c575df6aefcd 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Display/MeshNodes/FMeshData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95772eb30ccb14f4aab6ff8932830812 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Display/MeshNodes/FMeshNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 935f5c32daf7149fc8915c1b47a4de56 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9124462253085545ad1a96c7fb356ca 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6efeb5e675bf5d42a32e35a2b799265 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FParticleSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34658d355dc9e4e52a690d66d6c423ff 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FRadialWipeSprite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c344348f92add24f9c9172430fdbb1e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FRepeatMeshSprite.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | public class FRepeatMeshSprite : FMeshNode 6 | { 7 | protected float _width; 8 | protected float _height; 9 | 10 | protected float _scrollX; 11 | protected float _scrollY; 12 | 13 | protected float _textureWidth; 14 | protected float _textureHeight; 15 | 16 | protected float _anchorX = 0.5f; 17 | protected float _anchorY = 0.5f; 18 | 19 | //FRepeatMesh creates an actual grid of tile geometry 20 | //This will look the same as FRepeatSprite, 21 | //except that it will work with any FAtlasElement, not just single images 22 | //You can set scrollX and scrollY to make the texture scroll 23 | 24 | public FRepeatMeshSprite (string elementName, float width, float height) : this(elementName,width,height,0,0) {} 25 | 26 | public FRepeatMeshSprite (string elementName, float width, float height, float scrollX, float scrollY) : base() 27 | { 28 | _width = width; 29 | _height = height; 30 | 31 | _scrollX = scrollX; 32 | _scrollY = scrollY; 33 | 34 | Init(new FMeshData(FFacetType.Quad), Futile.atlasManager.GetElementWithName(elementName)); 35 | } 36 | 37 | public void UpdateMesh() 38 | { 39 | float offsetX = -_anchorX*width; 40 | float offsetY = -_anchorY*height; 41 | 42 | float ewidth = _element.sourceSize.x; 43 | float eheight = _element.sourceSize.y; 44 | 45 | float leftRemaining = RXMath.Mod(_scrollX, ewidth); 46 | float bottomRemaining = RXMath.Mod(_scrollY, eheight); 47 | 48 | float leftX = leftRemaining; 49 | float rightX = leftX+width; 50 | 51 | int leftCol = 0; 52 | int rightCol = Mathf.FloorToInt(rightX / ewidth); 53 | if(rightX % ewidth == 0) rightCol--; //if it fits exactly, we don't need the last column 54 | 55 | 56 | float bottomY = bottomRemaining; 57 | float topY = bottomY+height; 58 | 59 | int bottomRow = 0; 60 | int topRow = Mathf.FloorToInt(topY / eheight); 61 | if(topY % eheight == 0) topRow--; //if it fits exactly, we don't need the last row 62 | 63 | int numCols = (rightCol-leftCol)+1; 64 | int numRows = (topRow-bottomRow)+1; 65 | 66 | _meshData.SetFacetCount(numCols*numRows); 67 | 68 | Listquads = _meshData.facets; 69 | 70 | float rightRemaining = ((rightCol+1)*ewidth - rightX); 71 | float topRemaining = ((topRow+1)*eheight - topY); 72 | 73 | int q = 0; 74 | 75 | for(int r = 0; rquads = _meshData.facets; 55 | 56 | int i = 0; 57 | for(int r = 0; r<_rows; r++) 58 | { 59 | for(int c = 0; c<_cols; c++) 60 | { 61 | FMeshQuad quad = (FMeshQuad)quads[i]; 62 | 63 | quad.SetUVRectFromElement(_elements[i]); 64 | quad.SetPosRect(offsetX+c*_tileWidth,offsetY+r*_tileHeight,_tileWidth,_tileHeight); 65 | 66 | i++; 67 | } 68 | } 69 | 70 | _meshData.MarkChanged(); 71 | } 72 | 73 | public Vector2 GetTilePosition(int col, int row) 74 | { 75 | float offsetX = -_anchorX*width; 76 | float offsetY = -_anchorY*height; 77 | return new Vector2(offsetX + (col * _tileWidth) + _tileWidth/2, offsetY + (row*_tileHeight) + _tileHeight/2); 78 | } 79 | 80 | public FAtlasElement GetTileElement(int col, int row) 81 | { 82 | if(col < 0) return null; 83 | if(col >= _cols) return null; 84 | if(row < 0) return null; 85 | if(row >= _rows) return null; 86 | 87 | return _elements[row*_cols + row]; 88 | } 89 | 90 | public FAtlasElement[] elements 91 | { 92 | set {_elements = elements; UpdateMesh();} 93 | get {return _elements;} 94 | } 95 | 96 | public float width 97 | { 98 | get { return _cols*_tileWidth; } 99 | } 100 | 101 | public float height 102 | { 103 | get { return _rows*_tileHeight;} 104 | } 105 | 106 | //TODO: allow user to change the elements 107 | 108 | public void SetAnchor(float anchorX, float anchorY) 109 | { 110 | _anchorX = anchorX; 111 | _anchorY = anchorY; 112 | UpdateMesh(); 113 | } 114 | 115 | public float anchorX 116 | { 117 | get { return _anchorX;} 118 | set 119 | { 120 | if(_anchorX != value) 121 | { 122 | _anchorX = value; 123 | UpdateMesh(); 124 | } 125 | } 126 | } 127 | 128 | public float anchorY 129 | { 130 | get { return _anchorY;} 131 | set 132 | { 133 | if(_anchorY != value) 134 | { 135 | _anchorY = value; 136 | UpdateMesh(); 137 | } 138 | } 139 | } 140 | 141 | } 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FSimpleTileMap.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 119727cc5971e5b4596d5c62a74a4084 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FSliceButton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7cb6e746519644a53b50b9d175da86d9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FSliceSprite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4184afdd27b6ddb49954db5795d7f707 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FSortYContainer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | //useful for simple depth sorting based on y values (ex in simple isometric stuff) 6 | 7 | public class FSortYContainer : FContainer 8 | { 9 | public FSortYContainer() 10 | { 11 | ListenForAfterUpdate(HandleAfterUpdate); 12 | } 13 | 14 | void HandleAfterUpdate() 15 | { 16 | bool didChange = _childNodes.InsertionSort(CompareY); 17 | if(didChange) 18 | { 19 | _stage.HandleFacetsChanged(); 20 | } 21 | } 22 | 23 | //sorts array in DESCENDING order because the higher y values should be earlier (aka further back) 24 | private static int CompareY(FNode a, FNode b) 25 | { 26 | float delta = b.y-a.y; 27 | if(delta < 0) return -1; 28 | if(delta > 0) return 1; 29 | return 0; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FSortYContainer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 570bd300d71b31f45877df02d3167548 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FSoundManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8537be62fb2aae46906360b420b88c6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FUnityParticleSystemNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class FUnityParticleSystemNode : FGameObjectNode 5 | { 6 | protected ParticleSystem _particleSystem; 7 | 8 | public FUnityParticleSystemNode (GameObject gameObject, bool shouldDuplicate) 9 | { 10 | if(shouldDuplicate) //make a copy 11 | { 12 | gameObject = UnityEngine.Object.Instantiate(gameObject) as GameObject; 13 | } 14 | 15 | _particleSystem = gameObject.GetComponent(); 16 | 17 | if(_particleSystem == null) 18 | { 19 | throw new FutileException("The FUnityParticleSystemNode was not passed a gameObject with a ParticleSystem component"); 20 | } 21 | 22 | Init(gameObject, true, false, false); 23 | 24 | ListenForUpdate(HandleUpdate); 25 | } 26 | 27 | protected void HandleUpdate() 28 | { 29 | if(!_particleSystem.IsAlive()) 30 | { 31 | this.RemoveFromContainer(); 32 | } 33 | } 34 | 35 | public ParticleSystem particleSystem 36 | { 37 | get { return _particleSystem;} 38 | } 39 | 40 | } 41 | 42 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FUnityParticleSystemNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b54822916d4a4a40aa6a65754a2204c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FWipeSprite.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | 4 | public class FWipeSprite : FSprite 5 | { 6 | protected float _wipeTopAmount = 1.0f; 7 | protected float _wipeRightAmount = 1.0f; 8 | protected float _wipeBottomAmount = 1.0f; 9 | protected float _wipeLeftAmount = 1.0f; 10 | 11 | public FWipeSprite (string elementName) : base() 12 | { 13 | Init(FFacetType.Quad, Futile.atlasManager.GetElementWithName(elementName),1); 14 | 15 | _isAlphaDirty = true; 16 | 17 | UpdateLocalVertices(); 18 | } 19 | 20 | override public void PopulateRenderLayer() 21 | { 22 | if(_isOnStage && _firstFacetIndex != -1) 23 | { 24 | _isMeshDirty = false; 25 | 26 | //these numbers are relative to the bottom left of the rect 27 | //they're used for figuring out the actual visible rectangle area during the wipe 28 | //you can think of them like a normalized visiblity rectangle 29 | float useRight = Mathf.Max(1.0f - wipeRightAmount, wipeLeftAmount); 30 | float useLeft = Mathf.Min(1.0f - wipeRightAmount, useRight); 31 | 32 | float useTop = Mathf.Max(1.0f - wipeTopAmount, wipeBottomAmount); 33 | float useBottom = Mathf.Min(1.0f - wipeTopAmount,useTop); 34 | 35 | int vertexIndex0 = _firstFacetIndex*4; 36 | int vertexIndex1 = vertexIndex0 + 1; 37 | int vertexIndex2 = vertexIndex0 + 2; 38 | int vertexIndex3 = vertexIndex0 + 3; 39 | 40 | Vector3[] vertices = _renderLayer.vertices; 41 | Vector2[] uvs = _renderLayer.uvs; 42 | Color[] colors = _renderLayer.colors; 43 | 44 | float localWidth = (_localVertices[1].x - _localVertices[0].x); 45 | float localHeight = (_localVertices[1].y - _localVertices[2].y); 46 | 47 | Vector2 localVector0 = new Vector2 48 | ( 49 | _localVertices[0].x + localWidth * useLeft, 50 | _localVertices[3].y + localHeight * useTop 51 | ); 52 | 53 | Vector2 localVector1 = new Vector2 54 | ( 55 | _localVertices[0].x + localWidth * useRight, 56 | _localVertices[3].y + localHeight * useTop 57 | ); 58 | 59 | Vector2 localVector2 = new Vector2 60 | ( 61 | _localVertices[0].x + localWidth * useRight, 62 | _localVertices[3].y + localHeight * useBottom 63 | ); 64 | 65 | Vector2 localVector3 = new Vector2 66 | ( 67 | _localVertices[0].x + localWidth * useLeft, 68 | _localVertices[3].y + localHeight * useBottom 69 | ); 70 | 71 | _concatenatedMatrix.ApplyVector3FromLocalVector2(ref vertices[vertexIndex0], localVector0,0); 72 | _concatenatedMatrix.ApplyVector3FromLocalVector2(ref vertices[vertexIndex1], localVector1,0); 73 | _concatenatedMatrix.ApplyVector3FromLocalVector2(ref vertices[vertexIndex2], localVector2,0); 74 | _concatenatedMatrix.ApplyVector3FromLocalVector2(ref vertices[vertexIndex3], localVector3,0); 75 | 76 | float uvWidth = (_element.uvTopRight.x - _element.uvTopLeft.x); 77 | float uvHeight = (_element.uvTopRight.y - _element.uvBottomRight.y); 78 | 79 | uvs[vertexIndex0] = new Vector2 80 | ( 81 | _element.uvTopLeft.x + uvWidth * useLeft, 82 | _element.uvBottomLeft.y + uvHeight * useTop 83 | ); 84 | 85 | uvs[vertexIndex1] = new Vector2 86 | ( 87 | _element.uvTopLeft.x + uvWidth * useRight, 88 | _element.uvBottomLeft.y + uvHeight * useTop 89 | ); 90 | 91 | uvs[vertexIndex2] = new Vector2 92 | ( 93 | _element.uvTopLeft.x + uvWidth * useRight, 94 | _element.uvBottomLeft.y + uvHeight * useBottom 95 | ); 96 | 97 | uvs[vertexIndex3] = new Vector2 98 | ( 99 | _element.uvTopLeft.x + uvWidth * useLeft, 100 | _element.uvBottomLeft.y + uvHeight * useBottom 101 | ); 102 | 103 | colors[vertexIndex0] = _alphaColor; 104 | colors[vertexIndex1] = _alphaColor; 105 | colors[vertexIndex2] = _alphaColor; 106 | colors[vertexIndex3] = _alphaColor; 107 | 108 | _renderLayer.HandleVertsChange(); 109 | } 110 | } 111 | 112 | public float wipeTopAmount 113 | { 114 | get { return _wipeTopAmount;} 115 | set 116 | { 117 | value = Mathf.Clamp01(value); 118 | if(_wipeTopAmount != value) 119 | { 120 | _wipeTopAmount = value; 121 | _isMeshDirty = true; 122 | } 123 | } 124 | } 125 | 126 | public float wipeRightAmount 127 | { 128 | get { return _wipeRightAmount;} 129 | set 130 | { 131 | value = Mathf.Clamp01(value); 132 | if(_wipeRightAmount != value) 133 | { 134 | _wipeRightAmount = value; 135 | _isMeshDirty = true; 136 | } 137 | } 138 | } 139 | 140 | public float wipeBottomAmount 141 | { 142 | get { return _wipeBottomAmount;} 143 | set 144 | { 145 | value = Mathf.Clamp01(value); 146 | if(_wipeBottomAmount != value) 147 | { 148 | _wipeBottomAmount = value; 149 | _isMeshDirty = true; 150 | } 151 | } 152 | } 153 | 154 | public float wipeLeftAmount 155 | { 156 | get { return _wipeLeftAmount;} 157 | set 158 | { 159 | value = Mathf.Clamp01(value); 160 | if(_wipeLeftAmount != value) 161 | { 162 | _wipeLeftAmount = value; 163 | _isMeshDirty = true; 164 | } 165 | } 166 | } 167 | 168 | } 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Extras/FWipeSprite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81468141d2ded9940bebd3a055623dd9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Futile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cd2c5fd76e3c8940b0dba7061ce9af1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Helpers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 410d1b98395bcd847857be295fd578a6 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Helpers/FDebugFramerateGraph.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class FDebugFrameRateGraph : FContainer 5 | { 6 | private const int BASE_TEX_WIDTH = 128; 7 | private const int BASE_TEX_HEIGHT = 32; 8 | 9 | private const float IDEAL_FRAME_TIME = 1.0f / 60.0f; 10 | private const float MAX_FRAME_TIME = IDEAL_FRAME_TIME * 3.0f; 11 | 12 | private bool _useSmoothDeltaTime = false; 13 | 14 | private int _texWidth = 0; 15 | private int _texHeight = 0; 16 | private int _numPixels = 0; 17 | 18 | private int _targetRow = 0; 19 | private int _doubleTargetRow = 0; 20 | 21 | private Color[] _newFramePixels; 22 | 23 | private Texture2D _graphTex = null; 24 | private FSprite _graphSprite = null; 25 | 26 | private Color _blank = new Color(0, 0, 0, 0.5f); 27 | 28 | public FDebugFrameRateGraph() : base() 29 | { 30 | _texWidth = BASE_TEX_WIDTH; 31 | _texHeight = BASE_TEX_HEIGHT; 32 | _numPixels = _texWidth * _texHeight; 33 | 34 | _newFramePixels = new Color[_texHeight]; 35 | 36 | _graphTex = new Texture2D(_texWidth, _texHeight, TextureFormat.ARGB32, false); 37 | _graphTex.filterMode = FilterMode.Point; 38 | // Initialize the graph 39 | Color[] blank = new Color[_numPixels]; 40 | for (int i = 0; i < _numPixels; i++) 41 | { 42 | blank[i] = _blank; 43 | } 44 | _graphTex.SetPixels(blank); 45 | 46 | // Draw lines for the target frame rate 47 | _targetRow = Mathf.FloorToInt(IDEAL_FRAME_TIME / (MAX_FRAME_TIME / (float)_texHeight)); 48 | _doubleTargetRow = Mathf.FloorToInt(2.0f * IDEAL_FRAME_TIME / (MAX_FRAME_TIME / (float)_texHeight)); 49 | 50 | Color[] targetColor = new Color[_texWidth]; 51 | Color[] doubleTargetColor = new Color[_texWidth]; 52 | Color[] maxTargetColor = new Color[_texWidth]; 53 | for (int i = 0; i < _texWidth; i++) 54 | { 55 | targetColor[i] = Color.black; 56 | doubleTargetColor[i] = Color.black; 57 | maxTargetColor[i] = Color.black; 58 | } 59 | _graphTex.SetPixels(0, _targetRow, _texWidth, 1, targetColor); 60 | _graphTex.SetPixels(0, _doubleTargetRow, _texWidth, 1, doubleTargetColor); 61 | _graphTex.SetPixels(0, _texHeight - 1, _texWidth, 1, maxTargetColor); 62 | _graphTex.Apply(); 63 | 64 | Futile.atlasManager.LoadAtlasFromTexture("debugFrameGraph", _graphTex); 65 | _graphSprite = new FSprite("debugFrameGraph"); 66 | _graphSprite.SetAnchor(0.0f, 0.0f); 67 | _graphSprite.scale = Futile.resourceScale; 68 | AddChild(_graphSprite); 69 | 70 | ListenForUpdate(HandleUpdate); 71 | } 72 | 73 | private void HandleUpdate() 74 | { 75 | float deltaTime = Time.deltaTime; 76 | if (_useSmoothDeltaTime) 77 | { 78 | deltaTime = Time.smoothDeltaTime; 79 | } 80 | 81 | // Grab all the pixels except the first row and copy them one pixel to the left 82 | Color[] prevPixels = _graphTex.GetPixels(1, 0, _texWidth - 1, _texHeight); 83 | _graphTex.SetPixels(0, 0, _texWidth - 1, _texHeight, prevPixels); 84 | 85 | // Now draw the new frame time 86 | int frameRow = Mathf.FloorToInt(deltaTime / (MAX_FRAME_TIME / (float)_texHeight)); 87 | Color frameColor = Color.red; 88 | if (frameRow <= _targetRow) 89 | { 90 | frameColor = Color.green; 91 | } 92 | else if (frameRow <= _doubleTargetRow) 93 | { 94 | frameColor = Color.yellow; 95 | } 96 | 97 | for (int y = 0; y <= frameRow && y < _texHeight; y++) 98 | { 99 | _newFramePixels[y] = frameColor; 100 | } 101 | for (int y = frameRow + 1; y < _texHeight; y++) 102 | { 103 | _newFramePixels[y] = _blank; 104 | } 105 | 106 | _newFramePixels[_targetRow] = Color.black; 107 | _newFramePixels[_doubleTargetRow] = Color.black; 108 | _newFramePixels[_texHeight - 1] = Color.black; 109 | 110 | _graphTex.SetPixels(_texWidth - 1, 0, 1, _texHeight, _newFramePixels); 111 | _graphTex.Apply(); 112 | } 113 | } 114 | 115 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Helpers/FDebugFramerateGraph.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5158187388de07e47bdd00d0e7441dcc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Physics.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7accd89038cf2f941af01c36773c5e4b 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Physics/FPDebugRenderer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System; 5 | 6 | public class FPDebugRenderer : MonoBehaviour 7 | { 8 | public static bool IS_ENABLED = true; 9 | 10 | public static FPDebugRenderer Create(GameObject targetGameObject, FContainer container, uint color, bool shouldUpdateColliders) 11 | { 12 | if(!IS_ENABLED) return null; 13 | 14 | FPDebugRenderer debugRenderer = targetGameObject.AddComponent(); 15 | debugRenderer.Init(container, color, shouldUpdateColliders); 16 | return debugRenderer; 17 | } 18 | 19 | private FContainer _container; 20 | private FContainer _drawContainer; 21 | 22 | private List _nodes = new List(1); 23 | 24 | private Color _color; 25 | 26 | public bool shouldUpdateColliders; 27 | 28 | public void Init(FContainer container, uint color, bool shouldUpdateColliders) 29 | { 30 | _container = container; 31 | 32 | _container.AddChild(_drawContainer = new FContainer()); 33 | 34 | _color = RXUtils.GetColorFromHex(color); 35 | 36 | this.shouldUpdateColliders = shouldUpdateColliders; 37 | 38 | Collider[] colliders = gameObject.GetComponents(); 39 | 40 | int colliderCount = colliders.Length; 41 | 42 | for(int c = 0; c(); 71 | 72 | if(mesh2D != null) 73 | { 74 | FPDebugPolygonColliderView debugView = new FPDebugPolygonColliderView("Debug/Triangle", mesh2D); 75 | debugView.color = _color; 76 | 77 | _drawContainer.AddChild(debugView); 78 | _nodes.Add(debugView); 79 | } 80 | 81 | Update(); 82 | if(!shouldUpdateColliders) UpdateColliders(); //always update the colliders the first time 83 | } 84 | 85 | public void Update() 86 | { 87 | _drawContainer.x = gameObject.transform.position.x*FPhysics.METERS_TO_POINTS; 88 | _drawContainer.y = gameObject.transform.position.y*FPhysics.METERS_TO_POINTS; 89 | 90 | _drawContainer.rotation = -gameObject.transform.rotation.eulerAngles.z; 91 | 92 | if(shouldUpdateColliders) UpdateColliders(); 93 | } 94 | 95 | public void UpdateColliders() 96 | { 97 | //todo: recreate collider draw nodes 98 | Collider[] colliders = gameObject.GetComponents(); 99 | 100 | int colliderCount = colliders.Length; 101 | 102 | for(int c = 0; c 0) flag |= 2; 30 | if (flag == 3) return false; //concave 31 | } 32 | 33 | if (flag != 0) return true; //convex 34 | else return true; //failed 35 | } 36 | 37 | //based on: http://wiki.unity3d.com/index.php?title=Triangulator (but with some modifications for increased performance) 38 | 39 | public static int[] Triangulate(Vector2[] points) 40 | { 41 | List indices = new List(); 42 | 43 | int n = points.Length; 44 | if (n < 3) 45 | return indices.ToArray(); 46 | 47 | int[] V = new int[n]; 48 | if (Triangulator_Area(points) > 0) 49 | { 50 | for (int v = 0; v < n; v++) 51 | V[v] = v; 52 | } 53 | else 54 | { 55 | for (int v = 0; v < n; v++) 56 | V[v] = (n - 1) - v; 57 | } 58 | 59 | int nv = n; 60 | int count = 2 * nv; 61 | for (int m = 0, v = nv - 1; nv > 2; ) 62 | { 63 | if ((count--) <= 0) 64 | return indices.ToArray(); 65 | 66 | int u = v; 67 | if (nv <= u) 68 | u = 0; 69 | v = u + 1; 70 | if (nv <= v) 71 | v = 0; 72 | int w = v + 1; 73 | if (nv <= w) 74 | w = 0; 75 | 76 | if (Triangulator_Snip(points, u, v, w, nv, V)) 77 | { 78 | int a, b, c, s, t; 79 | a = V[u]; 80 | b = V[v]; 81 | c = V[w]; 82 | indices.Add(a); 83 | indices.Add(b); 84 | indices.Add(c); 85 | m++; 86 | for (s = v, t = v + 1; t < nv; s++, t++) 87 | V[s] = V[t]; 88 | nv--; 89 | count = 2 * nv; 90 | } 91 | } 92 | 93 | indices.Reverse(); 94 | return indices.ToArray(); 95 | } 96 | 97 | static private float Triangulator_Area (Vector2[] points) 98 | { 99 | int n = points.Length; 100 | float A = 0.0f; 101 | for (int p = n - 1, q = 0; q < n; p = q++) 102 | { 103 | Vector2 pval = points[p]; 104 | Vector2 qval = points[q]; 105 | A += pval.x * qval.y - qval.x * pval.y; 106 | } 107 | return (A * 0.5f); 108 | } 109 | 110 | static private bool Triangulator_Snip (Vector2[] points, int u, int v, int w, int n, int[] V) 111 | { 112 | int p; 113 | Vector2 A = points[V[u]]; 114 | Vector2 B = points[V[v]]; 115 | Vector2 C = points[V[w]]; 116 | if (Mathf.Epsilon > (((B.x - A.x) * (C.y - A.y)) - ((B.y - A.y) * (C.x - A.x)))) 117 | return false; 118 | for (p = 0; p < n; p++) 119 | { 120 | if ((p == u) || (p == v) || (p == w)) 121 | continue; 122 | Vector2 P = points[V[p]]; 123 | if (Triangulator_InsideTriangle(A, B, C, P)) 124 | return false; 125 | } 126 | return true; 127 | } 128 | 129 | static private bool Triangulator_InsideTriangle (Vector2 A, Vector2 B, Vector2 C, Vector2 P) 130 | { 131 | float ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy; 132 | float cCROSSap, bCROSScp, aCROSSbp; 133 | 134 | ax = C.x - B.x; ay = C.y - B.y; 135 | bx = A.x - C.x; by = A.y - C.y; 136 | cx = B.x - A.x; cy = B.y - A.y; 137 | apx = P.x - A.x; apy = P.y - A.y; 138 | bpx = P.x - B.x; bpy = P.y - B.y; 139 | cpx = P.x - C.x; cpy = P.y - C.y; 140 | 141 | aCROSSbp = ax * bpy - ay * bpx; 142 | cCROSSap = cx * apy - cy * apx; 143 | bCROSScp = bx * cpy - by * cpx; 144 | 145 | return ((aCROSSbp >= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f)); 146 | } 147 | static public Vector2 ToVector2InPoints(this Vector3 vec) 148 | { 149 | return new Vector2(vec.x * FPhysics.METERS_TO_POINTS, vec.y * FPhysics.METERS_TO_POINTS); 150 | } 151 | static public Vector3 ToVector3InMeters(this Vector2 vec) 152 | { 153 | return new Vector3(vec.x * FPhysics.POINTS_TO_METERS, vec.y * FPhysics.POINTS_TO_METERS, 0.0f); 154 | } 155 | } -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Physics/FPUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6341851298732414f9e82e88383198c5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Physics/FPWorld.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class FPWorld : MonoBehaviour 5 | { 6 | public static FPWorld instance; 7 | 8 | private FPWorld() //Don't use new FPWorld(), use FPWorld.Create() instead!" 9 | { 10 | 11 | } 12 | 13 | public static FPWorld Create(float metersToPointsRatio) 14 | { 15 | GameObject gameObject = new GameObject("FPWorld Root"); 16 | 17 | instance = gameObject.AddComponent() as FPWorld; 18 | 19 | instance.Init(metersToPointsRatio); 20 | 21 | return instance; 22 | } 23 | 24 | protected void Init (float metersToPointsRatio) 25 | { 26 | FPhysics.METERS_TO_POINTS = metersToPointsRatio; 27 | FPhysics.POINTS_TO_METERS = 1.0f/metersToPointsRatio; 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Physics/FPWorld.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82d6ffd24996c294d98e827062cdd6c6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Physics/FPhysics.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | //A class for linking Unity physics and Futile 7 | //Set METERS_TO_POINTS at a ratio that makes sense for your game 8 | 9 | public class FPhysics 10 | { 11 | public const float DEFAULT_Z_THICKNESS = 1.0f; 12 | static public float METERS_TO_POINTS; 13 | static public float POINTS_TO_METERS; 14 | 15 | public FPhysics () 16 | { 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Physics/FPhysics.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0a7a8a37eb2464429ba5bebe0f0f994 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: daf4d90aca52814409fcb348a10eabbd 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2111b2bfdf4b3154184a660b6f546a24 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/Additive.shader: -------------------------------------------------------------------------------- 1 | //from http://forum.unity3d.com/threads/68402-Making-a-2D-game-for-iPhone-iPad-and-need-better-performance 2 | 3 | Shader "Futile/Additive" //Unlit Transparent Vertex Colored Additive 4 | { 5 | Properties 6 | { 7 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 8 | } 9 | 10 | Category 11 | { 12 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 13 | ZWrite Off 14 | ZTest Always 15 | //Alphatest Greater 0 16 | Blend SrcAlpha One //this is the line that makes it additive 17 | Fog { Mode Off } 18 | Lighting Off 19 | Cull Off //we can turn backface culling off because we know nothing will be facing backwards 20 | 21 | BindChannels 22 | { 23 | Bind "Vertex", vertex 24 | Bind "texcoord", texcoord 25 | Bind "Color", color 26 | } 27 | 28 | SubShader 29 | { 30 | Pass 31 | { 32 | SetTexture [_MainTex] 33 | { 34 | Combine texture * primary 35 | } 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/Additive.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c69b5a3f332f0f40b1a9a5ec141f6d3 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/AdditiveColor.shader: -------------------------------------------------------------------------------- 1 | 2 | Shader "Futile/AdditiveColor" //Unlit Transparent Vertex Colored Additive Color 3 | { 4 | Properties 5 | { 6 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 7 | } 8 | 9 | Category 10 | { 11 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 12 | ZWrite Off 13 | ZTest Always 14 | //Alphatest Greater 0 15 | Blend SrcAlpha OneMinusSrcAlpha 16 | Fog { Mode Off } 17 | Lighting Off 18 | Cull Off //we can turn backface culling off because we know nothing will be facing backwards 19 | 20 | BindChannels 21 | { 22 | Bind "Vertex", vertex 23 | Bind "texcoord", texcoord 24 | Bind "Color", color 25 | } 26 | 27 | SubShader 28 | { 29 | Pass 30 | { 31 | SetTexture [_MainTex] 32 | { 33 | Combine texture + primary, texture * primary 34 | } 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/AdditiveColor.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9601b083bc9f8b443a9428211e14e578 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/Basic.shader: -------------------------------------------------------------------------------- 1 | //from http://forum.unity3d.com/threads/68402-Making-a-2D-game-for-iPhone-iPad-and-need-better-performance 2 | 3 | Shader "Futile/Basic" //Unlit Transparent Vertex Colored 4 | { 5 | Properties 6 | { 7 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 8 | } 9 | 10 | Category 11 | { 12 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 13 | ZWrite Off 14 | ZTest Always 15 | Blend SrcAlpha OneMinusSrcAlpha 16 | Fog { Mode Off } 17 | Lighting Off 18 | Cull Off //we can turn backface culling off because we know nothing will be facing backwards 19 | 20 | BindChannels 21 | { 22 | Bind "Vertex", vertex 23 | Bind "texcoord", texcoord 24 | Bind "Color", color 25 | } 26 | 27 | SubShader 28 | { 29 | Pass 30 | { 31 | SetTexture [_MainTex] 32 | { 33 | Combine texture * primary 34 | } 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/Basic.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7a39a0ee3a0cc54a8107161e9c63e03 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/Basic_PixelSnap.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | //from http://forum.unity3d.com/threads/68402-Making-a-2D-game-for-iPhone-iPad-and-need-better-performance 4 | //pixelsnap code is from the Unity standard pixelsnap shader (Sprites/PixelSnap/AlphaBlended) 5 | 6 | Shader "Futile/Basic_PixelSnap" //Unlit Transparent Vertex Colored 7 | { 8 | Properties 9 | { 10 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 11 | } 12 | 13 | SubShader 14 | { 15 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 16 | ZWrite Off 17 | ZTest Always 18 | //Alphatest Greater 0 19 | Blend SrcAlpha OneMinusSrcAlpha 20 | Fog { Mode Off } 21 | Lighting Off 22 | Cull Off //we can turn backface culling off because we know nothing will be facing backwards 23 | 24 | Pass 25 | { 26 | CGPROGRAM 27 | #pragma vertex vert 28 | #pragma fragment frag 29 | #pragma fragmentoption ARB_precision_hint_fastest 30 | #include "UnityCG.cginc" 31 | 32 | sampler2D _MainTex; 33 | float4 _MainTex_ST; 34 | 35 | struct appdata_t 36 | { 37 | float4 vertex : POSITION; 38 | float2 texcoord : TEXCOORD0; 39 | float4 color : COLOR; 40 | }; 41 | 42 | struct v2f 43 | { 44 | float4 vertex : POSITION; 45 | float2 texcoord : TEXCOORD0; 46 | float4 color : COLOR; 47 | }; 48 | 49 | v2f vert(appdata_t IN) 50 | { 51 | v2f OUT; 52 | OUT.vertex = UnityObjectToClipPos(IN.vertex); 53 | OUT.texcoord = TRANSFORM_TEX(IN.texcoord, _MainTex); 54 | 55 | // Snapping params 56 | float hpcX = _ScreenParams.x * 0.5; 57 | float hpcY = _ScreenParams.y * 0.5; 58 | 59 | #ifdef UNITY_HALF_TEXEL_OFFSET 60 | float hpcOX = -0.5; 61 | float hpcOY = 0.5; 62 | #else 63 | float hpcOX = 0; 64 | float hpcOY = 0; 65 | #endif 66 | 67 | // Snap 68 | float pos = floor((OUT.vertex.x / OUT.vertex.w) * hpcX + 0.5f) + hpcOX; 69 | OUT.vertex.x = pos / hpcX * OUT.vertex.w; 70 | 71 | pos = floor((OUT.vertex.y / OUT.vertex.w) * hpcY + 0.5f) + hpcOY; 72 | OUT.vertex.y = pos / hpcY * OUT.vertex.w; 73 | OUT.color = IN.color; 74 | 75 | return OUT; 76 | } 77 | 78 | fixed4 frag(v2f IN) : COLOR 79 | { 80 | return tex2D( _MainTex, IN.texcoord) * IN.color; 81 | } 82 | ENDCG 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/Basic_PixelSnap.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c051cf35d458b8b42ac22d51e0ac9461 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/Blur.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | Shader "Futile/Blur" 4 | { 5 | Properties 6 | { 7 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 8 | _Color ("Main Color", Color) = (1,0,0,1.5) 9 | _BlurForce ("Blur Force", Range(0,20)) = 0.001 10 | } 11 | 12 | Category 13 | { 14 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 15 | ZWrite Off 16 | //Alphatest Greater 0 17 | Blend SrcAlpha OneMinusSrcAlpha 18 | Fog { Color(0,0,0,0) } 19 | Lighting Off 20 | Cull Off //we can turn backface culling off because we know nothing will be facing backwards 21 | 22 | BindChannels 23 | { 24 | Bind "Vertex", vertex 25 | Bind "texcoord", texcoord 26 | Bind "Color", color 27 | } 28 | 29 | SubShader 30 | { 31 | Pass 32 | { 33 | //SetTexture [_MainTex] 34 | //{ 35 | // Combine texture * primary 36 | //} 37 | 38 | 39 | 40 | CGPROGRAM 41 | #pragma vertex vert 42 | #pragma fragment frag 43 | 44 | #include "UnityCG.cginc" 45 | 46 | float4 _Color; 47 | sampler2D _MainTex; 48 | float _BlurForce; 49 | 50 | struct v2f { 51 | float4 pos : SV_POSITION; 52 | float2 uv : TEXCOORD0; 53 | }; 54 | 55 | float4 _MainTex_ST; 56 | 57 | v2f vert (appdata_base v) 58 | { 59 | v2f o; 60 | o.pos = UnityObjectToClipPos (v.vertex); 61 | o.uv = TRANSFORM_TEX (v.texcoord, _MainTex); 62 | return o; 63 | } 64 | 65 | half4 frag (v2f i) : COLOR 66 | { 67 | 68 | half4 texcol = tex2D (_MainTex, i.uv); 69 | return texcol * _Color; 70 | 71 | //not using blur because it breaks metal 72 | /* 73 | half4 texcol = half4(0.0); 74 | float remaining=1.0f; 75 | float coef=1.0; 76 | for (int j = 0; j < 3; j++) { 77 | float fI=j; 78 | coef*=0.32; 79 | texcol += tex2D(_MainTex, float2(i.uv.x, i.uv.y - fI * _BlurForce)) * coef; 80 | texcol += tex2D(_MainTex, float2(i.uv.x - fI * _BlurForce, i.uv.y)) * coef; 81 | texcol += tex2D(_MainTex, float2(i.uv.x + fI * _BlurForce, i.uv.y)) * coef; 82 | texcol += tex2D(_MainTex, float2(i.uv.x, i.uv.y + fI * _BlurForce)) * coef; 83 | 84 | remaining-=4*coef; 85 | } 86 | texcol += tex2D(_MainTex, float2(i.uv.x, i.uv.y)) * remaining; 87 | */ 88 | 89 | return texcol; 90 | } 91 | ENDCG 92 | 93 | 94 | 95 | } 96 | } 97 | } 98 | } -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/Blur.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd9744baf51e117458f1e94b6e3935f1 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/Solid.shader: -------------------------------------------------------------------------------- 1 | //from http://forum.unity3d.com/threads/68402-Making-a-2D-game-for-iPhone-iPad-and-need-better-performance 2 | 3 | Shader "Futile/Solid" //Unlit 4 | { 5 | Properties 6 | { 7 | _MainTex ("Base (RGB)", 2D) = "white" {} 8 | } 9 | 10 | SubShader 11 | { 12 | Pass 13 | { 14 | SetTexture [_MainTex] 15 | { 16 | Combine texture 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/Solid.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80979e9f865216642883a71277f76645 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/SolidColored.shader: -------------------------------------------------------------------------------- 1 | 2 | Shader "Futile/SolidColored" 3 | { 4 | Properties 5 | { 6 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 7 | } 8 | 9 | Category 10 | { 11 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 12 | ZWrite Off 13 | ZTest Always 14 | //Alphatest Greater 0 15 | Blend SrcAlpha OneMinusSrcAlpha 16 | Fog { Mode Off } 17 | Lighting Off 18 | Cull Off //we can turn backface culling off because we know nothing will be facing backwards 19 | 20 | BindChannels 21 | { 22 | Bind "Vertex", vertex 23 | Bind "texcoord", texcoord 24 | Bind "Color", color 25 | } 26 | 27 | SubShader 28 | { 29 | Pass 30 | { 31 | SetTexture [_MainTex] 32 | { 33 | Combine primary, texture * primary 34 | } 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Resources/Shaders/SolidColored.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6f5bd3bc0ec1f144a1eb25f14b70c97 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c62002094af1fb347a0533fb296fcc38 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8ffc7d39b4df5c41b5f6ab7221ffd34 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/Editor/RXProfilerEditor.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using UnityEditor; 6 | using UnityEngine; 7 | 8 | [CustomEditor(typeof(RXProfiler))] 9 | public class RXProfilerEditor : Editor 10 | { 11 | public static Type FLOAT = typeof(float); 12 | public static Type INT = typeof(int); 13 | public static Type STRING = typeof(string); 14 | public static Type COLOR = typeof(Color); 15 | public static Type VECTOR2 = typeof(Vector2); 16 | 17 | public void OnEnable() 18 | { 19 | //update when selected 20 | if(Futile.instance != null) 21 | { 22 | Futile.instance.SignalUpdate += HandleSignalUpdate; 23 | } 24 | } 25 | 26 | public void OnDisable() 27 | { 28 | if(Futile.instance != null) 29 | { 30 | Futile.instance.SignalUpdate -= HandleSignalUpdate; 31 | } 32 | } 33 | 34 | private void HandleSignalUpdate () 35 | { 36 | if(Time.frameCount % 30 == 0) //update every 30 frames 37 | { 38 | Repaint(); 39 | } 40 | } 41 | 42 | override public void OnInspectorGUI() 43 | { 44 | foreach(KeyValuePair> entry in RXProfiler.instancesByType) 45 | { 46 | int instanceCount = entry.Value.Count; 47 | 48 | if(instanceCount > 0) 49 | { 50 | GUILayout.Label(entry.Key.Name + " : " + instanceCount,EditorStyles.boldLabel); 51 | } 52 | } 53 | } 54 | } 55 | 56 | #endif -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/Editor/RXProfilerEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b4861e77efe24448b0f4c91768a8a6d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/Editor/RXWatcherLinkEditor.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | 3 | using System; 4 | using UnityEditor; 5 | using UnityEngine; 6 | 7 | [CustomEditor(typeof(RXWatcherLink))] 8 | public class RXWatcherLinkEditor : Editor 9 | { 10 | public static Type FLOAT = typeof(float); 11 | public static Type INT = typeof(int); 12 | public static Type STRING = typeof(string); 13 | public static Type COLOR = typeof(Color); 14 | public static Type VECTOR2 = typeof(Vector2); 15 | public static Type BOOL = typeof(bool); 16 | 17 | public RXWatcherLink link = null; 18 | 19 | public void OnEnable() 20 | { 21 | link = target as RXWatcherLink; 22 | 23 | EditorApplication.update += HandleSignalUpdate; 24 | //Watcher objects in the inspector update every frame, but only when selected. 25 | } 26 | 27 | public void OnDisable() 28 | { 29 | EditorApplication.update -= HandleSignalUpdate; 30 | } 31 | 32 | private void HandleSignalUpdate () 33 | { 34 | Repaint(); 35 | } 36 | 37 | override public void OnInspectorGUI() 38 | { 39 | //the target has been GC'd, so do nothing 40 | if(link.GetTarget() == null) return; 41 | 42 | GUILayout.Label(link.name, EditorStyles.boldLabel); 43 | 44 | EditorGUILayout.Separator(); 45 | 46 | int memberCount = link.members.Count; 47 | 48 | for(int m = 0; mweakRefs = new List(); 15 | 16 | public Action SignalGC; 17 | 18 | public WeakReference weakRef; 19 | public bool shouldStop = false; 20 | 21 | private RXGCTrigger(Action SignalGC) 22 | { 23 | this.SignalGC = SignalGC; 24 | weakRef = new WeakReference(this); 25 | weakRefs.Add(weakRef); 26 | } 27 | 28 | ~RXGCTrigger() 29 | { 30 | weakRefs.Remove(weakRef); 31 | if(!shouldStop) 32 | { 33 | new RXGCTrigger(SignalGC); 34 | if(SignalGC != null) SignalGC(); 35 | } 36 | } 37 | 38 | public static void AddCallback(Action SignalGC) 39 | { 40 | for(int w = 0; w _listeners; 10 | 11 | public RXSignal() 12 | { 13 | 14 | } 15 | 16 | public void Dispatch(int eventType) 17 | { 18 | if(_listeners == null) return; //we have no listeners so don't dispatch anything! 19 | 20 | for(int n = 0; n<_listeners.Count;n++) 21 | { 22 | RXSignalListener listener = _listeners[n]; 23 | 24 | if(listener.eventType == eventType) 25 | { 26 | if(_listeners[n].isWeak) 27 | { 28 | object target = _listeners[n].weakRef.Target; 29 | if(target != null) 30 | { 31 | (target as NoArgumentDelegate).Invoke(); 32 | } 33 | else //remove because it's null 34 | { 35 | _listeners.RemoveAt(n); 36 | n--; 37 | } 38 | } 39 | else 40 | { 41 | _listeners[n].strongDele.Invoke(); 42 | } 43 | } 44 | } 45 | } 46 | 47 | public void AddStrongListener(int eventType, NoArgumentDelegate dele) 48 | { 49 | AddListener(eventType,dele,false); 50 | } 51 | 52 | public void AddWeakListener(int eventType, NoArgumentDelegate dele) 53 | { 54 | AddListener(eventType,dele,true); 55 | } 56 | 57 | public void AddListener(int eventType, NoArgumentDelegate dele, bool isWeak) 58 | { 59 | if(_listeners == null) _listeners = new List(); 60 | 61 | RXSignalListener listener = new RXSignalListener(); 62 | 63 | listener.eventType = eventType; 64 | 65 | if(isWeak) 66 | { 67 | listener.isWeak = true; 68 | listener.weakRef = new WeakReference(dele); 69 | } 70 | else 71 | { 72 | listener.isWeak = false; 73 | listener.strongDele = dele; 74 | } 75 | 76 | _listeners.Add(listener); 77 | } 78 | 79 | public void RemoveListener(int eventType, NoArgumentDelegate dele) 80 | { 81 | if(_listeners != null) 82 | { 83 | for(int n = _listeners.Count-1; n>=0;n--) 84 | { 85 | if(_listeners[n].eventType == eventType) 86 | { 87 | if(_listeners[n].isWeak) 88 | { 89 | NoArgumentDelegate target = _listeners[n].weakRef.Target as NoArgumentDelegate; 90 | if(target != null && target == dele) 91 | { 92 | _listeners.RemoveAt(n); 93 | } 94 | 95 | } 96 | else if(_listeners[n].strongDele == dele) 97 | { 98 | _listeners.RemoveAt(n); 99 | } 100 | } 101 | } 102 | 103 | } 104 | } 105 | 106 | public void RemoveAllListeners() 107 | { 108 | if(_listeners != null) 109 | { 110 | _listeners.Clear(); 111 | } 112 | } 113 | 114 | private class RXSignalListener 115 | { 116 | public bool isWeak; 117 | public WeakReference weakRef; 118 | public int eventType; 119 | public NoArgumentDelegate strongDele; 120 | } 121 | 122 | } 123 | 124 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/Experimental/RXSignal.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96cec95b2f530d64690392f5adebf608 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/Experimental/RXWeak.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Timers; 5 | 6 | public class RXWeak 7 | { 8 | //allows you to add weak listeners, but currently only works with zero-argument Action callbacks 9 | // 10 | //syntax: 11 | // SomeEvent += RXWeak.Add(HandleEvent); 12 | // SomeEvent -= RXWeak.Remove(HandleEvent); 13 | // 14 | 15 | private static List _listeners; 16 | 17 | static RXWeak() 18 | { 19 | _listeners = new List(); 20 | 21 | //this will trigger CleanUp to be called every time the Garbage Collector is run 22 | RXGCTrigger.AddCallback(CleanUp); 23 | } 24 | 25 | //removes unused listeners periodically (and can be called manually if needed) 26 | //an unused listener is one where the target has already been garbage collected 27 | public static void CleanUp() 28 | { 29 | //reverse order so removals are easy 30 | for(int n = _listeners.Count-1; n>=0; n--) 31 | { 32 | if(!_listeners[n].weakRef.IsAlive) 33 | { 34 | _listeners.RemoveAt(n); 35 | } 36 | } 37 | } 38 | 39 | public static Action Add(Action callback) 40 | { 41 | //if we already have it, just use what we have (but increment timesAdded so we know how many Remove() calls are needed) 42 | for(int n = 0; n<_listeners.Count; n++) 43 | { 44 | Action dele = (_listeners[n].weakRef.Target as Action); 45 | 46 | if(dele == callback) 47 | { 48 | _listeners[n].timesAdded++; 49 | return _listeners[n].InnerCallback; 50 | } 51 | } 52 | 53 | //create a new listener 54 | RXWeakListener listener = new RXWeakListener(); 55 | listener.weakRef = new WeakReference(callback); 56 | _listeners.Add(listener); 57 | return listener.InnerCallback; 58 | } 59 | 60 | public static Action Remove(Action callback) 61 | { 62 | for(int n = 0; n<_listeners.Count; n++) 63 | { 64 | Action dele = (_listeners[n].weakRef.Target as Action); 65 | 66 | if(dele == callback) 67 | { 68 | RXWeakListener listener = _listeners[n]; 69 | 70 | listener.timesAdded --; 71 | 72 | if(listener.timesAdded <= 0) 73 | { 74 | _listeners.RemoveAt(n); 75 | } 76 | 77 | return listener.InnerCallback; 78 | } 79 | } 80 | return null; //this shouldn't ever really happen unless someone removes more listeners than they add 81 | } 82 | 83 | private class RXWeakListener 84 | { 85 | public int timesAdded = 1; 86 | public WeakReference weakRef; 87 | 88 | public void InnerCallback() 89 | { 90 | Action dele = (weakRef.Target as Action); 91 | 92 | if(dele != null) 93 | { 94 | dele(); 95 | } 96 | else 97 | { 98 | _listeners.Remove(this); //we don't have the target, so remove us 99 | } 100 | } 101 | } 102 | } 103 | 104 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/Experimental/RXWeak.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b41d609b36087548b33ce3255616be8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXDebug.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | public static class RXDebug 8 | { 9 | public static void Log(params object[] objects) 10 | { 11 | string result; 12 | 13 | if(objects.Length == 1) 14 | { 15 | result = objects[0].ToString(); 16 | } 17 | else 18 | { 19 | StringBuilder builder = new StringBuilder(); 20 | 21 | int count = objects.Length; 22 | 23 | for(int t = 0;t dictionaryOfDrawers = 126 | typeof(PropertyDrawer).GetField("s_PropertyDrawers", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).GetValue(null) as Dictionary; 127 | 128 | if(dictionaryOfDrawers != null) 129 | { 130 | foreach (var entry in dictionaryOfDrawers) 131 | { 132 | if (entry.Value == this) 133 | { 134 | dictionaryOfDrawers[entry.Key] = null; 135 | EditorGUI.PropertyField(rect, property, label, true); 136 | dictionaryOfDrawers[entry.Key] = this; 137 | return; 138 | } 139 | 140 | } 141 | } 142 | 143 | EditorGUI.PropertyField(rect, property, label, true); 144 | } 145 | } 146 | 147 | #elif UNITY_3_5 148 | 149 | using System; 150 | using UnityEngine; 151 | 152 | public class RXDivider 153 | { 154 | public string header; 155 | public string subtitle; 156 | 157 | public RXDivider(string header, string subtitle) {} 158 | public RXDivider(string header) {} 159 | public RXDivider() {} 160 | } 161 | 162 | #else 163 | 164 | using System; 165 | using UnityEngine; 166 | 167 | public class RXDivider : PropertyAttribute 168 | { 169 | public string header; 170 | public string subtitle; 171 | 172 | public RXDivider(string header, string subtitle) {} 173 | public RXDivider(string header) {} 174 | public RXDivider() {} 175 | } 176 | 177 | #endif 178 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXDivider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f983db509a3e6fb4ebb39711c2a415c6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0bbb46f74b2075d419ecd54999a19846 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXPerformanceTester.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | 5 | /* 6 | 7 | //USAGE: 8 | 9 | RXPerformanceTester.testA = () => 10 | { 11 | Math.Sin(0.0); 12 | }; 13 | 14 | RXPerformanceTester.testB = () => 15 | { 16 | Math.Cos(0.0); 17 | }; 18 | 19 | RXPerformanceTester.Run(25,10000); 20 | 21 | */ 22 | 23 | public class RXPerformanceTester 24 | { 25 | static public Action Log = UnityEngine.Debug.Log; 26 | //static public Action Log = Console.WriteLine; //use this if you want no reliance on Unity 27 | 28 | static public Action testA; 29 | static public Action testB; 30 | 31 | static public bool isRunning = false; 32 | 33 | static private int _numTests; 34 | static private int _numIterationsPerTest; 35 | 36 | static private int _currentTestIndex; 37 | static private double _efficiency; 38 | 39 | static private Stopwatch _watch = new Stopwatch(); 40 | 41 | //disable warnings so we don't get an "assigned but never used" warning 42 | //the _timer variable is used to store a reference to the timer so it doesn't get GC'd 43 | #pragma warning disable 44 | static private System.Threading.Timer _timer; 45 | #pragma warning restore 46 | 47 | //numtests should be a relatively low number, like 25, and numIterationsPerTest should be a high number like 1000, 10000, or 100000 48 | static public void Run(int numTests, int numIterationsPerTest) 49 | { 50 | if(isRunning) 51 | { 52 | Log("You must let the current test finish before running another"); 53 | return; 54 | } 55 | 56 | isRunning = true; 57 | 58 | _numTests = numTests; 59 | _numIterationsPerTest = numIterationsPerTest; 60 | 61 | if(testA == null || testB == null) throw new Exception("RXPerformanceTester: You must set testA and testB before calling Run()"); 62 | 63 | _currentTestIndex = -2; //-2 means two warm up tests 64 | _efficiency = 0.0f; 65 | 66 | DoNextTest(); 67 | } 68 | 69 | static private void DoNextTest () 70 | { 71 | //warm up tests for indexes below zero aren't counted 72 | if(_currentTestIndex < 0) 73 | { 74 | DoTest(_currentTestIndex); 75 | } 76 | else //do the test for real and measure the efficiency 77 | { 78 | _efficiency += DoTest(_currentTestIndex); 79 | } 80 | 81 | _currentTestIndex++; 82 | if(_currentTestIndex == _numTests) 83 | { 84 | DoFinalOutput(); 85 | } 86 | else 87 | { 88 | //delay for just a tiny amount of time so that it doesn't block the thread completely 89 | _timer = new System.Threading.Timer(obj => { DoNextTest(); }, null, 1, System.Threading.Timeout.Infinite); 90 | } 91 | } 92 | 93 | static private void DoFinalOutput () 94 | { 95 | _efficiency /= (float)_numTests; 96 | 97 | if(Math.Abs(_efficiency*100.0 - 100.0) <= 2.0) //within 2 percent is considered equal 98 | { 99 | Log("All tests complete, they're equal!"); 100 | } 101 | else if(_efficiency < 1.0) 102 | { 103 | int percent = (int) Math.Round(1.0/_efficiency * 100.0) - 100; 104 | Log("All tests complete, A is "+percent+"% faster!"); 105 | } 106 | else 107 | { 108 | int percent = (int) Math.Round(_efficiency * 100.0) - 100; 109 | Log("All tests complete, B is "+percent+"% faster!"); 110 | } 111 | 112 | isRunning = false; 113 | _timer = null; 114 | } 115 | 116 | static private double DoTest(int testIndex) 117 | { 118 | long timeA = 0; 119 | long timeB = 0; 120 | 121 | //start with either test A or test B, randomly 122 | bool shouldTestABeFirst = new System.Random((int)DateTime.UtcNow.Ticks).Next() % 2 == 0; 123 | 124 | if(shouldTestABeFirst) 125 | { 126 | for(int t = 0; t<_numIterationsPerTest; t++) 127 | { 128 | _watch.Reset(); 129 | _watch.Start(); 130 | testA(); 131 | timeA += _watch.ElapsedTicks; 132 | } 133 | 134 | for(int t = 0; t<_numIterationsPerTest; t++) 135 | { 136 | _watch.Reset(); 137 | _watch.Start(); 138 | testB(); 139 | timeB += _watch.ElapsedTicks; 140 | } 141 | } 142 | else 143 | { 144 | for(int t = 0; t<_numIterationsPerTest; t++) 145 | { 146 | _watch.Reset(); 147 | _watch.Start(); 148 | testB(); 149 | timeB += _watch.ElapsedTicks; 150 | } 151 | 152 | for(int t = 0; t<_numIterationsPerTest; t++) 153 | { 154 | _watch.Reset(); 155 | _watch.Start(); 156 | testA(); 157 | timeA += _watch.ElapsedTicks; 158 | } 159 | } 160 | 161 | double delta = (double)timeA/(double)timeB; 162 | 163 | if(testIndex >= 0) //don't bother logging the warm up tests 164 | { 165 | Log("Test " + testIndex + " A:" + timeA + " B:" + timeB + " efficiency: " + delta); 166 | } 167 | 168 | return delta; 169 | } 170 | } -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXPerformanceTester.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6eb25431544f4d1e95849656d0377a3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXProfiler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | public class RXProfiler : MonoBehaviour 7 | { 8 | static public Dictionary> instancesByType = new Dictionary>(); 9 | 10 | static RXProfiler() 11 | { 12 | #if UNITY_EDITOR 13 | GameObject go = new GameObject("RXProfiler"); 14 | go.AddComponent(); //for watching in the editor 15 | #endif 16 | } 17 | 18 | public void Update() 19 | { 20 | #if UNITY_EDITOR 21 | //update every second 22 | if(Time.frameCount % Application.targetFrameRate == 0) 23 | { 24 | RXProfiler.CheckInstanceCounts(); 25 | } 26 | #endif 27 | } 28 | 29 | static private void CheckInstanceCounts() 30 | { 31 | foreach(KeyValuePair> typePair in instancesByType) 32 | { 33 | int removalCount = 0; 34 | 35 | List weakRefs = typePair.Value; 36 | 37 | for(int w = weakRefs.Count-1; w>=0; w--) //reversed so removals are easy 38 | { 39 | WeakReference weakRef = weakRefs[w]; 40 | 41 | if(weakRef.Target == null) 42 | { 43 | removalCount++; 44 | weakRefs.RemoveAt(w); 45 | } 46 | } 47 | 48 | if(removalCount > 0) 49 | { 50 | //Debug.Log("RXProfiler: Removed " + removalCount + " instance" + (removalCount==1?"":"s") + " of [" + typePair.Key.Name + "]. There are now " + weakRefs.Count + " alive."); 51 | } 52 | } 53 | } 54 | 55 | static public void TrackLifeCycle(System.Object thing) 56 | { 57 | #if UNITY_EDITOR 58 | Type targetType = thing.GetType(); 59 | 60 | List weakRefs = null; 61 | 62 | if(instancesByType.ContainsKey(targetType)) 63 | { 64 | weakRefs = instancesByType[targetType]; 65 | 66 | int weakRefsCount = weakRefs.Count; 67 | 68 | for(int w = 0; w(); 79 | instancesByType.Add(targetType, weakRefs); 80 | } 81 | 82 | weakRefs.Add(new WeakReference(thing)); 83 | 84 | //Debug.Log ("RXProfiler: Added an instance of [" + targetType.Name + "]. There are now " + weakRefs.Count + " alive."); 85 | #endif 86 | } 87 | } 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXProfiler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 870d092554164ca43b24795376ee9964 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXRect.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | //a rect that's a class 6 | //so it's much faster than Unity's built in Rect in many circumstances 7 | 8 | public class RXRect 9 | { 10 | public float x; 11 | public float y; 12 | public float width; 13 | public float height; 14 | 15 | public RXRect(float x, float y, float width, float height) 16 | { 17 | this.x = x; 18 | this.y = y; 19 | this.width = width; 20 | this.height = height; 21 | } 22 | 23 | public RXRect() 24 | { 25 | 26 | } 27 | 28 | public bool CheckIntersect(RXRect otherRect) 29 | { 30 | return 31 | ( 32 | ((this.x+this.width) >= otherRect.x) && 33 | (this.x <= (otherRect.x+otherRect.width)) && 34 | ((this.y+this.height) >= otherRect.y) && 35 | (this.y <= (otherRect.y+otherRect.height)) 36 | ); 37 | } 38 | 39 | public void Log(string name) 40 | { 41 | Debug.Log(name + " x:"+x+" y:"+y+ " w:"+width+" h:"+height); 42 | } 43 | 44 | override public string ToString() 45 | { 46 | return "x:"+x+" y:"+y+ " w:"+width+" h:"+height; 47 | } 48 | 49 | public RXRect Clone() 50 | { 51 | RXRect rect = new RXRect(); 52 | rect.x = x; 53 | rect.y = y; 54 | rect.width = width; 55 | rect.height = height; 56 | return rect; 57 | } 58 | 59 | public bool Contains(Vector2 point) 60 | { 61 | if(point.x < x || point.y < y || point.x > x+width || point.y > y+height) 62 | { 63 | return false; 64 | } 65 | return true; 66 | } 67 | 68 | public bool Contains(float checkX, float checkY) 69 | { 70 | if(checkX < x || checkY < y || checkX > x+width || checkY > y+height) 71 | { 72 | return false; 73 | } 74 | return true; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXRect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57daabeb5ac73dd45bf1d35b616c8149 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXScroller.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class RXScroller 6 | { 7 | //note: these are variables in case you want to set them on a per-scroller basis 8 | 9 | public float MAX_DRAG_SPEED = 20.0f; //maximum drag speed in pixels-per-update 10 | public float EDGE_SQUISH = 60.0f; //how far to go past the end in pixels 11 | public float EDGE_SQUISH_RATIO = 0.55f; //keep below 1, it's the ratio of edge squish (0.55 is Apple's default) 12 | public float EDGE_BOUNCE = 0.19f; //how much force to use to bounce back 13 | public float STRONG_FRICTION = 0.75f; //used to bring it to a stop quicker 14 | public float WEAK_FRICTION = 0.92f; //used when throwing at high speed 15 | public float SLOW_SPEED = 3.0f; //below this speed it will be brought to a stop quickly 16 | 17 | private bool _isDragging = false; 18 | 19 | private float _pos; 20 | private float _speed; 21 | 22 | private float _basePos; 23 | private float _baseTouchPos; 24 | 25 | private float _previousPos; 26 | 27 | private float _boundsMin; 28 | private float _boundsMax; 29 | 30 | private float _dragSpeed = 0; 31 | private bool _shouldDetermineSpeed = false; 32 | 33 | public RXScroller(float pos, float boundsMin, float boundsMax) 34 | { 35 | _pos = 0; 36 | _speed = 0; 37 | _basePos = 0; 38 | _baseTouchPos = 0; 39 | _previousPos = 0; 40 | _boundsMin = boundsMin; 41 | _boundsMax = boundsMax; 42 | } 43 | 44 | public void BeginDrag(float touchPos) 45 | { 46 | if(_isDragging) return; 47 | 48 | _isDragging = true; 49 | 50 | _baseTouchPos = touchPos; 51 | 52 | _basePos = _pos; 53 | _dragSpeed = 0; 54 | } 55 | 56 | public void EndDrag(float touchPos) 57 | { 58 | if(!_isDragging) return; 59 | 60 | _isDragging = false; 61 | 62 | UpdateDrag(touchPos); 63 | 64 | _shouldDetermineSpeed = true; 65 | } 66 | 67 | public void CancelDrag() 68 | { 69 | if(!_isDragging) return; 70 | 71 | _isDragging = false; 72 | 73 | _speed = 0; 74 | _dragSpeed = 0; 75 | } 76 | 77 | //returns true if it's still moving 78 | public bool Update() 79 | { 80 | _dragSpeed += (_pos-_previousPos - _dragSpeed) * 0.5f; 81 | 82 | if(_shouldDetermineSpeed) 83 | { 84 | _shouldDetermineSpeed = false; 85 | _speed = _dragSpeed; 86 | } 87 | 88 | _previousPos = _pos; 89 | 90 | if(_isDragging) return true; 91 | 92 | float diff = 0; //diff is the amount of movement needed to bring pos back in bounds 93 | 94 | if(_pos < _boundsMin) 95 | { 96 | diff = _boundsMin - _pos; 97 | } 98 | else if(_pos > _boundsMax) 99 | { 100 | diff = _boundsMax - _pos; 101 | } 102 | 103 | if(Mathf.Abs(_speed) > 0.01f || Mathf.Abs(diff) > 1.0f) 104 | { 105 | if(Mathf.Abs(_speed) < SLOW_SPEED || Mathf.Abs(diff) > 0.0f) //slow it down a lot if it's close to stopping or past the edge 106 | { 107 | _speed *= STRONG_FRICTION; 108 | } 109 | else 110 | { 111 | _speed *= WEAK_FRICTION; 112 | } 113 | 114 | _pos += _speed + diff * EDGE_BOUNCE; 115 | 116 | return true; //it's still moving 117 | } 118 | else //it's done moving, stahp! 119 | { 120 | _speed = 0.0f; 121 | 122 | //put it at the exact edge 123 | if(_pos < _boundsMin) 124 | { 125 | _pos = _boundsMin; 126 | } 127 | else if(_pos > _boundsMax) 128 | { 129 | _pos = _boundsMax; 130 | } 131 | 132 | return false; //it's not moving anymore! 133 | } 134 | } 135 | 136 | public void UpdateDrag(float touchPos) 137 | { 138 | float absolutePos = _basePos - (touchPos - _baseTouchPos); 139 | 140 | float diff = 0; //diff is the amount of movement needed to bring absolutePos back in bounds 141 | 142 | if(absolutePos < _boundsMin) 143 | { 144 | diff = _boundsMin - absolutePos; 145 | 146 | float result = (1.0f - (1.0f / ((diff * EDGE_SQUISH_RATIO / EDGE_SQUISH) + 1.0f))) * EDGE_SQUISH; 147 | 148 | _pos = _boundsMin - result; 149 | } 150 | else if(absolutePos > _boundsMax) 151 | { 152 | diff = absolutePos - _boundsMax; 153 | 154 | float result = (1.0f - (1.0f / ((diff * EDGE_SQUISH_RATIO / EDGE_SQUISH) + 1.0f))) * EDGE_SQUISH; 155 | 156 | _pos = _boundsMax + result; 157 | } 158 | else 159 | { 160 | _pos = absolutePos; 161 | } 162 | } 163 | 164 | public void SetPos(float pos) 165 | { 166 | _pos = pos; 167 | } 168 | 169 | public void SetPos(float pos, float speed) 170 | { 171 | _pos = pos; 172 | _speed = speed; 173 | } 174 | 175 | public float GetPos() 176 | { 177 | return _pos; 178 | } 179 | 180 | public void SetSpeed(float speed) 181 | { 182 | _speed = speed; 183 | } 184 | 185 | public float GetSpeed() 186 | { 187 | return _speed; 188 | } 189 | 190 | public void SetBounds(float boundsMin, float boundsMax) 191 | { 192 | _boundsMin = boundsMin; 193 | _boundsMax = boundsMax; 194 | } 195 | 196 | public float GetDragDelta() 197 | { 198 | return _pos - _basePos; 199 | } 200 | 201 | public float GetDragDistance() 202 | { 203 | return Mathf.Abs(_pos - _basePos); 204 | } 205 | 206 | public bool isDragging 207 | { 208 | get {return _isDragging;} 209 | } 210 | 211 | public float boundsMin 212 | { 213 | get {return _boundsMin;} 214 | } 215 | 216 | public float boundsMax 217 | { 218 | get {return _boundsMax;} 219 | } 220 | } 221 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXScroller.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 326ccbf4e4c80344f8d448c736638f0d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7ab3c9289bae824f86d85c12d791d24 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/Rix/RXWatcher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7451317d1b266d45b9a56b2b81f2a9b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0265b293df47693419030d249197fc48 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/GoKit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/Futile/ThirdParty/GoKit.dll -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/GoKit.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d0397673d0d140139dd8e3766085bbe 3 | PluginImporter: 4 | serializedVersion: 1 5 | iconMap: {} 6 | executionOrder: {} 7 | isPreloaded: 0 8 | platformData: 9 | Any: 10 | enabled: 1 11 | settings: {} 12 | Editor: 13 | enabled: 0 14 | settings: 15 | DefaultValueInitialized: true 16 | WindowsStoreApps: 17 | enabled: 0 18 | settings: 19 | CPU: AnyCPU 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/MiniJson.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47ac956104fc99b4082fa492157fd1ff 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b00cbefc5d8a85540a9498bec10a2708 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8749016fbf7384998bd0a439517a7110 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat/Editor/PRAtlasElement.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.IO; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | using UnityEditor; 7 | using System.Text; 8 | 9 | 10 | public class PRAtlasElement 11 | { 12 | public PRAtlasGenerator generator; 13 | 14 | public string name; 15 | public string filePath; 16 | public Texture2D texture; 17 | public PRRect packedRect; 18 | 19 | public bool shouldTrim = false; 20 | public bool shouldRotate = false; 21 | public bool shouldScale = true; 22 | 23 | public int padding; 24 | public int extrude; 25 | 26 | //the size of the original texture, unscaled 27 | public int sourceFullWidth; 28 | public int sourceFullHeight; 29 | 30 | //the size of the original texture, scaled 31 | public int scaledFullWidth; 32 | public int scaledFullHeight; 33 | 34 | //the rect of the trimmed area, unscaled 35 | public int sourceTrimX; 36 | public int sourceTrimY; 37 | public int sourceTrimWidth; 38 | public int sourceTrimHeight; 39 | 40 | //the rect of the trimmed area, scaled (this will be put into the atlas data) 41 | public int scaledTrimX; 42 | public int scaledTrimY; 43 | public int scaledTrimWidth; 44 | public int scaledTrimHeight; 45 | 46 | //expandedWidth = (scaledTrimWidth + padding + extrude) 47 | //this is the size that is passed into the atlas rect packer 48 | public int expandedWidth; 49 | public int expandedHeight; 50 | 51 | 52 | public PRAtlasElement(PRAtlasGenerator generator, string name) 53 | { 54 | this.generator = generator; 55 | this.name = name; 56 | } 57 | 58 | public string GetJSONString() 59 | { 60 | string useName = name; 61 | 62 | //if the input image is CoolPath/MyCoolImage_notrim.png - let them use it as CoolPath/MyCoolImage 63 | if(useName.EndsWith("_trim")) useName = useName.Replace("_trim",""); 64 | if(useName.EndsWith("_notrim")) useName = useName.Replace("_notrim",""); 65 | 66 | StringBuilder stringBuilder = new StringBuilder("\""+useName+"\":\n{\n"); 67 | 68 | //scaledTrimWidth and packedRect.width should always be the same (for height too) 69 | 70 | //the standard atlas data format assumes 0,0 is in the top left 71 | //but our coordinates are in bottom left form, so we need to flip the y coord 72 | int packedX = packedRect.x += extrude; //the x already has the padding accounted for! 73 | int packedY = (generator.atlasHeight - packedRect.y) - packedRect.height + extrude + padding; 74 | int packedWidth = packedRect.width - extrude*2 - padding; 75 | int packedHeight = packedRect.height - extrude*2 - padding; 76 | 77 | //the coordinates within the atlas texture 78 | stringBuilder.Append("\t\"frame\": {\"x\":"+packedX+",\"y\":"+packedY+",\"w\":"+packedWidth+",\"h\":"+packedHeight+"},\n"); 79 | 80 | //this tool doesn't support rotations (though it could in the future) 81 | stringBuilder.Append("\t\"rotated\": "+(shouldRotate?"true":"false")+",\n"); 82 | 83 | //whether it has been trimmed or not 84 | stringBuilder.Append("\t\"trimmed\": "+(shouldTrim?"true":"false")+",\n"); 85 | 86 | int flippedScaledTrimmedY = (scaledFullHeight - scaledTrimY) - scaledTrimHeight; 87 | 88 | //the trimmed coordinates within the untrimmed rect (this y will need to be flipped) 89 | stringBuilder.Append("\t\"spriteSourceSize\": {\"x\":"+scaledTrimX+",\"y\":"+flippedScaledTrimmedY+",\"w\":"+scaledTrimWidth+",\"h\":"+scaledTrimHeight+"},\n"); 90 | 91 | //the original untrimmed size 92 | stringBuilder.Append("\t\"sourceSize\": {\"w\":"+scaledFullWidth+",\"h\":"+scaledFullHeight+"}\n"); 93 | 94 | stringBuilder.Append("}"); 95 | 96 | return stringBuilder.ToString(); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat/Editor/PRAtlasElement.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d90eb3aef2af4006a3042ea08af080d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat/Editor/PRAtlasGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf35f8a24b5bb42ea976beed2d6d4126 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat/Editor/PRAtlasLink.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System.Text; 5 | 6 | //PR = FutileGenerator, the tool that makes atlases from source images 7 | //PRAtlasLink - links a source images folder with an output atlas path 8 | public class PRAtlasLink 9 | { 10 | public string sourceFolderPath = ""; 11 | public string atlasFilePath = ""; 12 | 13 | public bool shouldGenerate = false; 14 | public bool shouldAutoGenerate = false; 15 | public bool shouldFoldout = false; 16 | public bool shouldAddSubfolders = true; 17 | public bool shouldUseBytes = false; 18 | 19 | public float scale = 1.0f; 20 | public int padding = 1; 21 | public int extrude = 0; 22 | public int trimPadding = 1; 23 | public bool shouldTrim = true; 24 | 25 | public PRAtlasLink(string sourceFolderPath, string atlasFilePath) 26 | { 27 | this.sourceFolderPath = sourceFolderPath; 28 | this.atlasFilePath = atlasFilePath; 29 | 30 | Debug.Log("atlasFilePath is " + atlasFilePath); 31 | } 32 | 33 | public PRAtlasLink(Dictionary dict) 34 | { 35 | dict.SetStringIfExists("sourceFolderPath", ref sourceFolderPath); 36 | dict.SetStringIfExists("atlasFilePath", ref atlasFilePath); 37 | dict.SetBoolIfExists("shouldGenerate", ref shouldGenerate); 38 | dict.SetBoolIfExists("shouldFoldout", ref shouldFoldout); 39 | dict.SetBoolIfExists("shouldAutoGenerate", ref shouldAutoGenerate); 40 | dict.SetBoolIfExists("shouldAddSubfolders", ref shouldAddSubfolders); 41 | dict.SetBoolIfExists("shouldUseBytes", ref shouldUseBytes); 42 | dict.SetFloatIfExists("scale", ref scale); 43 | dict.SetBoolIfExists("shouldTrim", ref shouldTrim); 44 | dict.SetIntIfExists("padding", ref padding); 45 | dict.SetIntIfExists("extrude", ref extrude); 46 | dict.SetIntIfExists("trimPadding", ref trimPadding); 47 | } 48 | 49 | public string GetJSONString () 50 | { 51 | StringBuilder stringBuilder = new StringBuilder("{\n"); 52 | 53 | stringBuilder.Append("\t\"sourceFolderPath\":\""+sourceFolderPath+"\",\n"); 54 | stringBuilder.Append("\t\"atlasFilePath\":\""+atlasFilePath+"\",\n"); 55 | stringBuilder.Append("\t\"shouldGenerate\":\""+shouldGenerate.ToString()+"\",\n"); 56 | stringBuilder.Append("\t\"shouldFoldout\":\""+shouldFoldout.ToString()+"\",\n"); 57 | stringBuilder.Append("\t\"shouldAutoGenerate\":\""+shouldAutoGenerate.ToString()+"\",\n"); 58 | stringBuilder.Append("\t\"shouldAddSubfolders\":\""+shouldAddSubfolders.ToString()+"\",\n"); 59 | stringBuilder.Append("\t\"shouldUseBytes\":\""+shouldUseBytes.ToString()+"\",\n"); 60 | stringBuilder.Append("\t\"scale\":\""+scale.ToString()+"\""); 61 | stringBuilder.Append("\t\"shouldTrim\":\""+shouldTrim.ToString()+"\""); 62 | stringBuilder.Append("\t\"padding\":\""+padding.ToString()+"\""); 63 | stringBuilder.Append("\t\"extrude\":\""+extrude.ToString()+"\""); 64 | stringBuilder.Append("\t\"trimPadding\":\""+trimPadding.ToString()+"\""); 65 | 66 | stringBuilder.Append("\n}"); 67 | 68 | return stringBuilder.ToString(); 69 | } 70 | 71 | public PRAtlasLink GetDuplicate() 72 | { 73 | PRAtlasLink link = new PRAtlasLink(sourceFolderPath,atlasFilePath); 74 | link.shouldGenerate = shouldGenerate; 75 | link.shouldFoldout = shouldFoldout; 76 | link.shouldAutoGenerate = shouldAutoGenerate; 77 | link.shouldAddSubfolders = shouldAddSubfolders; 78 | link.shouldUseBytes = shouldUseBytes; 79 | link.scale = scale; 80 | link.shouldTrim = shouldTrim; 81 | link.padding = padding; 82 | link.extrude = extrude; 83 | link.trimPadding = trimPadding; 84 | return link; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat/Editor/PRAtlasLink.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6607d9845f3c54c449a2ddcbcc994c14 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat/Editor/PRPacker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96c1678a951e34244818151e8c40510a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat/Editor/PRUtils.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.IO; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | //way faster than a normal rect 8 | public class PRRect 9 | { 10 | public int x; 11 | public int y; 12 | public int width; 13 | public int height; 14 | 15 | public PRRect Clone() 16 | { 17 | PRRect rect = new PRRect(); 18 | rect.x = x; 19 | rect.y = y; 20 | rect.width = width; 21 | rect.height = height; 22 | return rect; 23 | } 24 | } 25 | 26 | public static class PRUtils 27 | { 28 | //Unity's FileUtil.GetProjectRelativePath() only works for files INSIDE the project, 29 | //but this method works for ALL files+folders 30 | public static string GetTrueProjectRelativePath(string inputPath) 31 | { 32 | string fullProjectPath = Directory.GetParent(Path.GetFullPath(Application.dataPath)).FullName; 33 | 34 | return PRUtils.GetRelativePath(fullProjectPath, Path.GetFullPath(inputPath)); 35 | } 36 | 37 | //from http://mrpmorris.blogspot.ca/2007/05/convert-absolute-path-to-relative-path.html 38 | public static string GetRelativePath(string absolutePath, string relativeTo) 39 | { 40 | string[] absoluteDirectories = absolutePath.Split(Path.DirectorySeparatorChar); 41 | string[] relativeDirectories = relativeTo.Split(Path.DirectorySeparatorChar); 42 | 43 | //Get the shortest of the two paths 44 | int length = absoluteDirectories.Length < relativeDirectories.Length ? absoluteDirectories.Length : relativeDirectories.Length; 45 | 46 | //Use to determine where in the loop we exited 47 | int lastCommonRoot = -1; 48 | int index; 49 | 50 | //Find common root 51 | for (index = 0; index < length; index++) 52 | if (absoluteDirectories[index] == relativeDirectories[index]) 53 | lastCommonRoot = index; 54 | else 55 | break; 56 | 57 | //If we didn't find a common prefix then use the absolute path of the second path instead 58 | if (lastCommonRoot == -1) 59 | return relativeTo; 60 | 61 | //Build up the relative path 62 | StringBuilder relativePath = new StringBuilder(); 63 | 64 | //Add on the .. 65 | for (index = lastCommonRoot + 1; index < absoluteDirectories.Length; index++) 66 | if (absoluteDirectories[index].Length > 0) 67 | relativePath.Append(".."+Path.DirectorySeparatorChar); 68 | 69 | //Add on the folders 70 | for (index = lastCommonRoot + 1; index < relativeDirectories.Length - 1; index++) 71 | relativePath.Append(relativeDirectories[index] + Path.DirectorySeparatorChar); 72 | relativePath.Append(relativeDirectories[relativeDirectories.Length - 1]); 73 | 74 | return relativePath.ToString(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat/Editor/PRUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18a943e2842c544a28ab6caea70d79ee 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/Futile/ThirdParty/Packrat/Editor/PRWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b74c409fc75f44ee9f59843966322bb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a4a2af180428ba5489922a7bf0e938ca 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07ca255e81d924b40acaae0b76bc1843 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/BMain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | public enum BPageType 7 | { 8 | None, 9 | TitlePage, 10 | InGamePage, 11 | ScorePage 12 | } 13 | 14 | public class BMain : MonoBehaviour 15 | { 16 | public static BMain instance; 17 | 18 | public int score = 0; 19 | public int bestScore = 0; 20 | 21 | private BPageType _currentPageType = BPageType.None; 22 | private BPage _currentPage = null; 23 | 24 | private FStage _stage; 25 | 26 | private void Start() 27 | { 28 | instance = this; 29 | 30 | Go.defaultEaseType = EaseType.Linear; 31 | Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty; 32 | 33 | //Time.timeScale = 0.1f; 34 | 35 | bool isIPad = SystemInfo.deviceModel.Contains("iPad"); 36 | 37 | bool shouldSupportPortraitUpsideDown = isIPad; //only support portrait upside-down on iPad 38 | 39 | FutileParams fparams = new FutileParams(true,true,true,shouldSupportPortraitUpsideDown); 40 | 41 | fparams.AddResolutionLevel(480.0f, 1.0f, 1.0f, "_Scale1"); //iPhone 42 | fparams.AddResolutionLevel(960.0f, 2.0f, 2.0f, "_Scale2"); //iPhone retina 43 | fparams.AddResolutionLevel(1024.0f, 2.0f, 2.0f, "_Scale2"); //iPad 44 | fparams.AddResolutionLevel(1280.0f, 2.0f, 2.0f, "_Scale2"); //Nexus 7 45 | fparams.AddResolutionLevel(2048.0f, 4.0f, 4.0f, "_Scale4"); //iPad Retina 46 | 47 | fparams.origin = new Vector2(0.5f,0.5f); 48 | 49 | Futile.instance.Init (fparams); 50 | 51 | Futile.atlasManager.LoadAtlas("Atlases/BananaLargeAtlas"); 52 | Futile.atlasManager.LoadAtlas("Atlases/BananaGameAtlas"); 53 | 54 | Futile.atlasManager.LoadFont("Franchise","FranchiseFont"+Futile.resourceSuffix, "Atlases/FranchiseFont"+Futile.resourceSuffix, 0.0f,-4.0f); 55 | 56 | _stage = Futile.stage; 57 | 58 | FSoundManager.PlayMusic ("NormalMusic",0.5f); 59 | 60 | GoToPage(BPageType.TitlePage); 61 | } 62 | 63 | public void GoToPage (BPageType pageType) 64 | { 65 | if(_currentPageType == pageType) return; //we're already on the same page, so don't bother doing anything 66 | 67 | BPage pageToCreate = null; 68 | 69 | if(pageType == BPageType.TitlePage) 70 | { 71 | pageToCreate = new BTitlePage(); 72 | } 73 | if(pageType == BPageType.InGamePage) 74 | { 75 | pageToCreate = new BInGamePage(); 76 | } 77 | else if (pageType == BPageType.ScorePage) 78 | { 79 | pageToCreate = new BScorePage(); 80 | } 81 | 82 | if(pageToCreate != null) //destroy the old page and create a new one 83 | { 84 | _currentPageType = pageType; 85 | 86 | if(_currentPage != null) 87 | { 88 | _stage.RemoveChild(_currentPage); 89 | } 90 | 91 | _currentPage = pageToCreate; 92 | _stage.AddChild(_currentPage); 93 | _currentPage.Start(); 94 | } 95 | 96 | } 97 | 98 | } 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/BMain.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fb59720730122941a4b2c007ce36db1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Game.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09d5c6053ca6d944094baf00b77a5fc1 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Game/BBanana.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class BBanana : FSprite 5 | { 6 | private float _rotationSpeed; 7 | private float _speedY; 8 | 9 | public BBanana () : base("Banana") 10 | { 11 | _rotationSpeed = RXRandom.Range(-3.0f,3.0f); 12 | _speedY = RXRandom.Range(-0.1f,-0.5f); 13 | 14 | ListenForUpdate(HandleUpdate); 15 | } 16 | 17 | public void HandleUpdate() 18 | { 19 | _speedY -= 0.013f; 20 | 21 | this.rotation += _rotationSpeed; 22 | this.y += _speedY; 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Game/BBanana.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f6ed9a7ec7ff214681c545297f73cc2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Game/BMonkey.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class BMonkey : FSprite 5 | { 6 | private int _frameIndex = 0; 7 | 8 | private FAtlasElement[] _frameElements; 9 | 10 | public BMonkey () : base("Monkey_0") 11 | { 12 | _frameElements = new FAtlasElement[19]; 13 | 14 | FAtlasManager am = Futile.atlasManager; 15 | //of course there are way smarter ways to do this, but this is fast 16 | //it's a ping ponging animation, which is why I did it this way, it's not a straight loop 17 | _frameElements[0] = am.GetElementWithName("Monkey_0"); 18 | _frameElements[1] = am.GetElementWithName("Monkey_1"); 19 | _frameElements[2] = am.GetElementWithName("Monkey_2"); 20 | _frameElements[3] = am.GetElementWithName("Monkey_3"); 21 | _frameElements[4] = am.GetElementWithName("Monkey_4"); 22 | _frameElements[5] = am.GetElementWithName("Monkey_5"); 23 | _frameElements[6] = am.GetElementWithName("Monkey_6"); 24 | _frameElements[7] = am.GetElementWithName("Monkey_7"); 25 | _frameElements[8] = am.GetElementWithName("Monkey_8"); 26 | _frameElements[9] = am.GetElementWithName("Monkey_9"); 27 | _frameElements[10] = am.GetElementWithName("Monkey_8"); 28 | _frameElements[11] = am.GetElementWithName("Monkey_7"); 29 | _frameElements[12] = am.GetElementWithName("Monkey_6"); 30 | _frameElements[13] = am.GetElementWithName("Monkey_5"); 31 | _frameElements[14] = am.GetElementWithName("Monkey_4"); 32 | _frameElements[15] = am.GetElementWithName("Monkey_3"); 33 | _frameElements[16] = am.GetElementWithName("Monkey_2"); 34 | _frameElements[17] = am.GetElementWithName("Monkey_1"); 35 | _frameElements[18] = am.GetElementWithName("Monkey_0"); 36 | 37 | ListenForUpdate(HandleUpdate); 38 | } 39 | 40 | private void HandleUpdate() 41 | { 42 | if(Time.frameCount % 2 == 0) //update every other frame, aka 30 fps 43 | { 44 | _frameIndex++; 45 | this.element = _frameElements[_frameIndex % _frameElements.Length]; //use % to keep it wrapping 46 | } 47 | } 48 | 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Game/BMonkey.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6622aac1415eaed45adde236cb829acd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Pages.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b423c513ef2c114880d7f57d9c6c631 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Pages/BInGamePage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efd34c9a05ca7dd489e6638b8a4a911a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Pages/BPage.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class BPage : FContainer 5 | { 6 | public BPage() 7 | { 8 | 9 | } 10 | 11 | virtual public void Start() 12 | { 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Pages/BPage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24c5663f6d86b1e4ab16ee647cfb1a73 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Pages/BScorePage.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | 5 | public class BScorePage : BPage 6 | { 7 | private FSprite _background; 8 | private BMonkey _monkey; 9 | private FButton _againButton; 10 | private FLabel _scoreLabel; 11 | private FLabel _bestScoreLabel; 12 | private int _frameCount = 0; 13 | private bool _isNewBestScore = false; 14 | 15 | public BScorePage() 16 | { 17 | ListenForUpdate(HandleUpdate); 18 | ListenForResize(HandleResize); 19 | } 20 | 21 | override public void Start() 22 | { 23 | _background = new FSprite("JungleBlurryBG"); 24 | AddChild(_background); 25 | 26 | //this will scale the background up to fit the screen 27 | //but it won't let it shrink smaller than 100% 28 | 29 | _monkey = new BMonkey(); 30 | AddChild(_monkey); 31 | _monkey.x = -5.0f; 32 | _monkey.y = -2.0f; 33 | 34 | _againButton = new FButton("YellowButton_normal", "YellowButton_down", "YellowButton_over", "ClickSound"); 35 | _againButton.AddLabel("Franchise","AGAIN?",new Color(0.45f,0.25f,0.0f,1.0f)); 36 | 37 | AddChild(_againButton); 38 | _againButton.y = -110.0f; 39 | 40 | _againButton.SignalRelease += HandleAgainButtonRelease; 41 | 42 | _scoreLabel = new FLabel("Franchise", BMain.instance.score+" Bananas"); 43 | AddChild(_scoreLabel); 44 | 45 | _scoreLabel.color = new Color(1.0f,0.9f,0.2f); 46 | _scoreLabel.y = 110.0f; 47 | 48 | if(BMain.instance.score > BMain.instance.bestScore) 49 | { 50 | BMain.instance.bestScore = BMain.instance.score; 51 | _isNewBestScore = true; 52 | } 53 | else 54 | { 55 | _isNewBestScore = false; 56 | } 57 | 58 | _bestScoreLabel = new FLabel("Franchise", "Best score: " + BMain.instance.bestScore+" Bananas"); 59 | AddChild(_bestScoreLabel); 60 | _bestScoreLabel.scale = 0.5f; 61 | _bestScoreLabel.anchorX = 1.0f; 62 | _bestScoreLabel.anchorY = 0.0f; 63 | _bestScoreLabel.color = new Color(1.0f,0.9f,0.2f); 64 | 65 | 66 | 67 | _scoreLabel.scale = 0.0f; 68 | 69 | Go.to(_scoreLabel, 0.5f, new TweenConfig(). 70 | setDelay(0.3f). 71 | floatProp("scale",1.0f). 72 | setEaseType(EaseType.BackOut)); 73 | 74 | _monkey.scale = 0.0f; 75 | 76 | Go.to(_monkey, 0.5f, new TweenConfig(). 77 | setDelay(0.1f). 78 | floatProp("scale",1.0f). 79 | setEaseType(EaseType.BackOut)); 80 | 81 | 82 | _againButton.scale = 0.0f; 83 | 84 | Go.to(_againButton, 0.5f, new TweenConfig(). 85 | setDelay(0.3f). 86 | floatProp("scale",1.0f). 87 | setEaseType(EaseType.BackOut)); 88 | 89 | HandleResize(true); //force resize to position everything at the start 90 | } 91 | 92 | protected void HandleResize(bool wasOrientationChange) 93 | { 94 | //this will scale the background up to fit the screen 95 | //but it won't let it shrink smaller than 100% 96 | _background.scale = Math.Max (Math.Max(1.0f,Futile.screen.height/_background.textureRect.height),Futile.screen.width/_background.textureRect.width); 97 | 98 | _bestScoreLabel.x = Futile.screen.halfWidth - 5; 99 | _bestScoreLabel.y = -Futile.screen.halfHeight + 5; 100 | } 101 | 102 | private void HandleAgainButtonRelease (FButton button) 103 | { 104 | FSoundManager.PlayMusic("NormalMusic",0.5f); 105 | BMain.instance.GoToPage(BPageType.InGamePage); 106 | } 107 | 108 | protected void HandleUpdate () 109 | { 110 | if(_frameCount % 24 < 12) //make the score blink every 12 frames 111 | { 112 | _scoreLabel.color = new Color(1.0f,1.0f,0.5f); 113 | if(_isNewBestScore) _bestScoreLabel.color = new Color(1.0f,1.0f,0.5f); 114 | } 115 | else 116 | { 117 | _scoreLabel.color = new Color(1.0f,0.9f,0.2f); 118 | if(_isNewBestScore) _bestScoreLabel.color = new Color(1.0f,0.9f,0.2f); 119 | } 120 | 121 | _frameCount++; 122 | } 123 | 124 | } 125 | 126 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Pages/BScorePage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28562a2af775a68488b50c5c13a85d19 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Pages/BTitlePage.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | 5 | public class BTitlePage : BPage 6 | { 7 | private FSprite _background; 8 | private FContainer _logoHolder; 9 | private FSprite _logo; 10 | private FButton _startButton; 11 | private int _frameCount = 0; 12 | 13 | 14 | public BTitlePage() 15 | { 16 | ListenForUpdate(HandleUpdate); 17 | ListenForResize(HandleResize); 18 | } 19 | 20 | override public void Start() 21 | { 22 | _background = new FSprite("JungleClearBG"); 23 | AddChild(_background); 24 | 25 | //this will scale the background up to fit the screen 26 | //but it won't let it shrink smaller than 100% 27 | 28 | _logoHolder = new FContainer(); 29 | 30 | AddChild (_logoHolder); 31 | 32 | _logo = new FSprite("MainLogo"); 33 | 34 | _logoHolder.AddChild(_logo); 35 | 36 | _startButton = new FButton("YellowButton_normal", "YellowButton_down", "YellowButton_over", "ClickSound"); 37 | _startButton.AddLabel("Franchise","START",new Color(0.45f,0.25f,0.0f,1.0f)); 38 | 39 | AddChild(_startButton); 40 | 41 | _startButton.SignalRelease += HandleStartButtonRelease; 42 | 43 | _logoHolder.scale = 0.0f; 44 | 45 | Go.to(_logoHolder, 0.5f, new TweenConfig(). 46 | setDelay(0.1f). 47 | floatProp("scale",1.0f). 48 | setEaseType(EaseType.BackOut)); 49 | 50 | 51 | _startButton.scale = 0.0f; 52 | 53 | Go.to(_startButton, 0.5f, new TweenConfig(). 54 | setDelay(0.3f). 55 | floatProp("scale",1.0f). 56 | setEaseType(EaseType.BackOut)); 57 | 58 | HandleResize(true); //force resize to position everything at the start 59 | } 60 | 61 | protected void HandleResize(bool wasOrientationChange) 62 | { 63 | //this will scale the background up to fit the screen 64 | //but it won't let it shrink smaller than 100% 65 | _background.scale = Math.Max (1.0f,Math.Max (Futile.screen.height/_background.textureRect.height,Futile.screen.width/_background.textureRect.width)); 66 | 67 | _logoHolder.x = 0.0f; 68 | _logoHolder.y = 15.0f; 69 | 70 | _startButton.x = Futile.screen.halfWidth-75.0f; 71 | _startButton.y = -Futile.screen.halfHeight+35.0f; 72 | 73 | //scale the logo so it fits on the main screen 74 | _logo.scale = Math.Min(1.0f,Futile.screen.width/_logo.textureRect.width); 75 | 76 | } 77 | 78 | private void HandleStartButtonRelease (FButton button) 79 | { 80 | BMain.instance.GoToPage(BPageType.InGamePage); 81 | } 82 | 83 | protected void HandleUpdate () 84 | { 85 | _logo.rotation = -5.0f + RXMath.PingPong(_frameCount, 300) * 10.0f; 86 | 87 | _frameCount++; 88 | } 89 | 90 | } 91 | 92 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/BananaGame/Pages/BTitlePage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1866b12e44a677948b29572b65b30714 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c11156100fb12040b3d1104388ac6b2 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ebf03e707accb442a1bbafaf42ad109 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale1.png -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0849e6572862854d9e6ab08d1f4bd6a 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 0 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | textureFormat: -3 23 | maxTextureSize: 1024 24 | textureSettings: 25 | filterMode: -1 26 | aniso: -1 27 | mipBias: -1 28 | wrapMode: -1 29 | nPOTScale: 1 30 | lightmap: 0 31 | compressionQuality: 50 32 | textureType: 5 33 | buildTargetSettings: [] 34 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale1.txt: -------------------------------------------------------------------------------- 1 | {"frames": { 2 | 3 | "Banana.png": 4 | { 5 | "frame": {"x":353,"y":437,"w":102,"h":56}, 6 | "rotated": false, 7 | "trimmed": true, 8 | "spriteSourceSize": {"x":8,"y":4,"w":102,"h":56}, 9 | "sourceSize": {"w":120,"h":70} 10 | }, 11 | "CloseButton_down.png": 12 | { 13 | "frame": {"x":117,"y":503,"w":52,"h":54}, 14 | "rotated": false, 15 | "trimmed": true, 16 | "spriteSourceSize": {"x":0,"y":0,"w":52,"h":54}, 17 | "sourceSize": {"w":54,"h":54} 18 | }, 19 | "CloseButton_normal.png": 20 | { 21 | "frame": {"x":289,"y":467,"w":52,"h":54}, 22 | "rotated": false, 23 | "trimmed": true, 24 | "spriteSourceSize": {"x":0,"y":0,"w":52,"h":54}, 25 | "sourceSize": {"w":54,"h":54} 26 | }, 27 | "CloseButton_over.png": 28 | { 29 | "frame": {"x":233,"y":467,"w":52,"h":54}, 30 | "rotated": false, 31 | "trimmed": true, 32 | "spriteSourceSize": {"x":0,"y":0,"w":52,"h":54}, 33 | "sourceSize": {"w":54,"h":54} 34 | }, 35 | "FranchiseFont_Scale1.png": 36 | { 37 | "frame": {"x":3,"y":3,"w":244,"h":204}, 38 | "rotated": false, 39 | "trimmed": true, 40 | "spriteSourceSize": {"x":2,"y":2,"w":244,"h":204}, 41 | "sourceSize": {"w":256,"h":256} 42 | }, 43 | "Monkey_0.png": 44 | { 45 | "frame": {"x":3,"y":501,"w":110,"h":142}, 46 | "rotated": false, 47 | "trimmed": true, 48 | "spriteSourceSize": {"x":10,"y":0,"w":110,"h":142}, 49 | "sourceSize": {"w":130,"h":150} 50 | }, 51 | "Monkey_1.png": 52 | { 53 | "frame": {"x":119,"y":357,"w":110,"h":142}, 54 | "rotated": false, 55 | "trimmed": true, 56 | "spriteSourceSize": {"x":10,"y":0,"w":110,"h":142}, 57 | "sourceSize": {"w":130,"h":150} 58 | }, 59 | "Monkey_2.png": 60 | { 61 | "frame": {"x":237,"y":321,"w":112,"h":142}, 62 | "rotated": false, 63 | "trimmed": true, 64 | "spriteSourceSize": {"x":8,"y":0,"w":112,"h":142}, 65 | "sourceSize": {"w":130,"h":150} 66 | }, 67 | "Monkey_3.png": 68 | { 69 | "frame": {"x":3,"y":355,"w":112,"h":142}, 70 | "rotated": false, 71 | "trimmed": true, 72 | "spriteSourceSize": {"x":8,"y":0,"w":112,"h":142}, 73 | "sourceSize": {"w":130,"h":150} 74 | }, 75 | "Monkey_4.png": 76 | { 77 | "frame": {"x":121,"y":211,"w":112,"h":142}, 78 | "rotated": false, 79 | "trimmed": true, 80 | "spriteSourceSize": {"x":8,"y":0,"w":112,"h":142}, 81 | "sourceSize": {"w":130,"h":150} 82 | }, 83 | "Monkey_5.png": 84 | { 85 | "frame": {"x":387,"y":147,"w":114,"h":142}, 86 | "rotated": false, 87 | "trimmed": true, 88 | "spriteSourceSize": {"x":6,"y":0,"w":114,"h":142}, 89 | "sourceSize": {"w":130,"h":150} 90 | }, 91 | "Monkey_6.png": 92 | { 93 | "frame": {"x":3,"y":211,"w":114,"h":140}, 94 | "rotated": false, 95 | "trimmed": true, 96 | "spriteSourceSize": {"x":6,"y":2,"w":114,"h":140}, 97 | "sourceSize": {"w":130,"h":150} 98 | }, 99 | "Monkey_7.png": 100 | { 101 | "frame": {"x":369,"y":293,"w":114,"h":140}, 102 | "rotated": false, 103 | "trimmed": true, 104 | "spriteSourceSize": {"x":6,"y":2,"w":114,"h":140}, 105 | "sourceSize": {"w":130,"h":150} 106 | }, 107 | "Monkey_8.png": 108 | { 109 | "frame": {"x":251,"y":177,"w":114,"h":140}, 110 | "rotated": false, 111 | "trimmed": true, 112 | "spriteSourceSize": {"x":6,"y":2,"w":114,"h":140}, 113 | "sourceSize": {"w":130,"h":150} 114 | }, 115 | "Monkey_9.png": 116 | { 117 | "frame": {"x":387,"y":3,"w":116,"h":140}, 118 | "rotated": false, 119 | "trimmed": true, 120 | "spriteSourceSize": {"x":4,"y":2,"w":116,"h":140}, 121 | "sourceSize": {"w":130,"h":150} 122 | }, 123 | "YellowButton_down.png": 124 | { 125 | "frame": {"x":251,"y":119,"w":132,"h":54}, 126 | "rotated": false, 127 | "trimmed": true, 128 | "spriteSourceSize": {"x":0,"y":0,"w":132,"h":54}, 129 | "sourceSize": {"w":134,"h":54} 130 | }, 131 | "YellowButton_normal.png": 132 | { 133 | "frame": {"x":251,"y":61,"w":132,"h":54}, 134 | "rotated": false, 135 | "trimmed": true, 136 | "spriteSourceSize": {"x":0,"y":0,"w":132,"h":54}, 137 | "sourceSize": {"w":134,"h":54} 138 | }, 139 | "YellowButton_over.png": 140 | { 141 | "frame": {"x":251,"y":3,"w":132,"h":54}, 142 | "rotated": false, 143 | "trimmed": true, 144 | "spriteSourceSize": {"x":0,"y":0,"w":132,"h":54}, 145 | "sourceSize": {"w":134,"h":54} 146 | }}, 147 | "meta": { 148 | "app": "http://www.texturepacker.com", 149 | "version": "1.0", 150 | "image": "BananaGameAtlas_Scale1.png", 151 | "format": "RGBA8888", 152 | "size": {"w":512,"h":1024}, 153 | "scale": "1", 154 | "smartupdate": "$TexturePacker:SmartUpdate:662c8ac0ae332ccce06ecfabe1370bde$" 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale1.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d52024db9ac09243a4b8ecbf0204afd 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale2.png -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale2.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a9c156a76ae4434a99201ad67250088 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 0 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | textureFormat: -3 23 | maxTextureSize: 2048 24 | textureSettings: 25 | filterMode: -1 26 | aniso: -1 27 | mipBias: -1 28 | wrapMode: -1 29 | nPOTScale: 1 30 | lightmap: 0 31 | compressionQuality: 50 32 | textureType: 5 33 | buildTargetSettings: [] 34 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale2.txt: -------------------------------------------------------------------------------- 1 | {"frames": { 2 | 3 | "Banana.png": 4 | { 5 | "frame": {"x":451,"y":903,"w":200,"h":108}, 6 | "rotated": false, 7 | "trimmed": true, 8 | "spriteSourceSize": {"x":18,"y":10,"w":200,"h":108}, 9 | "sourceSize": {"w":240,"h":140} 10 | }, 11 | "CloseButton_down.png": 12 | { 13 | "frame": {"x":917,"y":1073,"w":104,"h":106}, 14 | "rotated": false, 15 | "trimmed": true, 16 | "spriteSourceSize": {"x":0,"y":0,"w":104,"h":106}, 17 | "sourceSize": {"w":108,"h":108} 18 | }, 19 | "CloseButton_normal.png": 20 | { 21 | "frame": {"x":917,"y":963,"w":104,"h":106}, 22 | "rotated": false, 23 | "trimmed": true, 24 | "spriteSourceSize": {"x":0,"y":0,"w":104,"h":106}, 25 | "sourceSize": {"w":108,"h":108} 26 | }, 27 | "CloseButton_over.png": 28 | { 29 | "frame": {"x":917,"y":853,"w":104,"h":106}, 30 | "rotated": false, 31 | "trimmed": true, 32 | "spriteSourceSize": {"x":0,"y":0,"w":104,"h":106}, 33 | "sourceSize": {"w":108,"h":108} 34 | }, 35 | "FranchiseFont_Scale2.png": 36 | { 37 | "frame": {"x":3,"y":3,"w":500,"h":362}, 38 | "rotated": false, 39 | "trimmed": true, 40 | "spriteSourceSize": {"x":4,"y":4,"w":500,"h":362}, 41 | "sourceSize": {"w":512,"h":512} 42 | }, 43 | "Monkey_0.png": 44 | { 45 | "frame": {"x":227,"y":655,"w":220,"h":284}, 46 | "rotated": false, 47 | "trimmed": true, 48 | "spriteSourceSize": {"x":20,"y":0,"w":220,"h":284}, 49 | "sourceSize": {"w":260,"h":300} 50 | }, 51 | "Monkey_1.png": 52 | { 53 | "frame": {"x":3,"y":655,"w":220,"h":284}, 54 | "rotated": false, 55 | "trimmed": true, 56 | "spriteSourceSize": {"x":20,"y":0,"w":220,"h":284}, 57 | "sourceSize": {"w":260,"h":300} 58 | }, 59 | "Monkey_2.png": 60 | { 61 | "frame": {"x":691,"y":853,"w":222,"h":282}, 62 | "rotated": false, 63 | "trimmed": true, 64 | "spriteSourceSize": {"x":18,"y":2,"w":222,"h":282}, 65 | "sourceSize": {"w":260,"h":300} 66 | }, 67 | "Monkey_3.png": 68 | { 69 | "frame": {"x":463,"y":617,"w":224,"h":282}, 70 | "rotated": false, 71 | "trimmed": true, 72 | "spriteSourceSize": {"x":16,"y":2,"w":224,"h":282}, 73 | "sourceSize": {"w":260,"h":300} 74 | }, 75 | "Monkey_4.png": 76 | { 77 | "frame": {"x":233,"y":369,"w":226,"h":282}, 78 | "rotated": false, 79 | "trimmed": true, 80 | "spriteSourceSize": {"x":14,"y":2,"w":226,"h":282}, 81 | "sourceSize": {"w":260,"h":300} 82 | }, 83 | "Monkey_5.png": 84 | { 85 | "frame": {"x":3,"y":369,"w":226,"h":282}, 86 | "rotated": false, 87 | "trimmed": true, 88 | "spriteSourceSize": {"x":14,"y":2,"w":226,"h":282}, 89 | "sourceSize": {"w":260,"h":300} 90 | }, 91 | "Monkey_6.png": 92 | { 93 | "frame": {"x":739,"y":569,"w":228,"h":280}, 94 | "rotated": false, 95 | "trimmed": true, 96 | "spriteSourceSize": {"x":12,"y":4,"w":228,"h":280}, 97 | "sourceSize": {"w":260,"h":300} 98 | }, 99 | "Monkey_7.png": 100 | { 101 | "frame": {"x":507,"y":333,"w":228,"h":280}, 102 | "rotated": false, 103 | "trimmed": true, 104 | "spriteSourceSize": {"x":12,"y":4,"w":228,"h":280}, 105 | "sourceSize": {"w":260,"h":300} 106 | }, 107 | "Monkey_8.png": 108 | { 109 | "frame": {"x":775,"y":285,"w":230,"h":280}, 110 | "rotated": false, 111 | "trimmed": true, 112 | "spriteSourceSize": {"x":10,"y":4,"w":230,"h":280}, 113 | "sourceSize": {"w":260,"h":300} 114 | }, 115 | "Monkey_9.png": 116 | { 117 | "frame": {"x":775,"y":3,"w":232,"h":278}, 118 | "rotated": false, 119 | "trimmed": true, 120 | "spriteSourceSize": {"x":8,"y":6,"w":232,"h":278}, 121 | "sourceSize": {"w":260,"h":300} 122 | }, 123 | "YellowButton_down.png": 124 | { 125 | "frame": {"x":507,"y":223,"w":264,"h":106}, 126 | "rotated": false, 127 | "trimmed": true, 128 | "spriteSourceSize": {"x":0,"y":0,"w":264,"h":106}, 129 | "sourceSize": {"w":268,"h":108} 130 | }, 131 | "YellowButton_normal.png": 132 | { 133 | "frame": {"x":507,"y":113,"w":264,"h":106}, 134 | "rotated": false, 135 | "trimmed": true, 136 | "spriteSourceSize": {"x":0,"y":0,"w":264,"h":106}, 137 | "sourceSize": {"w":268,"h":108} 138 | }, 139 | "YellowButton_over.png": 140 | { 141 | "frame": {"x":507,"y":3,"w":264,"h":106}, 142 | "rotated": false, 143 | "trimmed": true, 144 | "spriteSourceSize": {"x":0,"y":0,"w":264,"h":106}, 145 | "sourceSize": {"w":268,"h":108} 146 | }}, 147 | "meta": { 148 | "app": "http://www.texturepacker.com", 149 | "version": "1.0", 150 | "image": "BananaGameAtlas_Scale2.png", 151 | "format": "RGBA8888", 152 | "size": {"w":1024,"h":2048}, 153 | "scale": "1", 154 | "smartupdate": "$TexturePacker:SmartUpdate:6e4f456152a68fd19c6e906d4a9f6a4a$" 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale2.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ab7b98bc4ac97a458f0f2c95acba801 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale4.png -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale4.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d90d2cc49dc51314ab876caad11ae43f 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 0 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | textureFormat: -3 23 | maxTextureSize: 4096 24 | textureSettings: 25 | filterMode: -1 26 | aniso: -1 27 | mipBias: -1 28 | wrapMode: -1 29 | nPOTScale: 1 30 | lightmap: 0 31 | compressionQuality: 50 32 | textureType: 5 33 | buildTargetSettings: [] 34 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale4.txt: -------------------------------------------------------------------------------- 1 | {"frames": { 2 | 3 | "Banana.png": 4 | { 5 | "frame": {"x":881,"y":1767,"w":400,"h":218}, 6 | "rotated": false, 7 | "trimmed": true, 8 | "spriteSourceSize": {"x":36,"y":20,"w":400,"h":218}, 9 | "sourceSize": {"w":480,"h":280} 10 | }, 11 | "CloseButton_down.png": 12 | { 13 | "frame": {"x":1795,"y":2115,"w":208,"h":206}, 14 | "rotated": false, 15 | "trimmed": true, 16 | "spriteSourceSize": {"x":2,"y":4,"w":208,"h":206}, 17 | "sourceSize": {"w":216,"h":216} 18 | }, 19 | "CloseButton_normal.png": 20 | { 21 | "frame": {"x":1795,"y":1905,"w":208,"h":206}, 22 | "rotated": false, 23 | "trimmed": true, 24 | "spriteSourceSize": {"x":2,"y":4,"w":208,"h":206}, 25 | "sourceSize": {"w":216,"h":216} 26 | }, 27 | "CloseButton_over.png": 28 | { 29 | "frame": {"x":1795,"y":1695,"w":208,"h":206}, 30 | "rotated": false, 31 | "trimmed": true, 32 | "spriteSourceSize": {"x":2,"y":4,"w":208,"h":206}, 33 | "sourceSize": {"w":216,"h":216} 34 | }, 35 | "FranchiseFont_Scale4.png": 36 | { 37 | "frame": {"x":3,"y":3,"w":992,"h":662}, 38 | "rotated": false, 39 | "trimmed": true, 40 | "spriteSourceSize": {"x":8,"y":8,"w":992,"h":662}, 41 | "sourceSize": {"w":1024,"h":1024} 42 | }, 43 | "Monkey_0.png": 44 | { 45 | "frame": {"x":443,"y":1237,"w":434,"h":568}, 46 | "rotated": false, 47 | "trimmed": true, 48 | "spriteSourceSize": {"x":44,"y":0,"w":434,"h":568}, 49 | "sourceSize": {"w":520,"h":600} 50 | }, 51 | "Monkey_1.png": 52 | { 53 | "frame": {"x":3,"y":1237,"w":436,"h":568}, 54 | "rotated": false, 55 | "trimmed": true, 56 | "spriteSourceSize": {"x":42,"y":0,"w":436,"h":568}, 57 | "sourceSize": {"w":520,"h":600} 58 | }, 59 | "Monkey_2.png": 60 | { 61 | "frame": {"x":1351,"y":1695,"w":440,"h":566}, 62 | "rotated": false, 63 | "trimmed": true, 64 | "spriteSourceSize": {"x":38,"y":2,"w":440,"h":566}, 65 | "sourceSize": {"w":520,"h":600} 66 | }, 67 | "Monkey_3.png": 68 | { 69 | "frame": {"x":905,"y":1197,"w":442,"h":566}, 70 | "rotated": false, 71 | "trimmed": true, 72 | "spriteSourceSize": {"x":36,"y":2,"w":442,"h":566}, 73 | "sourceSize": {"w":520,"h":600} 74 | }, 75 | "Monkey_4.png": 76 | { 77 | "frame": {"x":455,"y":669,"w":446,"h":564}, 78 | "rotated": false, 79 | "trimmed": true, 80 | "spriteSourceSize": {"x":32,"y":4,"w":446,"h":564}, 81 | "sourceSize": {"w":520,"h":600} 82 | }, 83 | "Monkey_5.png": 84 | { 85 | "frame": {"x":3,"y":669,"w":448,"h":564}, 86 | "rotated": false, 87 | "trimmed": true, 88 | "spriteSourceSize": {"x":30,"y":4,"w":448,"h":564}, 89 | "sourceSize": {"w":520,"h":600} 90 | }, 91 | "Monkey_6.png": 92 | { 93 | "frame": {"x":1455,"y":1129,"w":450,"h":562}, 94 | "rotated": false, 95 | "trimmed": true, 96 | "spriteSourceSize": {"x":28,"y":6,"w":450,"h":562}, 97 | "sourceSize": {"w":520,"h":600} 98 | }, 99 | "Monkey_7.png": 100 | { 101 | "frame": {"x":999,"y":633,"w":452,"h":560}, 102 | "rotated": false, 103 | "trimmed": true, 104 | "spriteSourceSize": {"x":26,"y":8,"w":452,"h":560}, 105 | "sourceSize": {"w":520,"h":600} 106 | }, 107 | "Monkey_8.png": 108 | { 109 | "frame": {"x":1531,"y":565,"w":454,"h":560}, 110 | "rotated": false, 111 | "trimmed": true, 112 | "spriteSourceSize": {"x":24,"y":8,"w":454,"h":560}, 113 | "sourceSize": {"w":520,"h":600} 114 | }, 115 | "Monkey_9.png": 116 | { 117 | "frame": {"x":1531,"y":3,"w":458,"h":558}, 118 | "rotated": false, 119 | "trimmed": true, 120 | "spriteSourceSize": {"x":20,"y":10,"w":458,"h":558}, 121 | "sourceSize": {"w":520,"h":600} 122 | }, 123 | "YellowButton_down.png": 124 | { 125 | "frame": {"x":999,"y":423,"w":528,"h":206}, 126 | "rotated": false, 127 | "trimmed": true, 128 | "spriteSourceSize": {"x":2,"y":4,"w":528,"h":206}, 129 | "sourceSize": {"w":536,"h":216} 130 | }, 131 | "YellowButton_normal.png": 132 | { 133 | "frame": {"x":999,"y":213,"w":528,"h":206}, 134 | "rotated": false, 135 | "trimmed": true, 136 | "spriteSourceSize": {"x":2,"y":4,"w":528,"h":206}, 137 | "sourceSize": {"w":536,"h":216} 138 | }, 139 | "YellowButton_over.png": 140 | { 141 | "frame": {"x":999,"y":3,"w":528,"h":206}, 142 | "rotated": false, 143 | "trimmed": true, 144 | "spriteSourceSize": {"x":2,"y":4,"w":528,"h":206}, 145 | "sourceSize": {"w":536,"h":216} 146 | }}, 147 | "meta": { 148 | "app": "http://www.texturepacker.com", 149 | "version": "1.0", 150 | "image": "BananaGameAtlas_Scale4.png", 151 | "format": "RGBA8888", 152 | "size": {"w":2048,"h":4096}, 153 | "scale": "1", 154 | "smartupdate": "$TexturePacker:SmartUpdate:76986ee8ac0628ea412270d32bd8b145$" 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaGameAtlas_Scale4.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 703139d557207f5428ccad765b350909 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale1.json: -------------------------------------------------------------------------------- 1 | {"frames": { 2 | 3 | "JungleBlurryBG.png": 4 | { 5 | "frame": {"x":3,"y":397,"w":530,"h":390}, 6 | "rotated": false, 7 | "trimmed": false, 8 | "spriteSourceSize": {"x":0,"y":0,"w":530,"h":390}, 9 | "sourceSize": {"w":530,"h":390} 10 | }, 11 | "JungleClearBG.png": 12 | { 13 | "frame": {"x":3,"y":3,"w":530,"h":390}, 14 | "rotated": false, 15 | "trimmed": false, 16 | "spriteSourceSize": {"x":0,"y":0,"w":530,"h":390}, 17 | "sourceSize": {"w":530,"h":390} 18 | }, 19 | "MainLogo.png": 20 | { 21 | "frame": {"x":537,"y":3,"w":455,"h":265}, 22 | "rotated": false, 23 | "trimmed": false, 24 | "spriteSourceSize": {"x":0,"y":0,"w":455,"h":265}, 25 | "sourceSize": {"w":455,"h":265} 26 | }}, 27 | "meta": { 28 | "app": "http://www.texturepacker.com", 29 | "version": "1.0", 30 | "image": "BananaLargeAtlas_Scale1.png", 31 | "format": "RGBA8888", 32 | "size": {"w":1024,"h":1024}, 33 | "scale": "1", 34 | "smartupdate": "$TexturePacker:SmartUpdate:b85daf9f6a8887243cae02ba43db60a8$" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale1.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0136dc5494d136d4186adc354892fe3e 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale1.png -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fbcb1087feee5546ad6e87c25573146 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 0 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | textureFormat: -3 23 | maxTextureSize: 1024 24 | textureSettings: 25 | filterMode: -1 26 | aniso: -1 27 | mipBias: -1 28 | wrapMode: -1 29 | nPOTScale: 1 30 | lightmap: 0 31 | compressionQuality: 50 32 | textureType: 5 33 | buildTargetSettings: [] 34 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale1.txt: -------------------------------------------------------------------------------- 1 | {"frames": { 2 | 3 | "JungleBlurryBG.png": 4 | { 5 | "frame": {"x":3,"y":397,"w":530,"h":390}, 6 | "rotated": false, 7 | "trimmed": false, 8 | "spriteSourceSize": {"x":0,"y":0,"w":530,"h":390}, 9 | "sourceSize": {"w":530,"h":390} 10 | }, 11 | "JungleClearBG.png": 12 | { 13 | "frame": {"x":3,"y":3,"w":530,"h":390}, 14 | "rotated": false, 15 | "trimmed": false, 16 | "spriteSourceSize": {"x":0,"y":0,"w":530,"h":390}, 17 | "sourceSize": {"w":530,"h":390} 18 | }, 19 | "MainLogo.png": 20 | { 21 | "frame": {"x":537,"y":3,"w":439,"h":247}, 22 | "rotated": false, 23 | "trimmed": true, 24 | "spriteSourceSize": {"x":13,"y":10,"w":439,"h":247}, 25 | "sourceSize": {"w":455,"h":265} 26 | }}, 27 | "meta": { 28 | "app": "http://www.texturepacker.com", 29 | "version": "1.0", 30 | "image": "BananaLargeAtlas_Scale1.png", 31 | "format": "RGBA8888", 32 | "size": {"w":1024,"h":1024}, 33 | "scale": "1", 34 | "smartupdate": "$TexturePacker:SmartUpdate:49e2ae4e8d77bb42816c74a69c0dedd8$" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale1.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05b24825624bbae428fb6d62bea8293b 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale2.png -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale2.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 487ec34b9f240884fbe91cb7c86879d5 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 0 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | textureFormat: -3 23 | maxTextureSize: 2048 24 | textureSettings: 25 | filterMode: -1 26 | aniso: -1 27 | mipBias: -1 28 | wrapMode: -1 29 | nPOTScale: 1 30 | lightmap: 0 31 | compressionQuality: 50 32 | textureType: 5 33 | buildTargetSettings: [] 34 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale2.txt: -------------------------------------------------------------------------------- 1 | {"frames": { 2 | 3 | "JungleBlurryBG.png": 4 | { 5 | "frame": {"x":3,"y":787,"w":1060,"h":780}, 6 | "rotated": false, 7 | "trimmed": false, 8 | "spriteSourceSize": {"x":0,"y":0,"w":1060,"h":780}, 9 | "sourceSize": {"w":1060,"h":780} 10 | }, 11 | "JungleClearBG.png": 12 | { 13 | "frame": {"x":3,"y":3,"w":1060,"h":780}, 14 | "rotated": false, 15 | "trimmed": false, 16 | "spriteSourceSize": {"x":0,"y":0,"w":1060,"h":780}, 17 | "sourceSize": {"w":1060,"h":780} 18 | }, 19 | "MainLogo.png": 20 | { 21 | "frame": {"x":1067,"y":3,"w":876,"h":494}, 22 | "rotated": false, 23 | "trimmed": true, 24 | "spriteSourceSize": {"x":28,"y":19,"w":876,"h":494}, 25 | "sourceSize": {"w":910,"h":530} 26 | }}, 27 | "meta": { 28 | "app": "http://www.texturepacker.com", 29 | "version": "1.0", 30 | "image": "BananaLargeAtlas_Scale2.png", 31 | "format": "RGBA8888", 32 | "size": {"w":2048,"h":2048}, 33 | "scale": "1", 34 | "smartupdate": "$TexturePacker:SmartUpdate:2c0485b8cbabc0d7707dca05c65e937f$" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale2.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d81648589e9378e48bbc214381a59c84 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale4.png -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale4.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35a44a9e69b13114a92cb2b4728538bd 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 0 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | textureFormat: -3 23 | maxTextureSize: 4096 24 | textureSettings: 25 | filterMode: -1 26 | aniso: -1 27 | mipBias: -1 28 | wrapMode: -1 29 | nPOTScale: 1 30 | lightmap: 0 31 | compressionQuality: 50 32 | textureType: 5 33 | buildTargetSettings: [] 34 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale4.txt: -------------------------------------------------------------------------------- 1 | {"frames": { 2 | 3 | "JungleBlurryBG.png": 4 | { 5 | "frame": {"x":3,"y":1567,"w":2120,"h":1560}, 6 | "rotated": false, 7 | "trimmed": false, 8 | "spriteSourceSize": {"x":0,"y":0,"w":2120,"h":1560}, 9 | "sourceSize": {"w":2120,"h":1560} 10 | }, 11 | "JungleClearBG.png": 12 | { 13 | "frame": {"x":3,"y":3,"w":2120,"h":1560}, 14 | "rotated": false, 15 | "trimmed": false, 16 | "spriteSourceSize": {"x":0,"y":0,"w":2120,"h":1560}, 17 | "sourceSize": {"w":2120,"h":1560} 18 | }, 19 | "MainLogo.png": 20 | { 21 | "frame": {"x":2127,"y":3,"w":1750,"h":984}, 22 | "rotated": false, 23 | "trimmed": true, 24 | "spriteSourceSize": {"x":57,"y":40,"w":1750,"h":984}, 25 | "sourceSize": {"w":1820,"h":1060} 26 | }}, 27 | "meta": { 28 | "app": "http://www.texturepacker.com", 29 | "version": "1.0", 30 | "image": "BananaLargeAtlas_Scale4.png", 31 | "format": "RGBA8888", 32 | "size": {"w":4096,"h":4096}, 33 | "scale": "1", 34 | "smartupdate": "$TexturePacker:SmartUpdate:86f133f0f25e15aa2de39c4ccf351b8c$" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/BananaLargeAtlas_Scale4.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad366c91437e96f41ba650f47853e14f 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/FranchiseFont_Scale1.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d78aec4a8379b0742be3145ae4fc7731 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/FranchiseFont_Scale2.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 129f1719588798247920b00e01501af9 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/FranchiseFont_Scale4.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3d01cbcf85c2da48a5a377a69d13990 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale1.png -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a82e0caf50177e4c8840510eda8f758 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 1 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | textureFormat: -3 23 | maxTextureSize: 4096 24 | textureSettings: 25 | filterMode: -1 26 | aniso: -1 27 | mipBias: -1 28 | wrapMode: -1 29 | nPOTScale: 1 30 | lightmap: 0 31 | compressionQuality: 50 32 | textureType: -1 33 | buildTargetSettings: [] 34 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale1.txt: -------------------------------------------------------------------------------- 1 | {"frames": { 2 | 3 | "Debug/Circle.png": 4 | { 5 | "frame": {"x":3,"y":75,"w":32,"h":32}, 6 | "rotated": false, 7 | "trimmed": false, 8 | "spriteSourceSize": {"x":0,"y":0,"w":32,"h":32}, 9 | "sourceSize": {"w":32,"h":32} 10 | }, 11 | "Debug/Square.png": 12 | { 13 | "frame": {"x":3,"y":39,"w":32,"h":32}, 14 | "rotated": false, 15 | "trimmed": false, 16 | "spriteSourceSize": {"x":0,"y":0,"w":32,"h":32}, 17 | "sourceSize": {"w":32,"h":32} 18 | }, 19 | "Debug/Triangle.png": 20 | { 21 | "frame": {"x":3,"y":3,"w":32,"h":32}, 22 | "rotated": false, 23 | "trimmed": false, 24 | "spriteSourceSize": {"x":0,"y":0,"w":32,"h":32}, 25 | "sourceSize": {"w":32,"h":32} 26 | }}, 27 | "meta": { 28 | "app": "http://www.texturepacker.com", 29 | "version": "1.0", 30 | "image": "GameAtlas_Scale1.png", 31 | "format": "RGBA8888", 32 | "size": {"w":64,"h":128}, 33 | "scale": "0.25", 34 | "smartupdate": "$TexturePacker:SmartUpdate:40d28864ff9590af79bf1163a16d117d$" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale1.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 536b48140c733e64684432eb0abd30c9 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale2.png -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale2.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 439ad2843841a2f4bbab7bf71f4a720f 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 1 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | textureFormat: -3 23 | maxTextureSize: 4096 24 | textureSettings: 25 | filterMode: -1 26 | aniso: -1 27 | mipBias: -1 28 | wrapMode: -1 29 | nPOTScale: 1 30 | lightmap: 0 31 | compressionQuality: 50 32 | textureType: -1 33 | buildTargetSettings: [] 34 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale2.txt: -------------------------------------------------------------------------------- 1 | {"frames": { 2 | 3 | "Debug/Circle.png": 4 | { 5 | "frame": {"x":3,"y":139,"w":64,"h":64}, 6 | "rotated": false, 7 | "trimmed": false, 8 | "spriteSourceSize": {"x":0,"y":0,"w":64,"h":64}, 9 | "sourceSize": {"w":64,"h":64} 10 | }, 11 | "Debug/Square.png": 12 | { 13 | "frame": {"x":3,"y":71,"w":64,"h":64}, 14 | "rotated": false, 15 | "trimmed": false, 16 | "spriteSourceSize": {"x":0,"y":0,"w":64,"h":64}, 17 | "sourceSize": {"w":64,"h":64} 18 | }, 19 | "Debug/Triangle.png": 20 | { 21 | "frame": {"x":3,"y":3,"w":64,"h":64}, 22 | "rotated": false, 23 | "trimmed": false, 24 | "spriteSourceSize": {"x":0,"y":0,"w":64,"h":64}, 25 | "sourceSize": {"w":64,"h":64} 26 | }}, 27 | "meta": { 28 | "app": "http://www.texturepacker.com", 29 | "version": "1.0", 30 | "image": "GameAtlas_Scale2.png", 31 | "format": "RGBA8888", 32 | "size": {"w":128,"h":256}, 33 | "scale": "0.5", 34 | "smartupdate": "$TexturePacker:SmartUpdate:94990f2cbf40672db6ea04f14bc77ecf$" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale2.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7be65f9121a53d46a85e636c484403b 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale4.png -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale4.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9748980ce8a48948b57e27756acac3b 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 1 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | textureFormat: -3 23 | maxTextureSize: 4096 24 | textureSettings: 25 | filterMode: -1 26 | aniso: -1 27 | mipBias: -1 28 | wrapMode: -1 29 | nPOTScale: 1 30 | lightmap: 0 31 | compressionQuality: 50 32 | textureType: -1 33 | buildTargetSettings: [] 34 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale4.txt: -------------------------------------------------------------------------------- 1 | {"frames": { 2 | 3 | "Debug/Circle.png": 4 | { 5 | "frame": {"x":3,"y":267,"w":128,"h":128}, 6 | "rotated": false, 7 | "trimmed": false, 8 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 9 | "sourceSize": {"w":128,"h":128} 10 | }, 11 | "Debug/Square.png": 12 | { 13 | "frame": {"x":3,"y":135,"w":128,"h":128}, 14 | "rotated": false, 15 | "trimmed": false, 16 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 17 | "sourceSize": {"w":128,"h":128} 18 | }, 19 | "Debug/Triangle.png": 20 | { 21 | "frame": {"x":3,"y":3,"w":128,"h":128}, 22 | "rotated": false, 23 | "trimmed": false, 24 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 25 | "sourceSize": {"w":128,"h":128} 26 | }}, 27 | "meta": { 28 | "app": "http://www.texturepacker.com", 29 | "version": "1.0", 30 | "image": "GameAtlas_Scale4.png", 31 | "format": "RGBA8888", 32 | "size": {"w":256,"h":512}, 33 | "scale": "1", 34 | "smartupdate": "$TexturePacker:SmartUpdate:e4f897670013f6e84560a1d9b2b8613f$" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Atlases/GameAtlas_Scale4.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26774cdabb2c48c42a76d27578bc5458 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Audio.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1df59ba403d7704f9c019d411fa4192 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Audio/BananaSound.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Audio/BananaSound.wav -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Audio/BananaSound.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2890db2cabc776b458440545530609c0 3 | AudioImporter: 4 | serializedVersion: 4 5 | format: -1 6 | quality: .439999998 7 | stream: 1 8 | 3D: 0 9 | forceToMono: 0 10 | useHardware: 0 11 | loopable: 0 12 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Audio/ClickSound.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Audio/ClickSound.wav -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Audio/ClickSound.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0eb2be993838144c85b1d1e3a5928df 3 | AudioImporter: 4 | serializedVersion: 4 5 | format: -1 6 | quality: .439999998 7 | stream: 1 8 | 3D: 0 9 | forceToMono: 0 10 | useHardware: 0 11 | loopable: 0 12 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Audio/NormalMusic.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Audio/NormalMusic.wav -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Audio/NormalMusic.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ca13601dd9dd9240b0beb64613ee139 3 | AudioImporter: 4 | serializedVersion: 4 5 | format: 0 6 | quality: .360000014 7 | stream: 0 8 | 3D: 0 9 | forceToMono: 1 10 | useHardware: 0 11 | loopable: 1 12 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Audio/VictoryMusic.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Audio/VictoryMusic.wav -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Audio/VictoryMusic.wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd0d5bba932b27a448519e5c96a22f90 3 | AudioImporter: 4 | serializedVersion: 4 5 | format: 0 6 | quality: .360000014 7 | stream: 0 8 | 3D: 0 9 | forceToMono: 1 10 | useHardware: 0 11 | loopable: 1 12 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Particles.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fa1f098c90cc3242a571a6ca4dd589c 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Particles/BananaParticles.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Particles/BananaParticles.prefab -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Particles/BananaParticles.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68fdec72dbfd2af45ada1f84dd733c49 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Particles/BasicParticleMaterial.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileDemos/Resources/Particles/BasicParticleMaterial.mat -------------------------------------------------------------------------------- /FutileProject/Assets/FutileDemos/Resources/Particles/BasicParticleMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55f89bd6f1550844c80b36c8552cfaa1 3 | -------------------------------------------------------------------------------- /FutileProject/Assets/FutileScene.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/Assets/FutileScene.unity -------------------------------------------------------------------------------- /FutileProject/Assets/FutileScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a5c170ad1337a74da45499f2b9f0b97 3 | -------------------------------------------------------------------------------- /FutileProject/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.3.9", 4 | "com.unity.ide.rider": "2.0.7", 5 | "com.unity.ide.visualstudio": "2.0.5", 6 | "com.unity.ide.vscode": "1.2.3", 7 | "com.unity.test-framework": "1.1.22", 8 | "com.unity.textmeshpro": "3.0.1", 9 | "com.unity.timeline": "1.4.6", 10 | "com.unity.ugui": "1.0.0", 11 | "com.unity.modules.ai": "1.0.0", 12 | "com.unity.modules.androidjni": "1.0.0", 13 | "com.unity.modules.animation": "1.0.0", 14 | "com.unity.modules.assetbundle": "1.0.0", 15 | "com.unity.modules.audio": "1.0.0", 16 | "com.unity.modules.cloth": "1.0.0", 17 | "com.unity.modules.director": "1.0.0", 18 | "com.unity.modules.imageconversion": "1.0.0", 19 | "com.unity.modules.imgui": "1.0.0", 20 | "com.unity.modules.jsonserialize": "1.0.0", 21 | "com.unity.modules.particlesystem": "1.0.0", 22 | "com.unity.modules.physics": "1.0.0", 23 | "com.unity.modules.physics2d": "1.0.0", 24 | "com.unity.modules.screencapture": "1.0.0", 25 | "com.unity.modules.terrain": "1.0.0", 26 | "com.unity.modules.terrainphysics": "1.0.0", 27 | "com.unity.modules.tilemap": "1.0.0", 28 | "com.unity.modules.ui": "1.0.0", 29 | "com.unity.modules.uielements": "1.0.0", 30 | "com.unity.modules.umbra": "1.0.0", 31 | "com.unity.modules.unityanalytics": "1.0.0", 32 | "com.unity.modules.unitywebrequest": "1.0.0", 33 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 34 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 35 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 36 | "com.unity.modules.unitywebrequestwww": "1.0.0", 37 | "com.unity.modules.vehicles": "1.0.0", 38 | "com.unity.modules.video": "1.0.0", 39 | "com.unity.modules.vr": "1.0.0", 40 | "com.unity.modules.wind": "1.0.0", 41 | "com.unity.modules.xr": "1.0.0" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_SimulationMode: 0 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 0 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.2.5f1 2 | m_EditorVersionWithRevision: 2020.2.5f1 (e2c53f129de5) 3 | -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MattRix/Futile/184151bf72fa54b49a571bf5d0a0d2ff96b48095/FutileProject/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | m_CompiledVersion: 0 14 | m_RuntimeVersion: 0 15 | -------------------------------------------------------------------------------- /FutileProject/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /FutileProject/UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | RecentlyUsedScenePath-0: 9 | value: 224247031146467d181a052e15105c151812563f22213229 10 | flags: 0 11 | vcPassword: 12 | value: 13 | flags: 0 14 | vcServer: 15 | value: 16 | flags: 0 17 | vcSharedLogLevel: 18 | value: 0d5e400f0650 19 | flags: 0 20 | vcUsername: 21 | value: 22 | flags: 0 23 | vcWorkspace: 24 | value: 25 | flags: 0 26 | m_VCAutomaticAdd: 0 27 | m_VCDebugCom: 0 28 | m_VCDebugCmd: 0 29 | m_VCDebugOut: 0 30 | m_SemanticMergeMode: 2 31 | m_VCShowFailedCheckout: 1 32 | m_VCOverwriteFailedCheckoutAssets: 1 33 | m_VCProjectOverlayIcons: 1 34 | m_VCHierarchyOverlayIcons: 1 35 | m_VCOtherOverlayIcons: 1 36 | m_VCAllowAsyncUpdate: 1 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Futile (2021 Edition) 3 | 4 | Futile is a code-centric 2D framework for Unity. 5 | 6 | This is for those of you who want to do everything in code with as little editor integration as possible. 7 | 8 | If you've used Cocos2D or Flash you should feel right at home. 9 | 10 | It's in development and completely undocumented... but it works. 11 | 12 | 2021 note from Matt: Futile hasn't been updated a whole lot since I first released it, but it has been used (and continues to be used) in a bunch of real games 13 | ___ 14 | 15 | ## Go to http://struct.ca/futile for UnityPackages and instructional videos 16 | 17 | ## Ask questions and share stuff you've made on http://reddit.com/r/futile 18 | 19 | ## Submit bugs and feature requests to http://github.com/MattRix/Futile/issues 20 | 21 | ## Futile works great with all versions of Unity (but let me know if you have any issues!) 22 | 23 | ## How to try the demo project: ## 24 | 25 | #### How to open the project 26 | 27 | - Grab the project from github and put it somewhere - [For the lazy, here's a zip of the whole repo](https://github.com/MattRix/Futile/zipball/master) 28 | - Make sure you have Unity installed 29 | - Go into FutileProject/Assets and open FutileScene.unity 30 | 31 | 32 | ## Third Party add-ons for Futile 33 | 34 | - https://github.com/ManaOrb/FSceneManager (Futile Scene Manager and Parallax Scrolling Layer) 35 | - https://github.com/mattfox12/FutileAdditionalClasses (including animated sprites and TMX tilemaps) 36 | - https://github.com/Grizzlage/Futile-SpineSprite (for using animations made with Spine) 37 | - https://gist.github.com/jpsarda/4573831 (FDrawingSprite.cs, for drawing lines) 38 | 39 | 40 | ## Legal stuff ## 41 | 42 | Futile contains many ideas from Prime 31's UIToolkit: [github.com/Prime31/UIToolkit](http://github.com/Prime31/UIToolkit) 43 | 44 | The MiniJSON parser is by http://github.com/darktable 45 | 46 | The demo project also uses Prime31's fantastic GoKit tweening library: [github.com/Prime31/GoKit](http://github.com/Prime31/GoKit) 47 | 48 | #### The code and art assets (except for the font) can be used for anything, however the sound effects and music are not to be used in anything else 49 | #### GoKit's license is here: https://github.com/prime31/GoKit 50 | #### The font is [Franchise](http://www.losttype.com/font/?name=franchise) 51 | 52 | ## MIT License ## 53 | 54 | Source code for Futile is Copyright © 2019 Matt Rix and contributors. 55 | 56 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 57 | 58 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 59 | 60 | THE SOFTWARE IS PROVIDED “AS IS,” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 61 | 62 | --------------------------------------------------------------------------------