From 995a15e893244ad1a6fe1ec00c00cd753e9e0dd8 Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Thu, 24 Nov 2022 21:02:48 +0100 Subject: [PATCH 01/14] fix(ci): add authentication --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68bc937..e84548a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -267,6 +267,8 @@ jobs: - name: Upload build uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.release.outputs.uploadUrl }} asset_path: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }}.zip From 63e46ac44cff3d8fade543a8653d8573b061e849 Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Thu, 24 Nov 2022 23:17:48 +0100 Subject: [PATCH 02/14] fix(ci): disable webgl compression --- TanksOnAPlain/ProjectSettings/ProjectSettings.asset | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TanksOnAPlain/ProjectSettings/ProjectSettings.asset b/TanksOnAPlain/ProjectSettings/ProjectSettings.asset index a0a74b0..054c539 100644 --- a/TanksOnAPlain/ProjectSettings/ProjectSettings.asset +++ b/TanksOnAPlain/ProjectSettings/ProjectSettings.asset @@ -524,20 +524,20 @@ PlayerSettings: blurSplashScreenBackground: 1 spritePackerPolicy: webGLMemorySize: 32 - webGLExceptionSupport: 1 + webGLExceptionSupport: 0 webGLNameFilesAsHashes: 0 - webGLDataCaching: 1 + webGLDataCaching: 0 webGLDebugSymbols: 0 webGLEmscriptenArgs: webGLModulesDirectory: webGLTemplate: APPLICATION:Default webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 - webGLCompressionFormat: 0 + webGLCompressionFormat: 2 webGLWasmArithmeticExceptions: 0 webGLLinkerTarget: 1 webGLThreadsSupport: 0 - webGLDecompressionFallback: 0 + webGLDecompressionFallback: 1 scriptingDefineSymbols: Standalone: ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_VALIDATOR;ODIN_VALIDATOR_3_1 additionalCompilerArguments: {} From 3c19b6690d9a2d5f74448fe51316bf9b6fa87c26 Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Thu, 24 Nov 2022 23:28:02 +0100 Subject: [PATCH 03/14] fix(ci): fix build path --- .github/workflows/ci.yml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e84548a..2f5d863 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -230,15 +230,30 @@ jobs: targetPlatform: ${{ matrix.buildTarget }} projectPath: ${{ env.PROJECT_DIR }} buildName: ${{ env.PROJECT_NAME }} - buildsPath: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + buildsPath: Builds versioning: None + - name: Move build + run: | + ls -la + mv Builds/Build/${{ matrix.buildTarget }} ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + - name: Upload build uses: actions/upload-artifact@v2 with: - name: Build-${{ matrix.buildTarget }} + name: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} path: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + - name: Download build + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + path: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + + - name: Zip build + run: | + zip -r ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }}.zip ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }}/* + upload: name: Upload runs-on: ubuntu-latest @@ -258,12 +273,15 @@ jobs: name: Build-${{ matrix.buildTarget }} path: Build + - name: Download build + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + path: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + - name: Zip build run: | - zip -r ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }}.zip Build/* - - - name: Upload URL - run: echo ${{ needs.release.outputs.uploadUrl }} + zip -r ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }}.zip ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }}/* - name: Upload build uses: actions/upload-release-asset@v1 @@ -272,7 +290,7 @@ jobs: with: upload_url: ${{ needs.release.outputs.uploadUrl }} asset_path: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }}.zip - asset_name: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + asset_name: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }}.zip asset_content_type: application/zip - name: Upload to itch.io From 2f0acce8262062eaea29dbc15e1e7cdf8b65e0d0 Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Thu, 24 Nov 2022 23:33:09 +0100 Subject: [PATCH 04/14] fix(ci): add debug logs --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f5d863..5fb61b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -236,6 +236,9 @@ jobs: - name: Move build run: | ls -la + ls -la Builds + ls -la Builds/Build + ls -la Builds/Build/${{ matrix.buildTarget }} mv Builds/Build/${{ matrix.buildTarget }} ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} - name: Upload build From d63b5aecd094e9da136e61f2fe06bf759b1feefe Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Thu, 24 Nov 2022 23:40:08 +0100 Subject: [PATCH 05/14] fix(ci): fix build path --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fb61b6..7e865a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -237,9 +237,8 @@ jobs: run: | ls -la ls -la Builds - ls -la Builds/Build - ls -la Builds/Build/${{ matrix.buildTarget }} - mv Builds/Build/${{ matrix.buildTarget }} ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + ls -la Builds/${{ matrix.buildTarget }} + mv Builds/${{ matrix.buildTarget }} ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} - name: Upload build uses: actions/upload-artifact@v2 From 8d368acfed7212bb2605790b4de0c9728754f072 Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Thu, 24 Nov 2022 23:56:12 +0100 Subject: [PATCH 06/14] fix(ci): add sudo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e865a5..3715beb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -238,7 +238,7 @@ jobs: ls -la ls -la Builds ls -la Builds/${{ matrix.buildTarget }} - mv Builds/${{ matrix.buildTarget }} ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + sudo mv Builds/${{ matrix.buildTarget }} ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} - name: Upload build uses: actions/upload-artifact@v2 From 2558e78f6bbc938ca056321227d53143de47bb2f Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Fri, 25 Nov 2022 01:31:23 +0100 Subject: [PATCH 07/14] fix(ci): remove obsolete download --- .github/workflows/ci.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3715beb..e0e90ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -246,16 +246,6 @@ jobs: name: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} path: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} - - name: Download build - uses: actions/download-artifact@v2 - with: - name: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} - path: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} - - - name: Zip build - run: | - zip -r ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }}.zip ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }}/* - upload: name: Upload runs-on: ubuntu-latest From 83b9e1059d51b0a2f507399314b1ba79378f04ff Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Fri, 25 Nov 2022 03:27:34 +0100 Subject: [PATCH 08/14] fix(ci): add dry run release --- .github/workflows/ci.yml | 69 +++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0e90ad..9093eaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,44 +154,34 @@ jobs: dotnet build ${{ env.PROJECT_DIR }}/${{ env.PROJECT_NAME }}.sln ./dotnet-sonarscanner end /d:sonar.login=${{ secrets.SONAR_TOKEN }} - release: - name: Release + version: + name: Version runs-on: ubuntu-latest outputs: - releaseCreated: ${{ steps.release.outputs.new-release-published }} - uploadUrl: ${{ steps.getUploadUrl.outputs.uploadUrl }} - version: ${{ steps.release.outputs.release-version }} + version: ${{ steps.version.outputs.release-version }} + releaseCreated: ${{ steps.version.outputs.releaseCreated }} steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Create release + - name: Calculate version uses: docker://ghcr.io/codfish/semantic-release-action:latest - id: release + id: version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_format: 'v${version}' branches: | [ 'master' ] - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Get upload URL - if: ${{ steps.release.outputs.new-release-published == 'true' }} - id: getUploadUrl - env: - VERSION: ${{ steps.release.outputs.release-version }} - run: | - echo "getting upload url for release $VERSION with tag v$VERSION" - uploadUrl=$(curl -sL https://api.github.com/repos/${{ github.repository }}/releases/tags/v$VERSION | jq -r '.upload_url') - echo uploadUrl=$uploadUrl >> $GITHUB_OUTPUT + dry_run: true build: name: Build runs-on: ubuntu-latest - needs: release - if: ${{ needs.release.outputs.releaseCreated == 'true' }} + needs: version + if: ${{ needs.version.outputs.releaseCreated == 'true' }} strategy: matrix: buildTarget: ["StandaloneWindows64", "StandaloneOSX", "StandaloneLinux64", "WebGL"] @@ -231,7 +221,8 @@ jobs: projectPath: ${{ env.PROJECT_DIR }} buildName: ${{ env.PROJECT_NAME }} buildsPath: Builds - versioning: None + versioning: Custom + version: ${{ needs.version.outputs.version }} - name: Move build run: | @@ -246,6 +237,40 @@ jobs: name: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} path: ${{ env.PROJECT_NAME }}-${{ matrix.buildTarget }} + release: + name: Release + runs-on: ubuntu-latest + needs: build + outputs: + releaseCreated: ${{ steps.release.outputs.new-release-published }} + uploadUrl: ${{ steps.getUploadUrl.outputs.uploadUrl }} + version: ${{ steps.release.outputs.release-version }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Create release + uses: docker://ghcr.io/codfish/semantic-release-action:latest + id: release + with: + tag_format: 'v${version}' + branches: | + [ + 'master' + ] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get upload URL + if: ${{ steps.release.outputs.new-release-published == 'true' }} + id: getUploadUrl + env: + VERSION: ${{ steps.release.outputs.release-version }} + run: | + echo "getting upload url for release $VERSION with tag v$VERSION" + uploadUrl=$(curl -sL https://api.github.com/repos/${{ github.repository }}/releases/tags/v$VERSION | jq -r '.upload_url') + echo uploadUrl=$uploadUrl >> $GITHUB_OUTPUT + upload: name: Upload runs-on: ubuntu-latest From 5388a5f8c634f26b2d1554fa42e362aeb6999f0f Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Fri, 25 Nov 2022 03:30:00 +0100 Subject: [PATCH 09/14] fix(ci): add debug logs --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9093eaa..ea23cfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -176,6 +176,11 @@ jobs: 'master' ] dry_run: true + + - name: Log outputs + run: | + echo "version: ${{ steps.version.outputs.release-version }}" + echo "releaseCreated: ${{ steps.version.outputs.releaseCreated }}" build: name: Build From b64ff9a8d9c492aabab3d6ec9325183838bf0682 Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Fri, 25 Nov 2022 03:32:28 +0100 Subject: [PATCH 10/14] fix(ci): fix output variable --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea23cfa..b6ed0d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,7 +159,7 @@ jobs: runs-on: ubuntu-latest outputs: version: ${{ steps.version.outputs.release-version }} - releaseCreated: ${{ steps.version.outputs.releaseCreated }} + releaseCreated: ${{ steps.version.outputs.new-release-published }} steps: - name: Checkout repository uses: actions/checkout@v3 @@ -180,7 +180,7 @@ jobs: - name: Log outputs run: | echo "version: ${{ steps.version.outputs.release-version }}" - echo "releaseCreated: ${{ steps.version.outputs.releaseCreated }}" + echo "releaseCreated: ${{ steps.version.outputs.new-release-published }}" build: name: Build From cddf7e0fa517fb87b505fd9f281535af0fde4b27 Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Fri, 25 Nov 2022 04:39:18 +0100 Subject: [PATCH 11/14] fix(ci): remove obsolete step --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6ed0d0..f86bc51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -289,12 +289,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Download build - uses: actions/download-artifact@v2 - with: - name: Build-${{ matrix.buildTarget }} - path: Build - - name: Download build uses: actions/download-artifact@v2 with: From c3a893b50932a1be94f1a7f930c14ec3760da7e5 Mon Sep 17 00:00:00 2001 From: Lennard Beers Date: Fri, 25 Nov 2022 05:22:47 +0100 Subject: [PATCH 12/14] fix: add webgl references --- TanksOnAPlain/ProjectSettings/ProjectSettings.asset | 1 + 1 file changed, 1 insertion(+) diff --git a/TanksOnAPlain/ProjectSettings/ProjectSettings.asset b/TanksOnAPlain/ProjectSettings/ProjectSettings.asset index 054c539..778ed61 100644 --- a/TanksOnAPlain/ProjectSettings/ProjectSettings.asset +++ b/TanksOnAPlain/ProjectSettings/ProjectSettings.asset @@ -540,6 +540,7 @@ PlayerSettings: webGLDecompressionFallback: 1 scriptingDefineSymbols: Standalone: ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_VALIDATOR;ODIN_VALIDATOR_3_1 + WebGL: ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_VALIDATOR;ODIN_VALIDATOR_3_1 additionalCompilerArguments: {} platformArchitecture: {} scriptingBackend: {} From 9eabfda20095662645f0fc7811dd849de74522aa Mon Sep 17 00:00:00 2001 From: Ben Korinth Date: Mon, 28 Nov 2022 17:09:08 +0100 Subject: [PATCH 13/14] perf(ui): use single canvas for floating text --- .../Prefabs/Graphics/floating_text.prefab | 163 ++++++++ ....prefab.meta => floating_text.prefab.meta} | 0 .../Graphics/floating_text_canvas.prefab | 383 ------------------ TanksOnAPlain/Assets/Prefabs/game.prefab | 246 ++++++++++- .../Components/Pooling/Pool.cs | 2 +- .../Components/Pooling/PoolComponent.cs | 22 +- 6 files changed, 413 insertions(+), 403 deletions(-) create mode 100644 TanksOnAPlain/Assets/Prefabs/Graphics/floating_text.prefab rename TanksOnAPlain/Assets/Prefabs/Graphics/{floating_text_canvas.prefab.meta => floating_text.prefab.meta} (100%) delete mode 100644 TanksOnAPlain/Assets/Prefabs/Graphics/floating_text_canvas.prefab diff --git a/TanksOnAPlain/Assets/Prefabs/Graphics/floating_text.prefab b/TanksOnAPlain/Assets/Prefabs/Graphics/floating_text.prefab new file mode 100644 index 0000000..34dba14 --- /dev/null +++ b/TanksOnAPlain/Assets/Prefabs/Graphics/floating_text.prefab @@ -0,0 +1,163 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5736488315374214953 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3395130341528113002} + - component: {fileID: 1326310669791843346} + - component: {fileID: 1261725686654313034} + - component: {fileID: 5619235454581232626} + m_Layer: 0 + m_Name: floating_text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3395130341528113002 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5736488315374214953} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 10, y: 1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1326310669791843346 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5736488315374214953} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5155f415675e4186b565aed87d7da4ba, type: 3} + m_Name: + m_EditorClassIdentifier: + serializationData: + SerializedFormat: 2 + SerializedBytes: + ReferencedUnityObjects: + - {fileID: 11400000, guid: 47f2705f8dbb77b429dffbb05c548e8c, type: 2} + SerializedBytesString: + Prefab: {fileID: 0} + PrefabModificationsReferencedUnityObjects: [] + PrefabModifications: [] + SerializationNodes: + - Name: FloatingTextAsset + Entry: 10 + Data: 0 +--- !u!222 &1261725686654313034 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5736488315374214953} + m_CullTransparentMesh: 1 +--- !u!114 &5619235454581232626 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5736488315374214953} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Debug + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 7151dbbc94d5a04498ceab0f167632af, type: 2} + m_sharedMaterial: {fileID: 6544489407505262915, guid: 7151dbbc94d5a04498ceab0f167632af, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 0.5 + m_fontSizeBase: 0.5 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 4096 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} diff --git a/TanksOnAPlain/Assets/Prefabs/Graphics/floating_text_canvas.prefab.meta b/TanksOnAPlain/Assets/Prefabs/Graphics/floating_text.prefab.meta similarity index 100% rename from TanksOnAPlain/Assets/Prefabs/Graphics/floating_text_canvas.prefab.meta rename to TanksOnAPlain/Assets/Prefabs/Graphics/floating_text.prefab.meta diff --git a/TanksOnAPlain/Assets/Prefabs/Graphics/floating_text_canvas.prefab b/TanksOnAPlain/Assets/Prefabs/Graphics/floating_text_canvas.prefab deleted file mode 100644 index 9842bf0..0000000 --- a/TanksOnAPlain/Assets/Prefabs/Graphics/floating_text_canvas.prefab +++ /dev/null @@ -1,383 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &49470657612621708 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 4609601912354332969} - - component: {fileID: 558108317541319324} - - component: {fileID: 7737186601142265858} - m_Layer: 0 - m_Name: floating_text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &4609601912354332969 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 49470657612621708} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 3395130341528113002} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 10, y: 1} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &558108317541319324 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 49470657612621708} - m_CullTransparentMesh: 1 ---- !u!114 &7737186601142265858 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 49470657612621708} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: Debug - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 7151dbbc94d5a04498ceab0f167632af, type: 2} - m_sharedMaterial: {fileID: 6544489407505262915, guid: 7151dbbc94d5a04498ceab0f167632af, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 0.5 - m_fontSizeBase: 0.5 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 2 - m_VerticalAlignment: 4096 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 1 - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!1 &5736488315374214953 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3395130341528113002} - - component: {fileID: 1986511315318289288} - - component: {fileID: 1326310669791843346} - m_Layer: 0 - m_Name: floating_text_canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &3395130341528113002 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5736488315374214953} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 4609601912354332969} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!223 &1986511315318289288 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5736488315374214953} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 1 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 25 - m_SortingLayerID: 1904067099 - m_SortingOrder: 10 - m_TargetDisplay: 0 ---- !u!114 &1326310669791843346 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5736488315374214953} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5155f415675e4186b565aed87d7da4ba, type: 3} - m_Name: - m_EditorClassIdentifier: - serializationData: - SerializedFormat: 2 - SerializedBytes: - ReferencedUnityObjects: - - {fileID: 11400000, guid: 47f2705f8dbb77b429dffbb05c548e8c, type: 2} - SerializedBytesString: - Prefab: {fileID: 0} - PrefabModificationsReferencedUnityObjects: [] - PrefabModifications: [] - SerializationNodes: - - Name: FloatingTextAsset - Entry: 10 - Data: 0 - - Name: TextColorToColor - Entry: 7 - Data: 0|System.Collections.Generic.Dictionary`2[[WorkingTitle.Unity.Components.Graphics.TextColor, - WorkingTitle.Unity],[UnityEngine.Color, UnityEngine.CoreModule]], mscorlib - - Name: comparer - Entry: 7 - Data: 1|System.Collections.Generic.EnumEqualityComparer`1[[WorkingTitle.Unity.Components.Graphics.TextColor, - WorkingTitle.Unity]], mscorlib - - Name: - Entry: 12 - Data: 0 - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 12 - Data: 5 - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 3 - Data: 0 - - Name: $v - Entry: 7 - Data: UnityEngine.Color, UnityEngine.CoreModule - - Name: - Entry: 4 - Data: 1 - - Name: - Entry: 4 - Data: 1 - - Name: - Entry: 4 - Data: 1 - - Name: - Entry: 4 - Data: 1 - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 3 - Data: 1 - - Name: $v - Entry: 7 - Data: UnityEngine.Color, UnityEngine.CoreModule - - Name: - Entry: 4 - Data: 0.6313726 - - Name: - Entry: 4 - Data: 0.09803922 - - Name: - Entry: 4 - Data: 0.1254902 - - Name: - Entry: 4 - Data: 1 - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 3 - Data: 2 - - Name: $v - Entry: 7 - Data: UnityEngine.Color, UnityEngine.CoreModule - - Name: - Entry: 4 - Data: 0.3882353 - - Name: - Entry: 4 - Data: 0.08627451 - - Name: - Entry: 4 - Data: 0.286274523 - - Name: - Entry: 4 - Data: 1 - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 3 - Data: 3 - - Name: $v - Entry: 7 - Data: UnityEngine.Color, UnityEngine.CoreModule - - Name: - Entry: 4 - Data: 0.274509817 - - Name: - Entry: 4 - Data: 0.3254902 - - Name: - Entry: 4 - Data: 0.454901963 - - Name: - Entry: 4 - Data: 1 - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 7 - Data: - - Name: $k - Entry: 3 - Data: 4 - - Name: $v - Entry: 7 - Data: UnityEngine.Color, UnityEngine.CoreModule - - Name: - Entry: 4 - Data: 0.333333343 - - Name: - Entry: 4 - Data: 0.3882353 - - Name: - Entry: 4 - Data: 0.180392161 - - Name: - Entry: 4 - Data: 1 - - Name: - Entry: 8 - Data: - - Name: - Entry: 8 - Data: - - Name: - Entry: 13 - Data: - - Name: - Entry: 8 - Data: diff --git a/TanksOnAPlain/Assets/Prefabs/game.prefab b/TanksOnAPlain/Assets/Prefabs/game.prefab index 72301fc..ec860c1 100644 --- a/TanksOnAPlain/Assets/Prefabs/game.prefab +++ b/TanksOnAPlain/Assets/Prefabs/game.prefab @@ -1006,7 +1006,8 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 9112777871777812696} m_Father: {fileID: 4833224386585719560} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1026,15 +1027,196 @@ MonoBehaviour: SerializedFormat: 2 SerializedBytes: ReferencedUnityObjects: - - {fileID: 11400000, guid: 6fdc40c01f95d174da90c346f1638f87, type: 2} + - {fileID: 4472856794074153120, guid: 97753afdfd0e1954bb7a5ebf0d15c9e1, type: 3} + - {fileID: 4136862187117868514, guid: 186c16aee48d2934591f2da0206b70f7, type: 3} + - {fileID: 7005487724714998332, guid: 38825d59e19870c4d9c35b74eecdb038, type: 3} + - {fileID: 5135982904818416073, guid: 170963ac58467e94d869fdb6fc976169, type: 3} + - {fileID: 7005487724714998332, guid: 5609afde2dda8804784d3e2d9f7a9591, type: 3} + - {fileID: 6062020859922841093, guid: 116e5a31640d14e49b277652a1dc19b4, type: 3} + - {fileID: 429489426995876441, guid: 057356ae0c28aac4e8a15b8254fa0157, type: 3} + - {fileID: 5328066834422354929, guid: a3f1f51768881f44898dcb9c8acc9293, type: 3} + - {fileID: 5736488315374214953, guid: 67a0ecf837e736941ada33169a5c28f1, type: 3} + - {fileID: 7680558174641482651} SerializedBytesString: Prefab: {fileID: 0} PrefabModificationsReferencedUnityObjects: [] PrefabModifications: [] SerializationNodes: - - Name: PoolAsset + - Name: Pools + Entry: 7 + Data: 0|System.Collections.Generic.List`1[[TanksOnAPlain.Unity.Components.Pooling.Pool, + TanksOnAPlain.Unity]], mscorlib + - Name: + Entry: 12 + Data: 9 + - Name: + Entry: 7 + Data: 1|TanksOnAPlain.Unity.Components.Pooling.Pool, TanksOnAPlain.Unity + - Name: Prefab Entry: 10 Data: 0 + - Name: PoolObject + Entry: 6 + Data: + - Name: ActiveObjectLimit + Entry: 3 + Data: 10 + - Name: HasLimit + Entry: 5 + Data: true + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 2|TanksOnAPlain.Unity.Components.Pooling.Pool, TanksOnAPlain.Unity + - Name: Prefab + Entry: 10 + Data: 1 + - Name: PoolObject + Entry: 6 + Data: + - Name: ActiveObjectLimit + Entry: 3 + Data: 15 + - Name: HasLimit + Entry: 5 + Data: true + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 3|TanksOnAPlain.Unity.Components.Pooling.Pool, TanksOnAPlain.Unity + - Name: Prefab + Entry: 10 + Data: 2 + - Name: PoolObject + Entry: 6 + Data: + - Name: ActiveObjectLimit + Entry: 3 + Data: 5 + - Name: HasLimit + Entry: 5 + Data: true + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 4|TanksOnAPlain.Unity.Components.Pooling.Pool, TanksOnAPlain.Unity + - Name: Prefab + Entry: 10 + Data: 3 + - Name: PoolObject + Entry: 6 + Data: + - Name: ActiveObjectLimit + Entry: 3 + Data: 5 + - Name: HasLimit + Entry: 5 + Data: true + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 5|TanksOnAPlain.Unity.Components.Pooling.Pool, TanksOnAPlain.Unity + - Name: Prefab + Entry: 10 + Data: 4 + - Name: PoolObject + Entry: 6 + Data: + - Name: ActiveObjectLimit + Entry: 3 + Data: 10 + - Name: HasLimit + Entry: 5 + Data: true + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 6|TanksOnAPlain.Unity.Components.Pooling.Pool, TanksOnAPlain.Unity + - Name: Prefab + Entry: 10 + Data: 5 + - Name: PoolObject + Entry: 6 + Data: + - Name: ActiveObjectLimit + Entry: 3 + Data: 10 + - Name: HasLimit + Entry: 5 + Data: true + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 7|TanksOnAPlain.Unity.Components.Pooling.Pool, TanksOnAPlain.Unity + - Name: Prefab + Entry: 10 + Data: 6 + - Name: PoolObject + Entry: 6 + Data: + - Name: ActiveObjectLimit + Entry: 3 + Data: 10 + - Name: HasLimit + Entry: 5 + Data: true + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 8|TanksOnAPlain.Unity.Components.Pooling.Pool, TanksOnAPlain.Unity + - Name: Prefab + Entry: 10 + Data: 7 + - Name: PoolObject + Entry: 6 + Data: + - Name: ActiveObjectLimit + Entry: 3 + Data: 3 + - Name: HasLimit + Entry: 5 + Data: true + - Name: + Entry: 8 + Data: + - Name: + Entry: 7 + Data: 9|TanksOnAPlain.Unity.Components.Pooling.Pool, TanksOnAPlain.Unity + - Name: Prefab + Entry: 10 + Data: 8 + - Name: PoolObject + Entry: 10 + Data: 9 + - Name: ActiveObjectLimit + Entry: 3 + Data: 0 + - Name: HasLimit + Entry: 5 + Data: false + - Name: + Entry: 8 + Data: + - Name: + Entry: 13 + Data: + - Name: + Entry: 8 + Data: --- !u!1 &1050167120074286016 GameObject: m_ObjectHideFlags: 0 @@ -4692,6 +4874,64 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &7680558174641482651 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9112777871777812696} + - component: {fileID: 8021119412113329810} + m_Layer: 0 + m_Name: pool_floating_text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9112777871777812696 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7680558174641482651} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 87.69683} + m_LocalScale: {x: 0.013888889, y: 0.013888889, z: 0.013888889} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 639860841367389525} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 5.5132804, y: 13.6359825} + m_SizeDelta: {x: 2560, y: 1440} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &8021119412113329810 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7680558174641482651} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 3080588550860022914} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 1904067099 + m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &7729840131478795847 GameObject: m_ObjectHideFlags: 0 diff --git a/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/Pool.cs b/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/Pool.cs index d130efd..375fa3d 100644 --- a/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/Pool.cs +++ b/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/Pool.cs @@ -29,7 +29,7 @@ public class Pool [ShowInInspector] [ShowIf(nameof(IsPlaying))] [ReadOnly] - public Queue Objects { get; } = new(); + public Queue Objects { get; set; } = new(); bool IsPlaying => Application.isPlaying; } diff --git a/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/PoolComponent.cs b/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/PoolComponent.cs index 210104e..0d0b681 100644 --- a/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/PoolComponent.cs +++ b/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/PoolComponent.cs @@ -12,29 +12,18 @@ namespace TanksOnAPlain.Unity.Components.Pooling { public class PoolComponent : SerializedMonoBehaviour { - [OdinSerialize] - PoolAsset PoolAsset { get; set; } + // [OdinSerialize] + // PoolAsset PoolAsset { get; set; } - [ShowInInspector] - [ReadOnly] + [OdinSerialize] List Pools { get; set; } = new(); void Awake() { - foreach (var assetPool in PoolAsset.Pools) + foreach (var pool in Pools) { - var pool = new Pool - { - Prefab = assetPool.Prefab, - ActiveObjectLimit = assetPool.ActiveObjectLimit, - HasLimit = assetPool.HasLimit, - PoolObject = assetPool.PoolObject, - }; - - Pools.Add(pool); - if (pool.PoolObject) continue; - + CreatePoolObject(pool); } } @@ -65,6 +54,7 @@ public GameObject Allocate(GameObject prefab, Vector3? position = null, Quaterni GameObject GetOrCreateObject(Pool pool, Vector3 position, Quaternion rotation) { + pool.Objects ??= new(); var availableObjects = pool.Objects; if (availableObjects.Count > 0) From 21201a7f24fb91d1904d74754dc2aaf8f61cecda Mon Sep 17 00:00:00 2001 From: Ben Korinth Date: Mon, 28 Nov 2022 17:13:00 +0100 Subject: [PATCH 14/14] chore: remove zombie code --- .../Components/Difficulty/DifficultyComponent.cs | 15 --------------- .../Components/Pooling/PoolComponent.cs | 3 --- 2 files changed, 18 deletions(-) diff --git a/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Difficulty/DifficultyComponent.cs b/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Difficulty/DifficultyComponent.cs index 32259fa..5827f31 100644 --- a/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Difficulty/DifficultyComponent.cs +++ b/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Difficulty/DifficultyComponent.cs @@ -16,23 +16,9 @@ public class DifficultyComponent : SerializedMonoBehaviour void Update() { - //Difficulty *= 1 + DifficultyAsset.DifficultyScaling / 100 * Time.deltaTime; Difficulty += Time.deltaTime; } - // public float GetScaledValueAtan(float startValue, float endValue, float modifier) - // { - // return startValue + 2 * (endValue - startValue) / Mathf.PI * - // Mathf.Atan(modifier * Difficulty); - // } - // - // public int GetScaledValueAtan(int startValue, int endValue, float modifier) - // { - // Debug.Log($"{startValue} -> {endValue}\n=> {Mathf.RoundToInt(startValue + 2 * (endValue - startValue) / Mathf.PI * Mathf.Atan(modifier * Difficulty))}"); - // return Mathf.RoundToInt(startValue + 2 * (endValue - startValue) / Mathf.PI * - // Mathf.Atan(modifier * Difficulty)); - // } - public int GetScaledValueExp(int startValue, int endValue, int time) { var reverse = startValue > endValue; @@ -60,7 +46,6 @@ public float GetScaledValueExp(float startValue, float endValue, int time) var modifier = Mathf.Pow(time, 2) / (delta); var value = startValue + sign * Mathf.Pow(Difficulty, 2) / modifier; - //Debug.Log($"{time}^2 / {delta} = {modifier}\n{startValue} + {sign} * {Difficulty}^2 / {modifier} = {value}"); return Mathf.Clamp(value, reverse ? endValue : startValue, reverse ? startValue : endValue); diff --git a/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/PoolComponent.cs b/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/PoolComponent.cs index 0d0b681..f147569 100644 --- a/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/PoolComponent.cs +++ b/TanksOnAPlain/Assets/TanksOnAPlain.Unity/Components/Pooling/PoolComponent.cs @@ -12,9 +12,6 @@ namespace TanksOnAPlain.Unity.Components.Pooling { public class PoolComponent : SerializedMonoBehaviour { - // [OdinSerialize] - // PoolAsset PoolAsset { get; set; } - [OdinSerialize] List Pools { get; set; } = new();