Compare commits
153 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b84ccc2cbc | |||
| 775e978fed | |||
| e450658834 | |||
| a544cbcfde | |||
| 45f7c1f0a0 | |||
| 13aa6ce4a0 | |||
| c2b2d6973b | |||
| 96835b856d | |||
| caeecf2aea | |||
| db963f9191 | |||
| 4b6c22c43f | |||
| d3be79fdc4 | |||
| 8231bae16b | |||
| f55ac81fe4 | |||
| d181f8d726 | |||
| 2a37a529b9 | |||
| 7f370a7c5b | |||
| 0f38fca0b1 | |||
| 0b47e63ba3 | |||
| a0663666bb | |||
| 17ff4623e7 | |||
| 0a39d88221 | |||
| 92a0a40d16 | |||
| 8d8d69b847 | |||
| 5dac5d3f2d | |||
| 03126e1840 | |||
| 9e96206d67 | |||
| 3bf3264f48 | |||
| b043490413 | |||
| 48f302b4fd | |||
| d9c787a661 | |||
| ec9f05fe11 | |||
| b039e3779d | |||
| fc8a9b69d2 | |||
| b38f6c5721 | |||
| 0c1af2f243 | |||
| 7f2ba7a81e | |||
| fb21ffd3be | |||
| 7127ccda37 | |||
| ead71e6836 | |||
| 241441d5b9 | |||
| 14b0fb355a | |||
| 4489f43777 | |||
| c17a9f653e | |||
| e7fd901807 | |||
| bdabcd5e43 | |||
| 6cc8f693f3 | |||
| 1079791bed | |||
| 627f3a2dec | |||
| 2f05a0987e | |||
| 6335bcdc93 | |||
| 650fa781d3 | |||
| 000d786d49 | |||
| 3eb85000aa | |||
| 9c5daf419b | |||
| 9a85ae7142 | |||
| fad0f7a345 | |||
| aac399c6a1 | |||
| 4c5035e433 | |||
| b14c2cfc74 | |||
| cbcfa4013b | |||
| 429f8e5336 | |||
| 6cc0edf0eb | |||
| f7d8f36add | |||
| 2e98300693 | |||
| 83de99877c | |||
| 7a569d4f14 | |||
| 24675ace93 | |||
| 3a5d831e71 | |||
| 0aecb35ab1 | |||
| c4bb39aeac | |||
| 61431a6400 | |||
| d4da1d80d0 | |||
| 3bede1d6bc | |||
| ce4ad8aa71 | |||
| 75bd206416 | |||
| 578af12f2b | |||
| acbbd34ecf | |||
| c8b06ba7ec | |||
| ad46b74f6a | |||
| 47a9d76938 | |||
| 442cb8f2dd | |||
| 45e121bf77 | |||
| 8e76d0d9d8 | |||
| f4905cfccc | |||
| bf9a015959 | |||
| 4fd7f51fdf | |||
| f5e483069d | |||
| 0bd28ecb65 | |||
| 9eec54171c | |||
| 486781661e | |||
| b201897ae6 | |||
| c33ada2715 | |||
| dcb9b5150f | |||
| f905b4013b | |||
| b0033a35b7 | |||
| f47a2909fe | |||
| b1c76ec7f9 | |||
| db2130f340 | |||
| edb3badcb3 | |||
| c33b2cc11e | |||
| 135110387d | |||
| 6b3502675a | |||
| 615e847e01 | |||
| 468e05c6e8 | |||
| a46402df6b | |||
| 1fa9aadebd | |||
| c0f52235c6 | |||
| c782f07b76 | |||
| dc9a8a2f84 | |||
| 49943e13de | |||
| 1988fae929 | |||
| 804315bb3e | |||
| 0cacc58b53 | |||
| 7437b69d52 | |||
| f5f4fb29f2 | |||
| 33617a702a | |||
| 84b53bb9c8 | |||
| c3ea883b21 | |||
| f41d01f4a9 | |||
| 141a8de0da | |||
| 63b6fafa1b | |||
| 2ce1103530 | |||
| 6121a6fadf | |||
| 145134f145 | |||
| 3f78e47918 | |||
| 7b4a9f1a63 | |||
| 561d40fd71 | |||
| 133340b2ea | |||
| 344665e34f | |||
| 5d188c8c2d | |||
| 9447f3d569 | |||
| df8dc9173a | |||
| b186d19faa | |||
| ea749f12a3 | |||
| 74750fd604 | |||
| b52e8bad4c | |||
| 44f8e86245 | |||
| b036692154 | |||
| 5d050ca020 | |||
| 1b6a31b6e5 | |||
| ab4743fdb1 | |||
| 49629222c1 | |||
| 9d6778ff1e | |||
| ce73394531 | |||
| 463c8dba0d | |||
| 9bb6104cf7 | |||
| 151f4a4923 | |||
| 36f588a792 | |||
| 07c7a250cc | |||
| eab4a8c404 | |||
| cde3e3d710 | |||
| a8dc67a1b2 |
@@ -3,7 +3,7 @@ description: Downloads and installs Vulkan SDK.
|
||||
inputs:
|
||||
vulkan-version:
|
||||
description: 'Vulkan SDK release version (e.g. 1.2.198.1).'
|
||||
default: '1.3.290.0'
|
||||
default: '1.4.350.0'
|
||||
required: false
|
||||
runs:
|
||||
using: "composite"
|
||||
@@ -24,13 +24,13 @@ runs:
|
||||
;;
|
||||
Darwin)
|
||||
export VULKAN_SDK_ROOT=`pwd`/../VulkanSDK
|
||||
curl -LO "https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/mac/vulkan-sdk.dmg"
|
||||
hdiutil attach vulkan-sdk.dmg -mountpoint /Volumes/vulkan-sdk
|
||||
sudo "/Volumes/vulkan-sdk/InstallVulkan.app/Contents/MacOS/InstallVulkan" --root $VULKAN_SDK_ROOT --accept-licenses --default-answer --confirm-command install
|
||||
curl -LO "https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/mac/vulkansdk-macos-$VULKAN_SDK_VER.zip"
|
||||
unzip vulkansdk-macos-$VULKAN_SDK_VER.zip
|
||||
sudo "vulkansdk-macos-$VULKAN_SDK_VER.app/Contents/MacOS/vulkansdk-macOS-$VULKAN_SDK_VER" --root $VULKAN_SDK_ROOT --accept-licenses --default-answer --confirm-command install
|
||||
export VULKAN_SDK=$VULKAN_SDK_ROOT/macOS
|
||||
;;
|
||||
*) # Windows
|
||||
curl -L -o vulkan-sdk.exe https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/windows/VulkanSDK-$VULKAN_SDK_VER-Installer.exe
|
||||
curl -L -o vulkan-sdk.exe https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VER/windows/vulkansdk-windows-X64-$VULKAN_SDK_VER.exe
|
||||
./vulkan-sdk.exe --root "C:\VulkanSDK" --accept-licenses --default-answer --confirm-command install
|
||||
export VULKAN_SDK="C:\VulkanSDK"
|
||||
;;
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.419
|
||||
dotnet-version: 10.0.x
|
||||
- name: Setup .NET Workload
|
||||
run: |
|
||||
dotnet workload install android
|
||||
@@ -37,4 +37,4 @@ jobs:
|
||||
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
|
||||
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=8 -arch=ARM64 -platform=Android -configuration=Release -buildtargets=FlaxGame
|
||||
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=10 -arch=ARM64 -platform=Android -configuration=Release -buildtargets=FlaxGame
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Setup .NET Workload
|
||||
run: |
|
||||
dotnet workload install ios
|
||||
@@ -33,4 +33,4 @@ jobs:
|
||||
git lfs pull
|
||||
- name: Build
|
||||
run: |
|
||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -dotnet=9 -arch=ARM64 -platform=iOS -configuration=Release -buildtargets=FlaxGame
|
||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -dotnet=10 -arch=ARM64 -platform=iOS -configuration=Release -buildtargets=FlaxGame
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
git lfs pull
|
||||
- name: Build
|
||||
run: |
|
||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxEditor
|
||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -printSDKs -dotnet=10 -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxEditor
|
||||
|
||||
# Game
|
||||
game-linux:
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
@@ -63,4 +63,4 @@ jobs:
|
||||
git lfs pull
|
||||
- name: Build
|
||||
run: |
|
||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=x64 -platform=Linux -configuration=Release -buildtargets=FlaxGame
|
||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -printSDKs -dotnet=10 -arch=x64 -platform=Linux -configuration=Release -buildtargets=FlaxGame
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
git lfs pull
|
||||
- name: Build
|
||||
run: |
|
||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=ARM64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
|
||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=10 -arch=ARM64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
|
||||
|
||||
# Game
|
||||
game-mac:
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
@@ -55,4 +55,4 @@ jobs:
|
||||
git lfs pull
|
||||
- name: Build
|
||||
run: |
|
||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=ARM64 -platform=Mac -configuration=Release -buildtargets=FlaxGame
|
||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=10 -arch=ARM64 -platform=Mac -configuration=Release -buildtargets=FlaxGame
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.419
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
|
||||
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=8 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxEditor
|
||||
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=10 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxEditor
|
||||
|
||||
# Game
|
||||
game-windows:
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.419
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
@@ -62,4 +62,4 @@ jobs:
|
||||
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
|
||||
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=8 -arch=x64 -platform=Windows -configuration=Release -buildtargets=FlaxGame
|
||||
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=10 -arch=x64 -platform=Windows -configuration=Release -buildtargets=FlaxGame
|
||||
|
||||
+12
-12
@@ -28,7 +28,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.419
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
|
||||
.\PackageEditor.bat -arch=x64 -platform=Windows -deployOutput=Output -dotnet=8
|
||||
.\PackageEditor.bat -arch=x64 -platform=Windows -deployOutput=Output -dotnet=10
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.419
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
|
||||
.\PackagePlatforms.bat -arch=x64 -platform=Windows -deployOutput=Output -dotnet=8
|
||||
.\PackagePlatforms.bat -arch=x64 -platform=Windows -deployOutput=Output -dotnet=10
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
@@ -101,14 +101,14 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
dotnet workload --info
|
||||
- name: Build
|
||||
run: |
|
||||
./PackageEditor.sh -arch=x64 -platform=Linux -deployOutput=Output -dotnet=8
|
||||
./PackageEditor.sh -arch=x64 -platform=Linux -deployOutput=Output -dotnet=10
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
@@ -133,14 +133,14 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
dotnet workload --info
|
||||
- name: Build
|
||||
run: |
|
||||
./PackagePlatforms.sh -arch=x64 -platform=Linux -deployOutput=Output -dotnet=8
|
||||
./PackagePlatforms.sh -arch=x64 -platform=Linux -deployOutput=Output -dotnet=10
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
@@ -163,14 +163,14 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
dotnet workload --info
|
||||
- name: Build
|
||||
run: |
|
||||
./PackageEditor.command -arch=ARM64 -platform=Mac -deployOutput=Output -dotnet=8
|
||||
./PackageEditor.command -arch=ARM64 -platform=Mac -deployOutput=Output -dotnet=10
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
@@ -191,14 +191,14 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
dotnet workload --info
|
||||
- name: Build
|
||||
run: |
|
||||
./PackagePlatforms.command -arch=ARM64 -platform=Mac -deployOutput=Output -dotnet=8
|
||||
./PackagePlatforms.command -arch=ARM64 -platform=Mac -deployOutput=Output -dotnet=10
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Setup .NET Workload
|
||||
run: |
|
||||
dotnet workload install ios
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
cp ".github/data/Build Settings.json" "FlaxSamples/MaterialsFeaturesTour/Content/Settings"
|
||||
- name: Build Editor
|
||||
run: |
|
||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=ARM64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
|
||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=10 -arch=ARM64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor
|
||||
- name: Cook Game (iOS)
|
||||
run: |
|
||||
./Binaries/Editor/Mac/Development/FlaxEditor -std -headless -mute -null -project "FlaxSamples/MaterialsFeaturesTour" -build "Development.iOS"
|
||||
|
||||
+10
-10
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
@@ -34,18 +34,18 @@ jobs:
|
||||
chmod +x .github/data/bt.sh
|
||||
- name: Build
|
||||
run: |
|
||||
./GenerateProjectFiles.sh -vs2022 -log -verbose -printSDKs -dotnet=8
|
||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -dotnet=8 -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxTestsTarget -UseLargeWorlds=true
|
||||
./GenerateProjectFiles.sh -vs2026 -log -verbose -printSDKs -dotnet=10
|
||||
./Development/Scripts/Linux/CallBuildTool.sh -build -log -dotnet=10 -arch=x64 -platform=Linux -configuration=Development -buildtargets=FlaxTestsTarget -UseLargeWorlds=true
|
||||
dotnet msbuild Source/Tools/Flax.Build.Tests/Flax.Build.Tests.csproj /m /t:Restore,Build /p:Configuration=Debug /p:Platform=AnyCPU /nologo
|
||||
dotnet msbuild Source/Tools/Flax.Build.Tests/Flax.Build.Tests.csproj /m /t:Restore,Build /p:Configuration=Debug /p:Platform=AnyCPU /nologo
|
||||
- name: Test
|
||||
run: |
|
||||
${GITHUB_WORKSPACE}/.github/data/bt.sh ./Binaries/Editor/Linux/Development/FlaxTests -headless
|
||||
dotnet test -f net8.0 Binaries/Tests/Flax.Build.Tests.dll
|
||||
dotnet test -f net10.0 Binaries/Tests/Flax.Build.Tests.dll
|
||||
cp Binaries/Editor/Linux/Development/FlaxEngine.CSharp.dll Binaries/Tests
|
||||
cp Binaries/Editor/Linux/Development/FlaxEngine.CSharp.runtimeconfig.json Binaries/Tests
|
||||
cp Binaries/Editor/Linux/Development/Newtonsoft.Json.dll Binaries/Tests
|
||||
dotnet test -f net8.0 Binaries/Tests/FlaxEngine.CSharp.dll
|
||||
dotnet test -f net10.0 Binaries/Tests/FlaxEngine.CSharp.dll
|
||||
|
||||
# Tests on Windows
|
||||
tests-windows:
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 8.0.419
|
||||
dotnet-version: 10.0.x
|
||||
- name: Print .NET info
|
||||
run: |
|
||||
dotnet --info
|
||||
@@ -71,8 +71,8 @@ jobs:
|
||||
PowerShell "(Get-Content global.json).Replace('latestMajor', 'minor') | Set-Content global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/global.json).Replace('latestMajor', 'minor') | Set-Content Source/Tools/Flax.Build/global.json"
|
||||
PowerShell "(Get-Content Source/Tools/Flax.Build/Flax.Build.csproj).Replace('LatestMajor', 'Minor') | Set-Content Source/Tools/Flax.Build/Flax.Build.csproj"
|
||||
.\GenerateProjectFiles.bat -vs2022 -log -verbose -printSDKs -dotnet=8
|
||||
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -dotnet=8 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxTestsTarget
|
||||
.\GenerateProjectFiles.bat -vs2026 -log -verbose -printSDKs -dotnet=10
|
||||
.\Development\Scripts\Windows\CallBuildTool.bat -build -log -dotnet=10 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxTestsTarget
|
||||
dotnet msbuild Source\Tools\Flax.Build.Tests\Flax.Build.Tests.csproj /m /t:Restore,Build /p:Configuration=Debug /p:Platform=AnyCPU /nologo
|
||||
- name: Test
|
||||
shell: pwsh
|
||||
@@ -80,8 +80,8 @@ jobs:
|
||||
$ErrorActionPreference = "Stop"
|
||||
.\Binaries\Editor\Win64\Development\FlaxTests.exe -headless
|
||||
if(!$?) { Write-Host "Tests failed with exit code $LastExitCode" -ForegroundColor Red; Exit $LastExitCode }
|
||||
dotnet test -f net8.0 Binaries\Tests\Flax.Build.Tests.dll
|
||||
dotnet test -f net10.0 Binaries\Tests\Flax.Build.Tests.dll
|
||||
xcopy /y Binaries\Editor\Win64\Development\FlaxEngine.CSharp.dll Binaries\Tests
|
||||
xcopy /y Binaries\Editor\Win64\Development\FlaxEngine.CSharp.runtimeconfig.json Binaries\Tests
|
||||
xcopy /y Binaries\Editor\Win64\Development\Newtonsoft.Json.dll Binaries\Tests
|
||||
dotnet test -f net8.0 Binaries\Tests\FlaxEngine.CSharp.dll
|
||||
dotnet test -f net10.0 Binaries\Tests\FlaxEngine.CSharp.dll
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
@@ -1,17 +0,0 @@
|
||||
## Mono
|
||||
|
||||
Custom fork: [https://github.com/FlaxEngine/mono](https://github.com/FlaxEngine/mono) with custom features for C# assemblies hot-reloading at runtime without domain unload (more: [https://flaxengine.com/blog/flax-facts-16-scripts-hot-reload/](https://flaxengine.com/blog/flax-facts-16-scripts-hot-reload/)).
|
||||
|
||||
Startup docs about building mono: [https://www.mono-project.com/docs/compiling-mono/](https://www.mono-project.com/docs/compiling-mono/)
|
||||
|
||||
### Notes
|
||||
|
||||
Some useful notes and tips for devs:
|
||||
* Use `-monolog` to print Mono logs to Flax logs
|
||||
* When working with mono fork set `localRepoPath` to local repo location in `Source\Tools\Flax.Build\Deps\Dependencies\mono.cs`
|
||||
* To update mono deps when developing/updating use `.\Development\Scripts\Windows\CallBuildTool.bat -log -ReBuildDeps -verbose -depsToBuild=mono -platform=Windows`, then build engine and run it
|
||||
* `MONO_GC_DEBUG=check-remset-consistency` - it will do additional checks at each collection to see if there are any missing write barriers
|
||||
* `MONO_GC_DEBUG=nursery-canaries` - it might catch some buffer overflows in case of problems in code.
|
||||
* `MONO_GC_DEBUG=<log-level>:<log-file>` - will print GC debug to the log file (eg. `4:sgen-gc`).
|
||||
* Methods `mono_custom_attrs_from_property` and `mono_custom_attrs_get_attr` are internally cached
|
||||
* If C++ mono call a method in c# that will throw an error, error will be handled but, not completly. Calling relase domain will return random `Access memory violation`. First search for error in c# code. No workaround yet.
|
||||
@@ -34,7 +34,7 @@ goto Exit
|
||||
echo CallBuildTool ERROR: The script is in invalid directory.
|
||||
goto Exit
|
||||
:Error_NoVisualStudioEnvironment
|
||||
echo CallBuildTool ERROR: Missing Visual Studio 2022 or newer.
|
||||
echo CallBuildTool ERROR: Missing Visual Studio 2026 or newer.
|
||||
goto Exit
|
||||
:Error_CompilationFailed
|
||||
echo CallBuildTool ERROR: Failed to compile Flax.Build project.
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
"Name": "Flax",
|
||||
"Version": {
|
||||
"Major": 1,
|
||||
"Minor": 12,
|
||||
"Minor": 13,
|
||||
"Revision": 0,
|
||||
"Build": 6914
|
||||
"Build": 7005
|
||||
},
|
||||
"Company": "Flax",
|
||||
"Copyright": "Copyright (c) 2012-2026 Wojciech Figat. All rights reserved.",
|
||||
@@ -13,7 +13,7 @@
|
||||
"Configuration": {
|
||||
"UseCSharp": true,
|
||||
"UseLargeWorlds": false,
|
||||
"UseDotNet": true,
|
||||
"UseReverseZ": true,
|
||||
"Windows": {
|
||||
"UseSDL": false,
|
||||
},
|
||||
|
||||
@@ -257,6 +257,7 @@
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/GrammarAndSpelling/GrammarChecking/Exceptions/=Try_0020to_0020scripting/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/GrammarAndSpelling/GrammarChecking/Exceptions/=will_0020fallback/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/GrammarAndSpelling/GrammarChecking/RulesStates/=LanguageTool_002EEN_002EE_005FG/@EntryIndexedValue">DisabledByUser</s:String>
|
||||
<s:Boolean x:Key="/Default/PatternsAndTemplates/Todo/TodoPatterns/=EEA05B0ED8200E4BA9D2D3F1052EBFFD/@KeyIndexDefined">True</s:Boolean>
|
||||
<s:String x:Key="/Default/PatternsAndTemplates/Todo/TodoPatterns/=EEA05B0ED8200E4BA9D2D3F1052EBFFD/Color/@EntryValue">Blue</s:String>
|
||||
|
||||
@@ -28,10 +28,10 @@ Follow the instructions below to compile and run the engine from source.
|
||||
|
||||
## Windows
|
||||
|
||||
* Install Visual Studio 2022 or newer
|
||||
* Install Windows 8.1 SDK or newer (via Visual Studio Installer)
|
||||
* Install Visual Studio 2026 or newer
|
||||
* Install Windows 10 SDK or newer (via Visual Studio Installer)
|
||||
* Install Microsoft Visual C++ 2015 v140 toolset or newer (via Visual Studio Installer)
|
||||
* Install .NET 8 SDK (or newer) for **Windows x64** (via Visual Studio Installer or [from web](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
|
||||
* Install .NET 10 SDK (or newer) for **Windows x64** (via Visual Studio Installer or [from web](https://dotnet.microsoft.com/en-us/download/dotnet/10.0))
|
||||
* Install Git with LFS
|
||||
* Clone repo (with LFS)
|
||||
* Run **GenerateProjectFiles.bat**
|
||||
@@ -44,10 +44,10 @@ Follow the instructions below to compile and run the engine from source.
|
||||
## Linux
|
||||
|
||||
* Install Visual Studio Code
|
||||
* Install .NET 8 or 9 SDK ([https://dotnet.microsoft.com/en-us/download/dotnet/8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
|
||||
* Ubuntu: `sudo apt install dotnet-sdk-8.0`
|
||||
* Fedora: `sudo dnf install dotnet-sdk-8.0`
|
||||
* Arch: `sudo pacman -S dotnet-sdk-8.0 dotnet-runtime-8.0 dotnet-targeting-pack-8.0 dotnet-host`
|
||||
* Install .NET 10 SDK (or newer) ([https://dotnet.microsoft.com/en-us/download/dotnet/10.0](https://dotnet.microsoft.com/en-us/download/dotnet/10.0))
|
||||
* Ubuntu: `sudo apt install dotnet-sdk-10.0`
|
||||
* Fedora: `sudo dnf install dotnet-sdk-10.0`
|
||||
* Arch: `sudo pacman -S dotnet-sdk-10.0 dotnet-runtime-10.0 dotnet-targeting-pack-10.0 dotnet-host`
|
||||
* Install Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
|
||||
* Ubuntu: `sudo apt install vulkan-sdk` (deprecated, follow official docs)
|
||||
* Fedora: `sudo dnf install vulkan-headers vulkan-tools vulkan-validation-layers`
|
||||
@@ -73,7 +73,7 @@ Follow the instructions below to compile and run the engine from source.
|
||||
## Mac
|
||||
|
||||
* Install XCode 16.4 (or newer)
|
||||
* Install .NET 8 SDK (or newer) ([https://dotnet.microsoft.com/en-us/download/dotnet/8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
|
||||
* Install .NET 10 SDK (or newer) ([https://dotnet.microsoft.com/en-us/download/dotnet/10.0](https://dotnet.microsoft.com/en-us/download/dotnet/10.0))
|
||||
* Install Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
|
||||
* Clone repo (with LFS)
|
||||
* Run `GenerateProjectFiles.command`
|
||||
@@ -86,17 +86,17 @@ Follow the instructions below to compile and run the engine from source.
|
||||
|
||||
Restart PC - ensure DotNet is added to PATH for command line tools execution.
|
||||
|
||||
* `Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 8.0`
|
||||
* `Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 10.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 10.0`
|
||||
|
||||
Use Visual Studio 2022, older versions are not supported by .NET SDK 8.
|
||||
Use Visual Studio 2026 (or newer), old Visual Studio versions are not supported by .NET SDK 10.
|
||||
|
||||
* `Building for Windows without Vulkan rendering backend (Vulkan SDK is missing)`
|
||||
|
||||
Install the Vulkan SDK then set an environment variable to provide the path to the SDK prior to running GenerateProjectFiles.bat: `set VULKAN_SDK=%sdk_path%`.
|
||||
|
||||
* `The NuGetSdkResolver did not resolve this SDK`
|
||||
* `The NuGetSdkResolver did not resolve this SDK` / `Could not resolve SDK "Microsoft.NET.Sdk"`
|
||||
|
||||
Install `.NET SDK`, `NuGet package manager` and `NuGet targets and build tasks` in Visual Studio components.
|
||||
Install `.NET SDK` 10, `NuGet package manager` and `NuGet targets and build tasks` in Visual Studio components.
|
||||
|
||||
## Workspace directory
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace FlaxEditor.Content
|
||||
}
|
||||
else
|
||||
{
|
||||
_parameters = Utils.GetEmptyArray<ScriptMemberInfo.Parameter>();
|
||||
_parameters = Array.Empty<ScriptMemberInfo.Parameter>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,9 +283,9 @@ namespace FlaxEditor.Content
|
||||
{
|
||||
if (!_asset)
|
||||
{
|
||||
_parameters = Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
_methods = Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
_attributes = Utils.GetEmptyArray<Attribute>();
|
||||
_parameters = Array.Empty<ScriptMemberInfo>();
|
||||
_methods = Array.Empty<ScriptMemberInfo>();
|
||||
_attributes = Array.Empty<Attribute>();
|
||||
return;
|
||||
}
|
||||
if (_parameters != null)
|
||||
@@ -303,7 +303,7 @@ namespace FlaxEditor.Content
|
||||
_parameters[i] = new ScriptMemberInfo(new VisualScriptParameterInfo(this, parameters[i]));
|
||||
}
|
||||
else
|
||||
_parameters = Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
_parameters = Array.Empty<ScriptMemberInfo>();
|
||||
|
||||
// Cache Visual Script methods info
|
||||
var methodsCount = _asset.GetMethodsCount();
|
||||
@@ -314,7 +314,7 @@ namespace FlaxEditor.Content
|
||||
_methods[i] = new ScriptMemberInfo(new VisualScriptMethodInfo(this, i));
|
||||
}
|
||||
else
|
||||
_methods = Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
_methods = Array.Empty<ScriptMemberInfo>();
|
||||
|
||||
// Cache Visual Script attributes
|
||||
{
|
||||
@@ -525,7 +525,7 @@ namespace FlaxEditor.Content
|
||||
var baseType = BaseType;
|
||||
if (baseType)
|
||||
return baseType.GetProperties(bindingAttr);
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -360,6 +360,11 @@ public:
|
||||
/// </summary>
|
||||
Array<BinaryModuleInfo, InlinedAllocation<64>> BinaryModules;
|
||||
|
||||
/// <summary>
|
||||
/// Cached version of the built binaries from project Version Control.
|
||||
/// </summary>
|
||||
String VersionControlInfo;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -42,6 +42,13 @@ bool CompileScriptsStep::DeployBinaries(CookingData& data, const String& path, c
|
||||
return true;
|
||||
}
|
||||
|
||||
// Metadata
|
||||
auto versionControlInfoMember = document.FindMember("VersionControlInfo");
|
||||
if (versionControlInfoMember != document.MemberEnd() && data.VersionControlInfo.IsEmpty())
|
||||
{
|
||||
data.VersionControlInfo = versionControlInfoMember->value.GetText();
|
||||
}
|
||||
|
||||
// Deploy all references
|
||||
auto referencesMember = document.FindMember("References");
|
||||
if (referencesMember != document.MemberEnd())
|
||||
@@ -245,8 +252,15 @@ bool CompileScriptsStep::Perform(CookingData& data)
|
||||
writer.String(target);
|
||||
writer.JKEY("Platform");
|
||||
writer.String(platform);
|
||||
writer.JKEY("Architecture");
|
||||
writer.String(architecture);
|
||||
writer.JKEY("Configuration");
|
||||
writer.String(configuration);
|
||||
if (data.VersionControlInfo.HasChars())
|
||||
{
|
||||
writer.JKEY("VersionControlInfo");
|
||||
writer.String(data.VersionControlInfo);
|
||||
}
|
||||
|
||||
writer.JKEY("BinaryModules");
|
||||
writer.StartArray();
|
||||
|
||||
@@ -50,6 +50,10 @@
|
||||
#endif
|
||||
#include "FlaxEngine.Gen.h"
|
||||
|
||||
#ifndef REVERSE_Z
|
||||
#define REVERSE_Z 0
|
||||
#endif
|
||||
|
||||
Dictionary<String, CookAssetsStep::ProcessAssetFunc> CookAssetsStep::AssetProcessors;
|
||||
|
||||
void IBuildCache::InvalidateCacheShaders()
|
||||
@@ -233,6 +237,11 @@ void CookAssetsStep::CacheData::Load(CookingData& data)
|
||||
LOG(Info, "{0} option has been modified.", TEXT("ShadersGenerateDebugData"));
|
||||
invalidateShaders = true;
|
||||
}
|
||||
if (REVERSE_Z != Settings.Global.ShadersReverseZ)
|
||||
{
|
||||
LOG(Info, "{0} option has been modified.", TEXT("ShadersReverseZ"));
|
||||
invalidateShaders = true;
|
||||
}
|
||||
#if PLATFORM_TOOLS_WINDOWS
|
||||
if (data.Platform == BuildPlatform::Windows32 || data.Platform == BuildPlatform::Windows64)
|
||||
{
|
||||
@@ -424,6 +433,7 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
|
||||
options.GenerateDebugData = data.Cache.Settings.Global.ShadersGenerateDebugData;
|
||||
options.TreatWarningsAsErrors = false;
|
||||
options.Output = &cacheStream;
|
||||
options.Platform = data.Data.Tools->GetPlatform();
|
||||
Array<String> includes;
|
||||
|
||||
#define COMPILE_PROFILE(profile, cacheChunk) \
|
||||
@@ -526,7 +536,6 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
|
||||
#if PLATFORM_TOOLS_XBOX_SCARLETT
|
||||
case BuildPlatform::XboxScarlett:
|
||||
{
|
||||
options.Platform = PlatformType::XboxScarlett;
|
||||
const char* platformDefineName = "PLATFORM_XBOX_SCARLETT";
|
||||
COMPILE_PROFILE(DirectX_SM6, SHADER_FILE_CHUNK_INTERNAL_D3D_SM6_CACHE);
|
||||
break;
|
||||
@@ -1076,6 +1085,7 @@ bool CookAssetsStep::Perform(CookingData& data)
|
||||
{
|
||||
cache.Settings.Global.ShadersNoOptimize = buildSettings->ShadersNoOptimize;
|
||||
cache.Settings.Global.ShadersGenerateDebugData = buildSettings->ShadersGenerateDebugData;
|
||||
cache.Settings.Global.ShadersReverseZ = REVERSE_Z;
|
||||
cache.Settings.Global.StreamingSettingsAssetId = gameSettings->Streaming;
|
||||
cache.Settings.Global.ShadersVersion = GPU_SHADER_CACHE_VERSION;
|
||||
cache.Settings.Global.MaterialGraphVersion = MATERIAL_GRAPH_VERSION;
|
||||
|
||||
@@ -97,6 +97,7 @@ public:
|
||||
{
|
||||
bool ShadersNoOptimize;
|
||||
bool ShadersGenerateDebugData;
|
||||
bool ShadersReverseZ;
|
||||
Guid StreamingSettingsAssetId;
|
||||
int32 ShadersVersion;
|
||||
int32 MaterialGraphVersion;
|
||||
|
||||
@@ -30,13 +30,6 @@ bool DeployDataStep::Perform(CookingData& data)
|
||||
Platform::Sleep(10);
|
||||
}
|
||||
FileSystem::CreateDirectory(contentDir);
|
||||
const String dstMono = data.DataOutputPath / TEXT("Mono");
|
||||
#if USE_NETCORE
|
||||
{
|
||||
// Remove old Mono files
|
||||
FileSystem::DeleteDirectory(dstMono);
|
||||
FileSystem::DeleteFile(data.DataOutputPath / TEXT("MonoPosixHelper.dll"));
|
||||
}
|
||||
String dstDotnet = data.DataOutputPath / TEXT("Dotnet");
|
||||
const DotNetAOTModes aotMode = data.Tools->UseAOT();
|
||||
const bool usAOT = aotMode != DotNetAOTModes::None && aotMode != DotNetAOTModes::NoDotnet;
|
||||
@@ -386,23 +379,6 @@ bool DeployDataStep::Perform(CookingData& data)
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (!FileSystem::DirectoryExists(dstMono))
|
||||
{
|
||||
// Deploy Mono files (from platform data folder)
|
||||
const String srcMono = depsRoot / TEXT("Mono");
|
||||
if (!FileSystem::DirectoryExists(srcMono))
|
||||
{
|
||||
data.Error(TEXT("Missing Mono runtime data files."));
|
||||
return true;
|
||||
}
|
||||
if (FileSystem::CopyDirectory(dstMono, srcMono))
|
||||
{
|
||||
data.Error(TEXT("Failed to copy Mono runtime data files."));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Deploy engine data for the target platform
|
||||
if (data.Tools->OnDeployBinaries(data))
|
||||
|
||||
@@ -52,16 +52,15 @@ void OnAssemblyLoaded(MAssembly* assembly);
|
||||
void OnAssemblyUnloading(MAssembly* assembly);
|
||||
void OnBinaryModuleLoaded(BinaryModule* module);
|
||||
|
||||
MTypeObject* CustomEditorsUtil::GetCustomEditor(MTypeObject* refType)
|
||||
MType* CustomEditorsUtil::GetCustomEditor(MType* type)
|
||||
{
|
||||
if (!refType)
|
||||
if (!type)
|
||||
return nullptr;
|
||||
MType* type = INTERNAL_TYPE_OBJECT_GET(refType);
|
||||
Entry result;
|
||||
if (Cache.TryGet(type, result))
|
||||
{
|
||||
if (result.CustomEditorType)
|
||||
return INTERNAL_TYPE_GET_OBJECT(result.CustomEditorType);
|
||||
return result.CustomEditorType;
|
||||
MClass* editor = result.CustomEditor ? result.CustomEditor : result.DefaultEditor;
|
||||
if (editor)
|
||||
return MUtils::GetType(editor);
|
||||
@@ -127,12 +126,8 @@ void OnAssemblyLoaded(MAssembly* assembly)
|
||||
continue;
|
||||
|
||||
// Check if attribute references a valid class
|
||||
MTypeObject* refType = nullptr;
|
||||
customEditorTypeField->GetValue(attribute, &refType);
|
||||
if (refType == nullptr)
|
||||
continue;
|
||||
|
||||
MType* type = INTERNAL_TYPE_OBJECT_GET(refType);
|
||||
MType* type = nullptr;
|
||||
customEditorTypeField->GetValue(attribute, &type);
|
||||
if (type == nullptr)
|
||||
continue;
|
||||
MClass* typeClass = MCore::Type::GetClass(type);
|
||||
|
||||
@@ -12,6 +12,6 @@ class CustomEditorsUtil
|
||||
public:
|
||||
|
||||
#if USE_CSHARP
|
||||
static MTypeObject* GetCustomEditor(MTypeObject* refType);
|
||||
static MType* GetCustomEditor(MType* type);
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -261,6 +261,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
public static List<ItemInfo> GetItemsForType(ScriptType type, bool useProperties, bool useFields, bool usePropertiesWithoutSetter = false)
|
||||
{
|
||||
var items = new List<ItemInfo>();
|
||||
var isPlayMode = Editor.IsPlayMode;
|
||||
|
||||
if (useProperties)
|
||||
{
|
||||
@@ -278,7 +279,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
continue;
|
||||
|
||||
// Skip hidden fields, handle special attributes
|
||||
if ((!p.IsPublic && !showInEditor) || attributes.Any(x => x is HideInEditorAttribute))
|
||||
if ((!p.IsPublic && !showInEditor) || attributes.Any(x => x is HideInEditorAttribute hide && (!isPlayMode || !hide.ShowInPlayMode)))
|
||||
continue;
|
||||
|
||||
items.Add(new ItemInfo(p, attributes));
|
||||
@@ -293,11 +294,10 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
for (int i = 0; i < fields.Length; i++)
|
||||
{
|
||||
var f = fields[i];
|
||||
|
||||
var attributes = f.GetAttributes(true);
|
||||
|
||||
// Skip hidden fields, handle special attributes
|
||||
if ((!f.IsPublic && !attributes.Any(x => x is ShowInEditorAttribute)) || attributes.Any(x => x is HideInEditorAttribute))
|
||||
if ((!f.IsPublic && !attributes.Any(x => x is ShowInEditorAttribute)) || attributes.Any(x => x is HideInEditorAttribute hide && (!isPlayMode || !hide.ShowInPlayMode)))
|
||||
continue;
|
||||
|
||||
items.Add(new ItemInfo(f, attributes));
|
||||
|
||||
@@ -679,7 +679,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
return asArray;
|
||||
if (Values[0] is List<Tag> asList)
|
||||
return asList.ToArray();
|
||||
return Utils.GetEmptyArray<Tag>();
|
||||
return Array.Empty<Tag>();
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
using System;
|
||||
|
||||
namespace FlaxEditor.CustomEditors.Editors
|
||||
{
|
||||
/// <summary>
|
||||
/// Default implementation of the inspector used to edit TimeSpan value type properties.
|
||||
/// </summary>
|
||||
[CustomEditor(typeof(TimeSpan)), DefaultEditor]
|
||||
class TimeSpanEditor : CustomEditor
|
||||
{
|
||||
private TextBox _textBox;
|
||||
private bool _isRefreshing;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override DisplayStyle Style => DisplayStyle.Inline;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
if (HasDifferentTypes)
|
||||
return;
|
||||
|
||||
_textBox = layout.Custom<TextBox>().CustomControl;
|
||||
_textBox.EditEnd += OnEditEnd;
|
||||
}
|
||||
|
||||
private void OnEditEnd()
|
||||
{
|
||||
if (_isRefreshing)
|
||||
return;
|
||||
if (TimeSpan.TryParse(_textBox.Text, out var timeSpan))
|
||||
SetValue(timeSpan);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
|
||||
_isRefreshing = true;
|
||||
_textBox.Text = HasDifferentValues ? "Multiple Values" : ((TimeSpan)Values[0]).ToString("G");
|
||||
_isRefreshing = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Default implementation of the inspector used to edit DateTime value type properties.
|
||||
/// </summary>
|
||||
[CustomEditor(typeof(DateTime)), DefaultEditor]
|
||||
class DateTimeEditor : CustomEditor
|
||||
{
|
||||
private TextBox _textBox;
|
||||
private bool _isRefreshing;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override DisplayStyle Style => DisplayStyle.Inline;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
if (HasDifferentTypes)
|
||||
return;
|
||||
|
||||
_textBox = layout.Custom<TextBox>().CustomControl;
|
||||
_textBox.EditEnd += OnEditEnd;
|
||||
}
|
||||
|
||||
private void OnEditEnd()
|
||||
{
|
||||
if (_isRefreshing)
|
||||
return;
|
||||
if (DateTime.TryParse(_textBox.Text, out var timeSpan))
|
||||
SetValue(timeSpan);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
|
||||
_isRefreshing = true;
|
||||
_textBox.Text = HasDifferentValues ? "Multiple Values" : ((DateTime)Values[0]).ToString("g");
|
||||
_isRefreshing = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@ using Microsoft.Win32;
|
||||
/// </summary>
|
||||
public class Editor : EditorModule
|
||||
{
|
||||
private static bool _logDotnetVersionsRange;
|
||||
|
||||
private void AddPlatformTools(BuildOptions options, string platformToolsRoot, string platformToolsRootExternal, string platform, params string[] macros)
|
||||
{
|
||||
if (Directory.Exists(Path.Combine(platformToolsRoot, platform)))
|
||||
@@ -107,7 +109,7 @@ public class Editor : EditorModule
|
||||
var maxVer = DotNetSdk.MaximumVersion.Major;
|
||||
options.PrivateDefinitions.Add("GAME_BUILD_DOTNET_RUNTIME_MIN_VER=" + minVer);
|
||||
options.PrivateDefinitions.Add("GAME_BUILD_DOTNET_RUNTIME_MAX_VER=" + DotNetSdk.MaximumVersion.Major);
|
||||
Log.Verbose($"Using Dotnet runtime versions range {minVer}-{maxVer} for Game Cooker");
|
||||
Log.VerboseOnce($"Using Dotnet runtime versions range {minVer}-{maxVer} for Game Cooker", ref _logDotnetVersionsRange);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -486,6 +486,15 @@ namespace FlaxEditor.GUI
|
||||
button.TooltipText = _tooltips[index];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the text for selected item(s).
|
||||
/// </summary>
|
||||
/// <returns>The display text.</returns>
|
||||
protected virtual string GetSelectedText()
|
||||
{
|
||||
return _selectedIndices.Count == 1 ? (_selectedIndices[0] >= 0 && _selectedIndices[0] < _items.Count ? _items[_selectedIndices[0]] : "") : "Multiple Values";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the popup menu.
|
||||
/// </summary>
|
||||
@@ -554,7 +563,7 @@ namespace FlaxEditor.GUI
|
||||
// Check if has selected item
|
||||
if (_selectedIndices != null && _selectedIndices.Count > 0)
|
||||
{
|
||||
string text = _selectedIndices.Count == 1 ? (_selectedIndices[0] >= 0 && _selectedIndices[0] < _items.Count ? _items[_selectedIndices[0]] : "") : "Multiple Values";
|
||||
string text = GetSelectedText();
|
||||
|
||||
// Draw text of the selected item
|
||||
float textScale = Height / DefaultHeight;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace FlaxEditor.GUI.Drag
|
||||
return results;
|
||||
}
|
||||
}
|
||||
return Utils.GetEmptyArray<ScriptType>();
|
||||
return Array.Empty<ScriptType>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public class DragControlType<U> : DragHelper<ScriptType, U> where U : DragEventA
|
||||
return results;
|
||||
}
|
||||
}
|
||||
return Utils.GetEmptyArray<ScriptType>();
|
||||
return Array.Empty<ScriptType>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace FlaxEditor.GUI.Drag
|
||||
return results.ToArray();
|
||||
}
|
||||
}
|
||||
return Utils.GetEmptyArray<Script>();
|
||||
return Array.Empty<Script>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using FlaxEditor.CustomEditors;
|
||||
using FlaxEditor.CustomEditors.Elements;
|
||||
using FlaxEditor.GUI.ContextMenu;
|
||||
using FlaxEditor.Scripting;
|
||||
@@ -106,16 +105,6 @@ namespace FlaxEditor.GUI
|
||||
if (_cachedValue == value && _hasValueCached)
|
||||
return;
|
||||
|
||||
// Single value
|
||||
for (int i = 0; i < _entries.Count; i++)
|
||||
{
|
||||
if (_entries[i].Value == value)
|
||||
{
|
||||
SelectedIndex = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsFlags)
|
||||
{
|
||||
// Collection of flags
|
||||
@@ -123,7 +112,7 @@ namespace FlaxEditor.GUI
|
||||
for (int i = 0; i < _entries.Count; i++)
|
||||
{
|
||||
var e = _entries[i].Value;
|
||||
if (e != 0 && (e & value) == e)
|
||||
if ((e != 0 || value == 0) && (e & value) == e)
|
||||
{
|
||||
selection.Add(i);
|
||||
}
|
||||
@@ -132,7 +121,17 @@ namespace FlaxEditor.GUI
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedIndex = -1;
|
||||
// Single value
|
||||
var toSelect = -1;
|
||||
for (int i = 0; i < _entries.Count; i++)
|
||||
{
|
||||
if (_entries[i].Value == value)
|
||||
{
|
||||
toSelect = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
SelectedIndex = toSelect;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -295,6 +294,22 @@ namespace FlaxEditor.GUI
|
||||
button.CloseMenuOnClick = false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override string GetSelectedText()
|
||||
{
|
||||
// If multiple values are selected then try to find an enum item that matches the mask value
|
||||
if (_selectedIndices.Count > 1)
|
||||
{
|
||||
foreach (var e in _entries)
|
||||
{
|
||||
if (e.Value == Value)
|
||||
return e.Name;
|
||||
}
|
||||
}
|
||||
|
||||
return base.GetSelectedText();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnItemClicked(int index)
|
||||
{
|
||||
@@ -310,43 +325,22 @@ namespace FlaxEditor.GUI
|
||||
}
|
||||
|
||||
// Calculate value that will be set after change
|
||||
long valueAfter = 0;
|
||||
long valueAfter = Value;
|
||||
bool isSelected = _selectedIndices.Contains(index);
|
||||
long selectedValue = entries[index].Value;
|
||||
for (int i = 0; i < _selectedIndices.Count; i++)
|
||||
if (isSelected)
|
||||
{
|
||||
int selectedIndex = _selectedIndices[i];
|
||||
if (selectedIndex != index && (isSelected || (entries[selectedIndex].Value & selectedValue) == 0))
|
||||
valueAfter |= entries[selectedIndex].Value;
|
||||
// Remove from flags selection
|
||||
valueAfter &= ~selectedValue;
|
||||
}
|
||||
if (!isSelected)
|
||||
else
|
||||
{
|
||||
// Add to flags selection
|
||||
valueAfter |= selectedValue;
|
||||
|
||||
// Skip if value won't change
|
||||
if (Value == valueAfter)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Build new selection
|
||||
for (int i = 0; i < entries.Count; i++)
|
||||
{
|
||||
if (entries[i].Value == valueAfter)
|
||||
{
|
||||
SelectedIndex = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
_selectedIndices.Clear();
|
||||
for (int i = 0; i < entries.Count; i++)
|
||||
{
|
||||
var e = entries[i].Value;
|
||||
if (e != 0 && (e & valueAfter) == e)
|
||||
{
|
||||
_selectedIndices.Add(i);
|
||||
}
|
||||
}
|
||||
OnSelectedIndexChanged();
|
||||
// Change value (incl. multiselection for flags)
|
||||
Value = valueAfter;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,12 +146,12 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
/// <summary>
|
||||
/// The event parameters data sizes collection.
|
||||
/// </summary>
|
||||
public int[] EventParamsSizes = Utils.GetEmptyArray<int>();
|
||||
public int[] EventParamsSizes = Array.Empty<int>();
|
||||
|
||||
/// <summary>
|
||||
/// The event parameters types collection.
|
||||
/// </summary>
|
||||
public Type[] EventParamsTypes = Utils.GetEmptyArray<Type>();
|
||||
public Type[] EventParamsTypes = Array.Empty<Type>();
|
||||
|
||||
/// <summary>
|
||||
/// The event key data.
|
||||
@@ -380,7 +380,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
}
|
||||
else
|
||||
{
|
||||
EventParamsTypes = Utils.GetEmptyArray<Type>();
|
||||
EventParamsTypes = Array.Empty<Type>();
|
||||
}
|
||||
OnEventParamsChanged();
|
||||
}
|
||||
|
||||
@@ -139,15 +139,11 @@ namespace FlaxEditor.Gizmo
|
||||
DrawSelectionDepth(context, renderContext.Task, customDepth);
|
||||
_actors.Clear();
|
||||
|
||||
var near = renderContext.View.Near;
|
||||
var far = renderContext.View.Far;
|
||||
var projection = renderContext.View.Projection;
|
||||
|
||||
// Render outline
|
||||
_material.SetParameterValue("OutlineColor0", _color0);
|
||||
_material.SetParameterValue("OutlineColor1", _color1);
|
||||
_material.SetParameterValue("CustomDepth", customDepth);
|
||||
_material.SetParameterValue("ViewInfo", new Float4(1.0f / projection.M11, 1.0f / projection.M22, far / (far - near), (-far * near) / (far - near) / far));
|
||||
_material.SetParameterValue("ViewInfo", renderContext.View.ViewInfo);
|
||||
Renderer.DrawPostFxMaterial(context, ref renderContext, _material, output, input.View());
|
||||
|
||||
// Cleanup
|
||||
|
||||
@@ -526,7 +526,7 @@ DEFINE_INTERNAL_CALL(void) EditorInternal_SetAnimationTime(AnimatedModel* animat
|
||||
animatedModel->GraphInstance.State[0].Animation.TimePosition = time;
|
||||
}
|
||||
|
||||
DEFINE_INTERNAL_CALL(MTypeObject*) CustomEditorsUtilInternal_GetCustomEditor(MTypeObject* targetType)
|
||||
DEFINE_INTERNAL_CALL(MType*) CustomEditorsUtilInternal_GetCustomEditor(MType* targetType)
|
||||
{
|
||||
return CustomEditorsUtil::GetCustomEditor(targetType);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace FlaxEditor.Modules
|
||||
private bool _rebuildInitFlag;
|
||||
private int _itemsCreated;
|
||||
private int _itemsDeleted;
|
||||
private readonly HashSet<MainContentFolderTreeNode> _dirtyNodes = new HashSet<MainContentFolderTreeNode>();
|
||||
private readonly HashSet<ContentFolderTreeNode> _dirtyNodes = new HashSet<ContentFolderTreeNode>();
|
||||
|
||||
/// <summary>
|
||||
/// The project directory.
|
||||
@@ -1309,26 +1309,31 @@ namespace FlaxEditor.Modules
|
||||
|
||||
internal void OnDirectoryEvent(MainContentFolderTreeNode node, FileSystemEventArgs e)
|
||||
{
|
||||
// Ensure to be ready for external events
|
||||
// Ignore events during fast setup
|
||||
if (_isDuringFastSetup)
|
||||
return;
|
||||
ContentFolderTreeNode dirtyNode = node;
|
||||
|
||||
// TODO: maybe we could make it faster! since we have a path so it would be easy to just create or delete given file. but remember about subdirectories
|
||||
// Filter the node based on modified path
|
||||
// (eg. if we have event for 'Content/Folder1/Folder2' and node is 'Content/Folder1' then we should process but skip other 'Content' subfolders)
|
||||
var path = StringUtils.NormalizePath(Path.GetDirectoryName(e.FullPath));
|
||||
var pathItem = node.Folder.Find(path) as ContentFolder;
|
||||
if (pathItem != null)
|
||||
{
|
||||
dirtyNode = pathItem.Node;
|
||||
}
|
||||
|
||||
// Switch type
|
||||
switch (e.ChangeType)
|
||||
{
|
||||
case WatcherChangeTypes.Created:
|
||||
case WatcherChangeTypes.Deleted:
|
||||
case WatcherChangeTypes.Renamed:
|
||||
{
|
||||
lock (_dirtyNodes)
|
||||
{
|
||||
_dirtyNodes.Add(node);
|
||||
_dirtyNodes.Add(dirtyNode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnScriptsReload()
|
||||
@@ -1383,14 +1388,15 @@ namespace FlaxEditor.Modules
|
||||
// Update all dirty content tree nodes
|
||||
lock (_dirtyNodes)
|
||||
{
|
||||
Profiler.BeginEvent("ContentDatabase.Refresh");
|
||||
foreach (var node in _dirtyNodes)
|
||||
{
|
||||
LoadFolder(node, true);
|
||||
|
||||
if (_enableEvents)
|
||||
WorkspaceModified?.Invoke();
|
||||
}
|
||||
if (_enableEvents && _dirtyNodes.Count != 0)
|
||||
WorkspaceModified?.Invoke();
|
||||
_dirtyNodes.Clear();
|
||||
Profiler.EndEvent();
|
||||
}
|
||||
|
||||
// Lazy-rebuilds
|
||||
|
||||
@@ -381,9 +381,6 @@ namespace FlaxEditor.Modules
|
||||
Thread.Sleep(0);
|
||||
|
||||
_workerThread.Join(1000);
|
||||
#if !USE_NETCORE
|
||||
_workerThread.Abort(); // Deprecated in .NET 7
|
||||
#endif
|
||||
_workerThread = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -584,7 +584,6 @@ namespace FlaxEditor.Modules.SourceCodeEditing
|
||||
var codeBase = Utils.GetAssemblyLocation(assembly);
|
||||
if (string.IsNullOrEmpty(codeBase))
|
||||
return true;
|
||||
#if USE_NETCORE
|
||||
if (assembly.ManifestModule.FullyQualifiedName == "<In Memory Module>")
|
||||
return false;
|
||||
|
||||
@@ -592,11 +591,6 @@ namespace FlaxEditor.Modules.SourceCodeEditing
|
||||
string repositoryUrl = assembly.GetCustomAttributes<AssemblyMetadataAttribute>().FirstOrDefault(x => x.Key == "RepositoryUrl")?.Value ?? "";
|
||||
if (repositoryUrl != "https://github.com/dotnet/runtime")
|
||||
return true;
|
||||
#else
|
||||
// Skip assemblies from in-build Mono directory
|
||||
if (!codeBase.Contains("/Mono/lib/mono/"))
|
||||
return true;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -465,6 +465,8 @@ namespace FlaxEditor.Modules
|
||||
|
||||
internal void ProgressFailed(string message)
|
||||
{
|
||||
if (StatusBar == null)
|
||||
return;
|
||||
_progressFailed = true;
|
||||
StatusBar.StatusColor = Style.Current.Statusbar.Failed;
|
||||
StatusBar.Text = message;
|
||||
|
||||
@@ -278,7 +278,7 @@ String RiderCodeEditor::GetName() const
|
||||
|
||||
String RiderCodeEditor::GetGenerateProjectCustomArgs() const
|
||||
{
|
||||
return TEXT("-vs2022");
|
||||
return TEXT("-vs2026");
|
||||
}
|
||||
|
||||
void RiderCodeEditor::OpenFile(const String& path, int32 line)
|
||||
|
||||
@@ -130,7 +130,7 @@ String VisualStudioCodeEditor::GetName() const
|
||||
|
||||
String VisualStudioCodeEditor::GetGenerateProjectCustomArgs() const
|
||||
{
|
||||
return TEXT("-vs2022 -vscode");
|
||||
return TEXT("-vs2026 -vscode");
|
||||
}
|
||||
|
||||
void VisualStudioCodeEditor::OpenFile(const String& path, int32 line)
|
||||
@@ -138,7 +138,7 @@ void VisualStudioCodeEditor::OpenFile(const String& path, int32 line)
|
||||
// Generate VS solution files for intellisense
|
||||
if (!FileSystem::FileExists(Globals::ProjectFolder / Editor::Project->Name + TEXT(".sln")))
|
||||
{
|
||||
ScriptsBuilder::GenerateProject(TEXT("-vs2022"));
|
||||
ScriptsBuilder::GenerateProject(TEXT("-vs2026"));
|
||||
}
|
||||
|
||||
// Generate project files if missing
|
||||
@@ -165,7 +165,7 @@ void VisualStudioCodeEditor::OpenSolution()
|
||||
// Generate VS solution files for intellisense
|
||||
if (!FileSystem::FileExists(Globals::ProjectFolder / Editor::Project->Name + TEXT(".sln")))
|
||||
{
|
||||
ScriptsBuilder::GenerateProject(TEXT("-vs2022"));
|
||||
ScriptsBuilder::GenerateProject(TEXT("-vs2026"));
|
||||
}
|
||||
|
||||
// Generate project files if solution is missing
|
||||
|
||||
@@ -112,37 +112,37 @@ namespace FlaxEditor.Scripting
|
||||
/// <inheritdoc />
|
||||
public object[] GetAttributes(bool inherit)
|
||||
{
|
||||
return Utils.GetEmptyArray<object>();
|
||||
return Array.Empty<object>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ScriptMemberInfo[] GetMembers(string name, MemberTypes type, BindingFlags bindingAttr)
|
||||
{
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ScriptMemberInfo[] GetMembers(BindingFlags bindingAttr)
|
||||
{
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ScriptMemberInfo[] GetFields(BindingFlags bindingAttr)
|
||||
{
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ScriptMemberInfo[] GetProperties(BindingFlags bindingAttr)
|
||||
{
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ScriptMemberInfo[] GetMethods(BindingFlags bindingAttr)
|
||||
{
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -447,7 +447,7 @@ namespace FlaxEditor.Scripting
|
||||
{
|
||||
var parameters = methodInfo.GetParameters();
|
||||
if (parameters.Length == 0)
|
||||
return Utils.GetEmptyArray<Parameter>();
|
||||
return Array.Empty<Parameter>();
|
||||
var result = new Parameter[parameters.Length];
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
{
|
||||
@@ -593,7 +593,7 @@ namespace FlaxEditor.Scripting
|
||||
}
|
||||
if (_custom != null)
|
||||
return _custom.GetAttributes(inherit);
|
||||
return Utils.GetEmptyArray<object>();
|
||||
return Array.Empty<object>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1116,7 +1116,7 @@ namespace FlaxEditor.Scripting
|
||||
return _managed.GetCustomAttributes(inherit);
|
||||
if (_custom != null)
|
||||
return _custom.GetAttributes(inherit);
|
||||
return Utils.GetEmptyArray<object>();
|
||||
return Array.Empty<object>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1191,12 +1191,12 @@ namespace FlaxEditor.Scripting
|
||||
if (_managed != null)
|
||||
{
|
||||
managedMembers = _managed.GetMember(name, type, bindingAttr);
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
managedMembers = null;
|
||||
if (_custom != null)
|
||||
return _custom.GetMembers(name, type, bindingAttr);
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1218,7 +1218,7 @@ namespace FlaxEditor.Scripting
|
||||
}
|
||||
if (_custom != null)
|
||||
return _custom.GetMembers(name, type, bindingAttr);
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1282,12 +1282,12 @@ namespace FlaxEditor.Scripting
|
||||
if (_managed != null)
|
||||
{
|
||||
managedMembers = _managed.GetMembers(bindingAttr);
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
managedMembers = null;
|
||||
if (_custom != null)
|
||||
return _custom.GetMembers(bindingAttr);
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1307,7 +1307,7 @@ namespace FlaxEditor.Scripting
|
||||
}
|
||||
if (_custom != null)
|
||||
return _custom.GetMembers(bindingAttr);
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1327,7 +1327,7 @@ namespace FlaxEditor.Scripting
|
||||
}
|
||||
if (_custom != null)
|
||||
return _custom.GetFields(bindingAttr);
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1365,7 +1365,7 @@ namespace FlaxEditor.Scripting
|
||||
}
|
||||
if (_custom != null)
|
||||
return _custom.GetProperties(bindingAttr);
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1403,7 +1403,7 @@ namespace FlaxEditor.Scripting
|
||||
}
|
||||
if (_custom != null)
|
||||
return _custom.GetMethods(bindingAttr);
|
||||
return Utils.GetEmptyArray<ScriptMemberInfo>();
|
||||
return Array.Empty<ScriptMemberInfo>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -141,10 +141,10 @@ int32 ScriptsBuilder::GetCompilationsCount()
|
||||
|
||||
String ScriptsBuilder::GetBuildToolPath()
|
||||
{
|
||||
#if USE_NETCORE && (PLATFORM_LINUX || PLATFORM_MAC)
|
||||
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build");
|
||||
#else
|
||||
#if PLATFORM_WINDOWS_FAMILY
|
||||
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build.exe");
|
||||
#else
|
||||
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -244,18 +244,6 @@ bool ScriptsBuilder::RunBuildTool(const StringView& args, const StringView& work
|
||||
|
||||
// Prepare build options
|
||||
StringBuilder cmdLine(args.Length() + buildToolPath.Length() + 200);
|
||||
#if !USE_NETCORE && (PLATFORM_LINUX || PLATFORM_MAC)
|
||||
const String monoPath = Globals::MonoPath / TEXT("bin/mono");
|
||||
if (!FileSystem::FileExists(monoPath))
|
||||
{
|
||||
Log::FileNotFoundException(monoPath).SetLevel(LogType::Fatal);
|
||||
return true;
|
||||
}
|
||||
const String monoPath = TEXT("mono");
|
||||
cmdLine.Append(monoPath);
|
||||
cmdLine.Append(TEXT(" "));
|
||||
// TODO: Set env var for the mono MONO_GC_PARAMS=nursery-size64m to boost build performance -> profile it
|
||||
#endif
|
||||
cmdLine.Append(buildToolPath);
|
||||
|
||||
// Call build tool
|
||||
|
||||
@@ -39,8 +39,8 @@ namespace FlaxEditor.Surface
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
"State",
|
||||
Utils.GetEmptyArray<byte>(),
|
||||
Utils.GetEmptyArray<byte>(),
|
||||
Array.Empty<byte>(),
|
||||
Array.Empty<byte>(),
|
||||
},
|
||||
Size = new Float2(100, 0),
|
||||
},
|
||||
@@ -54,7 +54,7 @@ namespace FlaxEditor.Surface
|
||||
Size = new Float2(100, 0),
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
Utils.GetEmptyArray<byte>(),
|
||||
Array.Empty<byte>(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -875,7 +875,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
byte[] value;
|
||||
if (Transitions.Count == 0)
|
||||
{
|
||||
value = Utils.GetEmptyArray<byte>();
|
||||
value = Array.Empty<byte>();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1807,7 +1807,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
get => _ruleGraph;
|
||||
set
|
||||
{
|
||||
_ruleGraph = value ?? Utils.GetEmptyArray<byte>();
|
||||
_ruleGraph = value ?? Array.Empty<byte>();
|
||||
SourceState.SaveTransitions();
|
||||
}
|
||||
}
|
||||
@@ -1849,7 +1849,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
DestinationState = destination;
|
||||
_data = data;
|
||||
_data.Destination = destination.ID;
|
||||
_ruleGraph = ruleGraph ?? Utils.GetEmptyArray<byte>();
|
||||
_ruleGraph = ruleGraph ?? Array.Empty<byte>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -784,7 +784,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
"Locomotion",
|
||||
Utils.GetEmptyArray<byte>(),
|
||||
Array.Empty<byte>(),
|
||||
3,
|
||||
true,
|
||||
true,
|
||||
@@ -818,8 +818,8 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
"State",
|
||||
Utils.GetEmptyArray<byte>(),
|
||||
Utils.GetEmptyArray<byte>(),
|
||||
Array.Empty<byte>(),
|
||||
Array.Empty<byte>(),
|
||||
},
|
||||
},
|
||||
new NodeArchetype
|
||||
@@ -1089,7 +1089,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
Size = new Float2(100, 0),
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
Utils.GetEmptyArray<byte>(),
|
||||
Array.Empty<byte>(),
|
||||
},
|
||||
},
|
||||
new NodeArchetype
|
||||
|
||||
@@ -445,7 +445,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
var decorator = Context.SpawnNode(19, 3, Location, new object[]
|
||||
{
|
||||
nodeType.TypeName,
|
||||
Utils.GetEmptyArray<byte>(),
|
||||
Array.Empty<byte>(),
|
||||
});
|
||||
|
||||
// Add decorator to the node
|
||||
@@ -646,7 +646,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
return new[] { uint.Parse(id[0]) };
|
||||
}
|
||||
}
|
||||
return Utils.GetEmptyArray<uint>();
|
||||
return Array.Empty<uint>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -949,7 +949,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
string.Empty, // Type Name
|
||||
Utils.GetEmptyArray<byte>(), // Instance Data
|
||||
Array.Empty<byte>(), // Instance Data
|
||||
null, // List of Decorator Nodes IDs
|
||||
},
|
||||
Size = new Float2(100, 0),
|
||||
@@ -967,7 +967,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
typeof(BehaviorTreeRootNode).FullName, // Root node
|
||||
Utils.GetEmptyArray<byte>(), // Instance Data
|
||||
Array.Empty<byte>(), // Instance Data
|
||||
},
|
||||
Size = new Float2(100, 0),
|
||||
Elements = new[]
|
||||
@@ -984,7 +984,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
string.Empty, // Type Name
|
||||
Utils.GetEmptyArray<byte>(), // Instance Data
|
||||
Array.Empty<byte>(), // Instance Data
|
||||
},
|
||||
Size = new Float2(100, 0),
|
||||
},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FlaxEditor.GUI;
|
||||
using FlaxEditor.Scripting;
|
||||
@@ -84,7 +85,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
const int firstBox = 2;
|
||||
const int maxBoxes = 40;
|
||||
bool isInvalid = false;
|
||||
var data = Utils.GetEmptyArray<byte>();
|
||||
var data = Array.Empty<byte>();
|
||||
|
||||
if (valueBox.HasAnyConnection)
|
||||
{
|
||||
@@ -216,7 +217,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
Description = "Returns one of the input values based on the enum value",
|
||||
Flags = NodeFlags.VisualScriptGraph | NodeFlags.AnimGraph,
|
||||
Size = new Float2(160, 60),
|
||||
DefaultValues = new object[] { Utils.GetEmptyArray<byte>() },
|
||||
DefaultValues = new object[] { Array.Empty<byte>() },
|
||||
ConnectionsHints = ConnectionsHint.Enum,
|
||||
Elements = new[]
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FlaxEditor.GUI;
|
||||
using FlaxEditor.Scripting;
|
||||
@@ -140,7 +141,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
const int firstBox = 2;
|
||||
const int maxBoxes = 40;
|
||||
bool isInvalid = false;
|
||||
var data = Utils.GetEmptyArray<byte>();
|
||||
var data = Array.Empty<byte>();
|
||||
|
||||
if (valueBox.HasAnyConnection)
|
||||
{
|
||||
@@ -285,7 +286,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
Description = "Performs the flow logic branch based on the enum value",
|
||||
Flags = NodeFlags.VisualScriptGraph,
|
||||
Size = new Float2(160, 60),
|
||||
DefaultValues = new object[] { Utils.GetEmptyArray<byte>() },
|
||||
DefaultValues = new object[] { Array.Empty<byte>() },
|
||||
ConnectionsHints = ConnectionsHint.Enum,
|
||||
Elements = new[]
|
||||
{
|
||||
|
||||
@@ -574,7 +574,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
if (_parameters.Length == 0 && methodInfo.ValueType.IsVoid)
|
||||
{
|
||||
// Skip allocations if method is void and parameter-less
|
||||
Values[2] = Utils.GetEmptyArray<byte>();
|
||||
Values[2] = Array.Empty<byte>();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -714,7 +714,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
method.Name, // Method name
|
||||
parametersCount, // Method parameters count
|
||||
false, // Is Pure?
|
||||
Utils.GetEmptyArray<byte>(), // Cached function signature data
|
||||
Array.Empty<byte>(), // Cached function signature data
|
||||
// Default value for parameters (27 entries)
|
||||
// @formatter:off
|
||||
null,null,null,null,null,null,null,null,null,null,
|
||||
@@ -810,7 +810,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
signature.IsStatic = reader.ReadBoolean(); // Is Static
|
||||
signature.ReturnType = VariantUtils.ReadVariantScriptType(reader); // Return type
|
||||
var parametersCount = reader.ReadInt32(); // Parameters count
|
||||
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Utils.GetEmptyArray<SignatureParamInfo>();
|
||||
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Array.Empty<SignatureParamInfo>();
|
||||
for (int i = 0; i < parametersCount; i++)
|
||||
{
|
||||
ref var param = ref signature.Params[i];
|
||||
@@ -831,7 +831,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
signature.IsStatic = reader.ReadBoolean(); // Is Static
|
||||
signature.ReturnType = VariantUtils.ReadVariantScriptType(reader); // Return type
|
||||
var parametersCount = reader.ReadInt32(); // Parameters count
|
||||
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Utils.GetEmptyArray<SignatureParamInfo>();
|
||||
signature.Params = parametersCount != 0 ? new SignatureParamInfo[parametersCount] : Array.Empty<SignatureParamInfo>();
|
||||
for (int i = 0; i < parametersCount; i++)
|
||||
{
|
||||
ref var param = ref signature.Params[i];
|
||||
@@ -2489,7 +2489,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
{
|
||||
string.Empty, // Overriden method name
|
||||
0, // Overriden method parameters count
|
||||
Utils.GetEmptyArray<byte>(), // Cached function signature data
|
||||
Array.Empty<byte>(), // Cached function signature data
|
||||
},
|
||||
},
|
||||
new NodeArchetype
|
||||
@@ -2507,7 +2507,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
string.Empty, // Method name
|
||||
0, // Method parameters count
|
||||
false, // Is Pure?
|
||||
Utils.GetEmptyArray<byte>(), // Cached function signature data
|
||||
Array.Empty<byte>(), // Cached function signature data
|
||||
|
||||
// Default value for parameters (27 entries)
|
||||
// @formatter:off
|
||||
@@ -2546,7 +2546,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
Size = new Float2(240, 20),
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
Utils.GetEmptyArray<byte>(), // Function signature data
|
||||
Array.Empty<byte>(), // Function signature data
|
||||
},
|
||||
},
|
||||
new NodeArchetype
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
if (fieldsLength == 0)
|
||||
{
|
||||
// Skip allocations if structure is empty
|
||||
Values[1] = Utils.GetEmptyArray<byte>();
|
||||
Values[1] = Array.Empty<byte>();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -471,7 +471,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
string.Empty, // Typename
|
||||
Utils.GetEmptyArray<byte>(), // Cached structure layout data
|
||||
Array.Empty<byte>(), // Cached structure layout data
|
||||
},
|
||||
Elements = new[]
|
||||
{
|
||||
@@ -591,7 +591,7 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
DefaultValues = new object[]
|
||||
{
|
||||
string.Empty, // Typename
|
||||
Utils.GetEmptyArray<byte>(), // Cached structure layout data
|
||||
Array.Empty<byte>(), // Cached structure layout data
|
||||
},
|
||||
Elements = new[]
|
||||
{
|
||||
|
||||
@@ -56,8 +56,8 @@ namespace FlaxEditor.Surface
|
||||
|
||||
private object Creator(Type type)
|
||||
{
|
||||
var ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, Utils.GetEmptyArray<Type>(), null);
|
||||
return ctor.Invoke(Utils.GetEmptyArray<object>());
|
||||
var ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, Array.Empty<Type>(), null);
|
||||
return ctor.Invoke(Array.Empty<object>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1484,7 +1484,7 @@ namespace FlaxEditor.Surface.Elements
|
||||
protected override void OnAttributesChanged()
|
||||
{
|
||||
OnCurrentTypeChanged();
|
||||
_editor?.UpdateAttributes(this, _attributes ?? Utils.GetEmptyArray<object>(), _defaultValueEditor);
|
||||
_editor?.UpdateAttributes(this, _attributes ?? Array.Empty<object>(), _defaultValueEditor);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace FlaxEditor.Surface
|
||||
}
|
||||
}
|
||||
}
|
||||
return Utils.GetEmptyArray<Attribute>();
|
||||
return Array.Empty<Attribute>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,7 +106,7 @@ namespace FlaxEditor.Surface
|
||||
var json = FlaxEngine.Json.JsonSerializer.Serialize(attributes);
|
||||
return Encoding.Unicode.GetBytes(json);
|
||||
}
|
||||
return Utils.GetEmptyArray<byte>();
|
||||
return Array.Empty<byte>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace FlaxEditor.Surface
|
||||
surfaceParameters.Remove(surfaceParameter);
|
||||
surfaceParameters.Add(surfaceParameter);
|
||||
}
|
||||
var attributes = surfaceParameter?.Meta.GetAttributes() ?? FlaxEngine.Utils.GetEmptyArray<Attribute>();
|
||||
var attributes = surfaceParameter?.Meta.GetAttributes() ?? Array.Empty<Attribute>();
|
||||
data[i] = new GraphParameterData(null, index++, parameter.Name, parameter.IsPublic, ToType(parameter.ParameterType), attributes, parameter);
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace FlaxEditor.Tools.Foliage
|
||||
private int _selectedInstanceIndex = -1;
|
||||
|
||||
/// <summary>
|
||||
/// The foliage painting gizmo.
|
||||
/// The foliage editing gizmo.
|
||||
/// </summary>
|
||||
public EditFoliageGizmo Gizmo;
|
||||
|
||||
@@ -66,8 +66,6 @@ namespace FlaxEditor.Tools.Foliage
|
||||
base.Init(owner);
|
||||
|
||||
Gizmo = new EditFoliageGizmo(owner, this);
|
||||
SelectionOutline = FlaxEngine.Object.New<EditFoliageSelectionOutline>();
|
||||
SelectionOutline.GizmoMode = this;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -84,6 +82,11 @@ namespace FlaxEditor.Tools.Foliage
|
||||
base.OnActivated();
|
||||
|
||||
Owner.Gizmos.Active = Gizmo;
|
||||
if (SelectionOutline == null)
|
||||
{
|
||||
SelectionOutline = FlaxEngine.Object.New<EditFoliageSelectionOutline>();
|
||||
SelectionOutline.GizmoMode = this;
|
||||
}
|
||||
((MainEditorGizmoViewport)Owner).OverrideSelectionOutline(SelectionOutline);
|
||||
SelectedInstanceIndex = -1;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using FlaxEngine;
|
||||
namespace FlaxEditor.Tools.Foliage
|
||||
{
|
||||
/// <summary>
|
||||
/// The custom outline for drawing the selected foliage instances outlines.
|
||||
/// The custom outline for drawing the selected foliage instance.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Gizmo.SelectionOutline" />
|
||||
[HideInEditor]
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Collections.Generic;
|
||||
using FlaxEditor.GUI.Tabs;
|
||||
using FlaxEditor.Modules;
|
||||
using FlaxEditor.SceneGraph.Actors;
|
||||
using FlaxEditor.Viewport.Modes;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
|
||||
@@ -214,7 +213,7 @@ namespace FlaxEditor.Tools.Foliage
|
||||
|
||||
private void InitSculptMode()
|
||||
{
|
||||
var tab = _modes.AddTab(FoliageTypes = new FoliageTypesTab(this));
|
||||
var tab = _modes.AddTab(FoliageTypes = new FoliageTypesTab(this, Editor.Windows.EditWin.Viewport.EditFoliageTypesGizmo));
|
||||
tab.Selected += OnTabSelected;
|
||||
}
|
||||
|
||||
@@ -251,7 +250,7 @@ namespace FlaxEditor.Tools.Foliage
|
||||
switch (_modes.SelectedTabIndex)
|
||||
{
|
||||
case 0:
|
||||
Editor.Windows.EditWin.Viewport.Gizmos.SetActiveMode<NoGizmoMode>();
|
||||
Editor.Windows.EditWin.Viewport.Gizmos.SetActiveMode<FoliageTypesGizmoMode>();
|
||||
break;
|
||||
case 1:
|
||||
Editor.Windows.EditWin.Viewport.Gizmos.SetActiveMode<PaintFoliageGizmoMode>();
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using FlaxEditor.Gizmo;
|
||||
|
||||
namespace FlaxEditor.Tools.Foliage
|
||||
{
|
||||
/// <summary>
|
||||
/// Gizmo for editing foliage types.
|
||||
/// </summary>
|
||||
public sealed class FoliageTypesGizmo : GizmoBase
|
||||
{
|
||||
/// <summary>
|
||||
/// The parent mode.
|
||||
/// </summary>
|
||||
public readonly FoliageTypesGizmoMode GizmoMode;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EditFoliageGizmo"/> class.
|
||||
/// </summary>
|
||||
/// <param name="owner">The owner.</param>
|
||||
/// <param name="mode">The mode.</param>
|
||||
public FoliageTypesGizmo(IGizmoOwner owner, FoliageTypesGizmoMode mode)
|
||||
: base(owner)
|
||||
{
|
||||
GizmoMode = mode;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Pick()
|
||||
{
|
||||
// Get mouse ray and try to hit foliage instance
|
||||
var foliage = GizmoMode.SelectedFoliage;
|
||||
if (!foliage)
|
||||
return;
|
||||
var ray = Owner.MouseRay;
|
||||
if (foliage.Intersects(ref ray, out _, out _, out var instanceIndex))
|
||||
{
|
||||
// Select hit instance type
|
||||
var instance = foliage.GetInstance(instanceIndex);
|
||||
GizmoMode.SelectedTypeIndex = instance.Type;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using FlaxEditor.Gizmo;
|
||||
using FlaxEditor.SceneGraph.Actors;
|
||||
using FlaxEditor.Viewport;
|
||||
using FlaxEditor.Viewport.Modes;
|
||||
|
||||
namespace FlaxEditor.Tools.Foliage
|
||||
{
|
||||
/// <summary>
|
||||
/// Foliage types editing mode.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Viewport.Modes.EditorGizmoMode" />
|
||||
public class FoliageTypesGizmoMode : EditorGizmoMode
|
||||
{
|
||||
/// <summary>
|
||||
/// The foliage types gizmo.
|
||||
/// </summary>
|
||||
public FoliageTypesGizmo Gizmo;
|
||||
|
||||
/// <summary>
|
||||
/// The foliage type editing selection outline.
|
||||
/// </summary>
|
||||
public FoliageTypesOutline SelectionOutline;
|
||||
|
||||
/// <summary>
|
||||
/// The selected foliage type index.
|
||||
/// </summary>
|
||||
public int SelectedTypeIndex
|
||||
{
|
||||
get => Editor.Instance.Windows.ToolboxWin.Foliage.SelectedFoliageTypeIndex;
|
||||
set => Editor.Instance.Windows.ToolboxWin.Foliage.SelectedFoliageTypeIndex = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the selected foliage actor (see <see cref="Modules.SceneEditingModule"/>).
|
||||
/// </summary>
|
||||
public FlaxEngine.Foliage SelectedFoliage
|
||||
{
|
||||
get
|
||||
{
|
||||
var sceneEditing = Editor.Instance.SceneEditing;
|
||||
var foliageNode = sceneEditing.SelectionCount == 1 ? sceneEditing.Selection[0] as FoliageNode : null;
|
||||
return (FlaxEngine.Foliage)foliageNode?.Actor;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Init(IGizmoOwner owner)
|
||||
{
|
||||
base.Init(owner);
|
||||
|
||||
Gizmo = new FoliageTypesGizmo(owner, this);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Dispose()
|
||||
{
|
||||
FlaxEngine.Object.Destroy(ref SelectionOutline);
|
||||
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnActivated()
|
||||
{
|
||||
base.OnActivated();
|
||||
|
||||
Owner.Gizmos.Active = Gizmo;
|
||||
if (SelectionOutline == null)
|
||||
{
|
||||
SelectionOutline = FlaxEngine.Object.New<FoliageTypesOutline>();
|
||||
SelectionOutline.GizmoMode = this;
|
||||
}
|
||||
((MainEditorGizmoViewport)Owner).OverrideSelectionOutline(SelectionOutline);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnDeactivated()
|
||||
{
|
||||
((MainEditorGizmoViewport)Owner).OverrideSelectionOutline(null);
|
||||
|
||||
base.OnDeactivated();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using FlaxEditor.Gizmo;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace FlaxEditor.Tools.Foliage
|
||||
{
|
||||
/// <summary>
|
||||
/// The custom outline for drawing the selected foliage type.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Gizmo.SelectionOutline" />
|
||||
[HideInEditor]
|
||||
public class FoliageTypesOutline : SelectionOutline
|
||||
{
|
||||
/// <summary>
|
||||
/// The parent mode.
|
||||
/// </summary>
|
||||
public FoliageTypesGizmoMode GizmoMode;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool CanRender()
|
||||
{
|
||||
if (!HasDataReady)
|
||||
return false;
|
||||
|
||||
var foliage = GizmoMode.SelectedFoliage;
|
||||
if (!foliage)
|
||||
return false;
|
||||
var typeIndex = GizmoMode.SelectedTypeIndex;
|
||||
if (typeIndex < 0 || typeIndex >= foliage.FoliageTypesCount)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Render(GPUContext context, ref RenderContext renderContext, GPUTexture input, GPUTexture output)
|
||||
{
|
||||
base.Render(context, ref renderContext, input, output);
|
||||
|
||||
// Restore debug option
|
||||
var foliage = GizmoMode.SelectedFoliage;
|
||||
if (foliage)
|
||||
foliage._drawFoliageType = -1;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void DrawSelectionDepth(GPUContext context, SceneRenderTask task, GPUTexture customDepth)
|
||||
{
|
||||
var foliage = GizmoMode.SelectedFoliage;
|
||||
if (!foliage)
|
||||
return;
|
||||
var typeIndex = GizmoMode.SelectedTypeIndex;
|
||||
if (typeIndex < 0 || typeIndex >= foliage.FoliageTypesCount)
|
||||
return;
|
||||
|
||||
// Draw instances of the given type
|
||||
foliage._drawFoliageType = typeIndex;
|
||||
_actors.Add(foliage);
|
||||
Renderer.DrawSceneDepth(context, task, customDepth, _actors);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -334,7 +334,8 @@ namespace FlaxEditor.Tools.Foliage
|
||||
/// Initializes a new instance of the <see cref="FoliageTypesTab"/> class.
|
||||
/// </summary>
|
||||
/// <param name="tab">The parent tab.</param>
|
||||
public FoliageTypesTab(FoliageTab tab)
|
||||
/// <param name="mode">The gizmo mode.</param>
|
||||
public FoliageTypesTab(FoliageTab tab, FoliageTypesGizmoMode mode)
|
||||
: base("Foliage Types")
|
||||
{
|
||||
Tab = tab;
|
||||
|
||||
@@ -1514,9 +1514,14 @@ namespace FlaxEditor.Viewport
|
||||
Matrix.Multiply(ref v, ref p, out var ivp);
|
||||
ivp.Invert();
|
||||
|
||||
// Create near and far points
|
||||
var nearPoint = new Vector3(mousePosition, _nearPlane);
|
||||
var farPoint = new Vector3(mousePosition, _farPlane);
|
||||
// Create near and far points, with device depth of 1 and 0 respectively
|
||||
#if REVERSE_Z
|
||||
var nearPoint = new Vector3(mousePosition, 1.0f);
|
||||
var farPoint = new Vector3(mousePosition, 0.0f);
|
||||
#else
|
||||
var nearPoint = new Vector3(mousePosition, 0.0f);
|
||||
var farPoint = new Vector3(mousePosition, 1.0f);
|
||||
#endif
|
||||
viewport.Unproject(ref nearPoint, ref ivp, out nearPoint);
|
||||
viewport.Unproject(ref farPoint, ref ivp, out farPoint);
|
||||
|
||||
@@ -2084,9 +2089,9 @@ namespace FlaxEditor.Viewport
|
||||
new ViewModeOptions(ViewMode.Wireframe, "Wireframe", Editor.Instance.Options.Options.Input.Wireframe),
|
||||
new ViewModeOptions(ViewMode.LightBuffer, "Light Buffer", Editor.Instance.Options.Options.Input.LightBuffer),
|
||||
new ViewModeOptions(ViewMode.Reflections, "Reflections Buffer", Editor.Instance.Options.Options.Input.ReflectionsBuffer),
|
||||
new ViewModeOptions(ViewMode.Depth, "Depth Buffer", Editor.Instance.Options.Options.Input.DepthBuffer),
|
||||
new ViewModeOptions("GBuffer", new[]
|
||||
{
|
||||
new ViewModeOptions(ViewMode.Depth, "Depth Buffer", Editor.Instance.Options.Options.Input.DepthBuffer),
|
||||
new ViewModeOptions(ViewMode.Diffuse, "Diffuse"),
|
||||
new ViewModeOptions(ViewMode.Metalness, "Metalness"),
|
||||
new ViewModeOptions(ViewMode.Roughness, "Roughness"),
|
||||
@@ -2102,9 +2107,13 @@ namespace FlaxEditor.Viewport
|
||||
new ViewModeOptions(ViewMode.LightmapUVsDensity, "Lightmap UVs Density", Editor.Instance.Options.Options.Input.LightmapUVDensity),
|
||||
new ViewModeOptions(ViewMode.VertexColors, "Vertex Colors", Editor.Instance.Options.Options.Input.VertexColors),
|
||||
new ViewModeOptions(ViewMode.PhysicsColliders, "Physics Colliders", Editor.Instance.Options.Options.Input.PhysicsColliders),
|
||||
new ViewModeOptions(ViewMode.LODPreview, "LOD Preview", Editor.Instance.Options.Options.Input.LODPreview),
|
||||
new ViewModeOptions(ViewMode.MaterialComplexity, "Material Complexity", Editor.Instance.Options.Options.Input.MaterialComplexity),
|
||||
new ViewModeOptions(ViewMode.QuadOverdraw, "Quad Overdraw", Editor.Instance.Options.Options.Input.QuadOverdraw),
|
||||
new ViewModeOptions("Optimization", new[]
|
||||
{
|
||||
new ViewModeOptions(ViewMode.LODPreview, "LOD Preview", Editor.Instance.Options.Options.Input.LODPreview),
|
||||
new ViewModeOptions(ViewMode.MaterialComplexity, "Material Complexity", Editor.Instance.Options.Options.Input.MaterialComplexity),
|
||||
new ViewModeOptions(ViewMode.QuadOverdraw, "Quad Overdraw", Editor.Instance.Options.Options.Input.QuadOverdraw),
|
||||
new ViewModeOptions(ViewMode.GlobalSDFOverdraw, "Global SDF Overdraw"),
|
||||
}),
|
||||
new ViewModeOptions(ViewMode.GlobalSDF, "Global SDF", Editor.Instance.Options.Options.Input.GloablSDF),
|
||||
new ViewModeOptions(ViewMode.GlobalSurfaceAtlas, "Global Surface Atlas", Editor.Instance.Options.Options.Input.GlobalSurfaceAtlas),
|
||||
new ViewModeOptions(ViewMode.GlobalIllumination, "Global Illumination", Editor.Instance.Options.Options.Input.GlobalIllumination),
|
||||
|
||||
@@ -179,12 +179,17 @@ namespace FlaxEditor.Viewport
|
||||
public Tools.Terrain.EditTerrainGizmoMode EditTerrainGizmo;
|
||||
|
||||
/// <summary>
|
||||
/// The paint foliage gizmo.
|
||||
/// The edit foliage types gizmo.
|
||||
/// </summary>
|
||||
public Tools.Foliage.FoliageTypesGizmoMode EditFoliageTypesGizmo;
|
||||
|
||||
/// <summary>
|
||||
/// The paint foliage instances gizmo.
|
||||
/// </summary>
|
||||
public Tools.Foliage.PaintFoliageGizmoMode PaintFoliageGizmo;
|
||||
|
||||
/// <summary>
|
||||
/// The edit foliage gizmo.
|
||||
/// The edit foliage instances gizmo.
|
||||
/// </summary>
|
||||
public Tools.Foliage.EditFoliageGizmoMode EditFoliageGizmo;
|
||||
|
||||
@@ -276,6 +281,7 @@ namespace FlaxEditor.Viewport
|
||||
Gizmos.AddMode(SculptTerrainGizmo = new Tools.Terrain.SculptTerrainGizmoMode());
|
||||
Gizmos.AddMode(PaintTerrainGizmo = new Tools.Terrain.PaintTerrainGizmoMode());
|
||||
Gizmos.AddMode(EditTerrainGizmo = new Tools.Terrain.EditTerrainGizmoMode());
|
||||
Gizmos.AddMode(EditFoliageTypesGizmo = new Tools.Foliage.FoliageTypesGizmoMode());
|
||||
Gizmos.AddMode(PaintFoliageGizmo = new Tools.Foliage.PaintFoliageGizmoMode());
|
||||
Gizmos.AddMode(EditFoliageGizmo = new Tools.Foliage.EditFoliageGizmoMode());
|
||||
|
||||
@@ -343,10 +349,12 @@ namespace FlaxEditor.Viewport
|
||||
/// <param name="customSelectionOutline">The custom selection outline or null if use default one.</param>
|
||||
public void OverrideSelectionOutline(SelectionOutline customSelectionOutline)
|
||||
{
|
||||
if (Task == null)
|
||||
return;
|
||||
|
||||
if (_customSelectionOutline != null)
|
||||
{
|
||||
Task.RemoveCustomPostFx(_customSelectionOutline);
|
||||
Object.Destroy(ref _customSelectionOutline);
|
||||
Task.AddCustomPostFx(customSelectionOutline ? customSelectionOutline : SelectionOutline);
|
||||
}
|
||||
else if (customSelectionOutline != null)
|
||||
@@ -530,7 +538,7 @@ namespace FlaxEditor.Viewport
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggles game view view mode on or off.
|
||||
/// Toggles view mode on/off.
|
||||
/// </summary>
|
||||
public void ToggleGameView()
|
||||
{
|
||||
@@ -547,9 +555,9 @@ namespace FlaxEditor.Viewport
|
||||
// Set flags & values
|
||||
Task.ViewFlags = _gameViewActive ? _preGameViewFlags : ViewFlags.DefaultGame;
|
||||
Task.ViewMode = _gameViewActive ? _preGameViewViewMode : ViewMode.Default;
|
||||
ShowFpsCounter = _gameViewActive ? _gameViewWasFpsCounterShown : false;
|
||||
ShowNavigation = _gameViewActive ? _gameViewWasNavigationShown : false;
|
||||
Grid.Enabled = _gameViewActive ? _gameViewWasGridShown : false;
|
||||
ShowFpsCounter = _gameViewActive && _gameViewWasFpsCounterShown;
|
||||
ShowNavigation = _gameViewActive && _gameViewWasNavigationShown;
|
||||
Grid.Enabled = _gameViewActive && _gameViewWasGridShown;
|
||||
|
||||
_gameViewActive = !_gameViewActive;
|
||||
|
||||
@@ -730,6 +738,20 @@ namespace FlaxEditor.Viewport
|
||||
base.OnLeftMouseButtonUp();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool OnKeyDown(KeyboardKeys key)
|
||||
{
|
||||
if (base.OnKeyDown(key))
|
||||
return true;
|
||||
|
||||
if (key == KeyboardKeys.Escape)
|
||||
{
|
||||
_editor.SceneEditing.Deselect();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool OnMouseUp(Float2 location, MouseButton button)
|
||||
{
|
||||
@@ -843,8 +865,8 @@ namespace FlaxEditor.Viewport
|
||||
if (_task != null)
|
||||
{
|
||||
// Release if task is not used to save screenshot for project icon
|
||||
ReleaseTaskResources();
|
||||
Object.Destroy(ref _task);
|
||||
ReleaseResources();
|
||||
}
|
||||
|
||||
base.OnDestroy();
|
||||
@@ -860,6 +882,7 @@ namespace FlaxEditor.Viewport
|
||||
_savedTask = _task;
|
||||
_savedBackBuffer = _backBuffer;
|
||||
|
||||
ReleaseTaskResources();
|
||||
_task = null;
|
||||
_backBuffer = null;
|
||||
}
|
||||
@@ -870,20 +893,20 @@ namespace FlaxEditor.Viewport
|
||||
{
|
||||
_savedTask.Enabled = false;
|
||||
Object.Destroy(_savedTask);
|
||||
ReleaseResources();
|
||||
ReleaseTaskResources();
|
||||
_savedTask = null;
|
||||
}
|
||||
Object.Destroy(ref _savedBackBuffer);
|
||||
}
|
||||
|
||||
private void ReleaseResources()
|
||||
private void ReleaseTaskResources()
|
||||
{
|
||||
if (Task)
|
||||
if (_task)
|
||||
{
|
||||
Task.RemoveCustomPostFx(SelectionOutline);
|
||||
Task.RemoveCustomPostFx(EditorPrimitives);
|
||||
Task.RemoveCustomPostFx(_editorSpritesRenderer);
|
||||
Task.RemoveCustomPostFx(_customSelectionOutline);
|
||||
_task.RemoveCustomPostFx(SelectionOutline);
|
||||
_task.RemoveCustomPostFx(EditorPrimitives);
|
||||
_task.RemoveCustomPostFx(_editorSpritesRenderer);
|
||||
_task.RemoveCustomPostFx(_customSelectionOutline);
|
||||
}
|
||||
Object.Destroy(ref SelectionOutline);
|
||||
Object.Destroy(ref EditorPrimitives);
|
||||
|
||||
@@ -136,9 +136,9 @@ namespace FlaxEditor.Windows
|
||||
{
|
||||
"Used third party software:",
|
||||
"",
|
||||
"Mono Project - www.mono-project.com",
|
||||
#if USE_NETCORE
|
||||
".NET - www.dotnet.microsoft.com",
|
||||
"Mono Project - www.mono-project.com",
|
||||
#endif
|
||||
#if PLATFORM_SDL
|
||||
"Simple DirectMedia Layer - www.libsdl.org",
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
var materialInstance = proxy.Window?.Asset;
|
||||
if (materialInstance == null)
|
||||
{
|
||||
layout.Label("No parameters");
|
||||
layout.Label("No parameters", TextAlignment.Center);
|
||||
return;
|
||||
}
|
||||
if (!materialInstance.IsLoaded || (materialInstance.BaseMaterial && !materialInstance.BaseMaterial.IsLoaded))
|
||||
@@ -246,7 +246,10 @@ namespace FlaxEditor.Windows.Assets
|
||||
base.Initialize(layout);
|
||||
|
||||
if (parameters.Length == 0)
|
||||
{
|
||||
layout.Label("No parameters", TextAlignment.Center);
|
||||
return;
|
||||
}
|
||||
|
||||
var parametersGroup = SurfaceUtils.InitGraphParametersGroup(layout);
|
||||
var settingButton = parametersGroup.AddSettingsButton();
|
||||
|
||||
@@ -502,7 +502,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
{
|
||||
Name = $"{name} (in {member.DeclaringType.Name})",
|
||||
TooltipText = Editor.Instance.CodeDocs.GetTooltip(member),
|
||||
Tag = new object[] { name, parameters.Length, Utils.GetEmptyArray<byte>() },
|
||||
Tag = new object[] { name, parameters.Length, Array.Empty<byte>() },
|
||||
// Do some basic sorting based on if the method is defined directly in the script base class
|
||||
SortScore = member.DeclaringType == member.Type.ReflectedType ? 1 : 0,
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace FlaxEditor.Windows.Profiler
|
||||
{
|
||||
Title = "Draw (GPU)",
|
||||
AnchorPreset = AnchorPresets.HorizontalStretchTop,
|
||||
Offsets = new Margin(0, 0, _drawTimeCPU.Height + 2, 0),
|
||||
Offsets = new Margin(0, 0, _drawTimeCPU.Height + 2, SingleChart.DefaultHeight),
|
||||
FormatSample = v => (Mathf.RoundToInt(v * 10.0f) / 10.0f) + " ms",
|
||||
Parent = mainPanel,
|
||||
};
|
||||
|
||||
@@ -559,7 +559,7 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
public LinearCurve()
|
||||
{
|
||||
Keyframes = Utils.GetEmptyArray<Keyframe>();
|
||||
Keyframes = Array.Empty<Keyframe>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -655,7 +655,7 @@ namespace FlaxEngine
|
||||
if (end - start <= Mathf.Epsilon)
|
||||
{
|
||||
// Erase the curve
|
||||
Keyframes = Utils.GetEmptyArray<Keyframe>();
|
||||
Keyframes = Array.Empty<Keyframe>();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -866,7 +866,7 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
public BezierCurve()
|
||||
{
|
||||
Keyframes = Utils.GetEmptyArray<Keyframe>();
|
||||
Keyframes = Array.Empty<Keyframe>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -970,7 +970,7 @@ namespace FlaxEngine
|
||||
if (end - start <= Mathf.Epsilon)
|
||||
{
|
||||
// Erase the curve
|
||||
Keyframes = Utils.GetEmptyArray<Keyframe>();
|
||||
Keyframes = Array.Empty<Keyframe>();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,13 +79,6 @@ DEFINE_INTERNAL_CALL(AnimGraphImpulse*) AnimGraphInternal_GetOutputImpulseData(I
|
||||
|
||||
#endif
|
||||
|
||||
void AnimGraphExecutor::initRuntime()
|
||||
{
|
||||
ADD_INTERNAL_CALL("FlaxEngine.AnimationGraph::Internal_HasConnection", &AnimGraphInternal_HasConnection);
|
||||
ADD_INTERNAL_CALL("FlaxEngine.AnimationGraph::Internal_GetInputValue", &AnimGraphInternal_GetInputValue);
|
||||
ADD_INTERNAL_CALL("FlaxEngine.AnimationGraph::Internal_GetOutputImpulseData", &AnimGraphInternal_GetOutputImpulseData);
|
||||
}
|
||||
|
||||
void AnimGraphExecutor::ProcessGroupCustom(Box* boxBase, Node* nodeBase, Value& value)
|
||||
{
|
||||
#if USE_CSHARP
|
||||
|
||||
@@ -813,11 +813,6 @@ private:
|
||||
static ThreadLocal<AnimGraphContext*> Context;
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// Initializes the managed runtime calls.
|
||||
/// </summary>
|
||||
static void initRuntime();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AnimGraphExecutor"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -430,6 +430,9 @@ void Asset::Reload()
|
||||
|
||||
ScopeLock lock(Locker);
|
||||
|
||||
// Cancel any still-running loading task (e.g. if WaitForLoaded timed out)
|
||||
Platform::AtomicStore(&_loadingTask, 0);
|
||||
|
||||
if (IsLoaded())
|
||||
{
|
||||
// Unload current data
|
||||
@@ -612,6 +615,13 @@ bool Asset::onLoad(LoadAssetTask* task)
|
||||
|
||||
Locker.Lock();
|
||||
|
||||
// Re-check after acquiring lock (loading task may have been cleared by Reload, or replaced by a new task)
|
||||
if (Platform::AtomicRead(&_loadingTask) == 0)
|
||||
{
|
||||
Locker.Unlock();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Load asset
|
||||
LoadResult result;
|
||||
#if USE_EDITOR
|
||||
|
||||
@@ -101,9 +101,9 @@ bool Material::CanUseLightmap() const
|
||||
return _materialShader && _materialShader->CanUseLightmap();
|
||||
}
|
||||
|
||||
bool Material::CanUseInstancing(InstancingHandler& handler) const
|
||||
bool Material::CanUseInstancing(const RenderContext& renderContext, InstancingHandler& handler) const
|
||||
{
|
||||
return _materialShader && _materialShader->CanUseInstancing(handler);
|
||||
return _materialShader && _materialShader->CanUseInstancing(renderContext, handler);
|
||||
}
|
||||
|
||||
void Material::Bind(BindParameters& params)
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
bool IsReady() const override;
|
||||
DrawPass GetDrawModes() const override;
|
||||
bool CanUseLightmap() const override;
|
||||
bool CanUseInstancing(InstancingHandler& handler) const override;
|
||||
bool CanUseInstancing(const RenderContext& renderContext, InstancingHandler& handler) const override;
|
||||
void Bind(BindParameters& params) override;
|
||||
|
||||
// [ShaderAssetBase]
|
||||
|
||||
@@ -168,9 +168,9 @@ bool MaterialInstance::CanUseLightmap() const
|
||||
return _baseMaterial && _baseMaterial->CanUseLightmap();
|
||||
}
|
||||
|
||||
bool MaterialInstance::CanUseInstancing(InstancingHandler& handler) const
|
||||
bool MaterialInstance::CanUseInstancing(const RenderContext& renderContext, InstancingHandler& handler) const
|
||||
{
|
||||
return _baseMaterial && _baseMaterial->CanUseInstancing(handler);
|
||||
return _baseMaterial && _baseMaterial->CanUseInstancing(renderContext, handler);
|
||||
}
|
||||
|
||||
void MaterialInstance::Bind(BindParameters& params)
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
bool IsReady() const override;
|
||||
DrawPass GetDrawModes() const override;
|
||||
bool CanUseLightmap() const override;
|
||||
bool CanUseInstancing(InstancingHandler& handler) const override;
|
||||
bool CanUseInstancing(const RenderContext& renderContext, InstancingHandler& handler) const override;
|
||||
void Bind(BindParameters& params) override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -27,6 +27,17 @@ API_STRUCT(NoDefault) struct FLAXENGINE_API SceneReference
|
||||
{
|
||||
return ID != other.ID;
|
||||
}
|
||||
|
||||
FORCE_INLINE SceneReference& operator=(const Guid& id)
|
||||
{
|
||||
ID = id;
|
||||
return *this;
|
||||
}
|
||||
|
||||
FORCE_INLINE operator Guid() const
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "Engine/Level/Types.h"
|
||||
#include "Engine/Debug/Exceptions/JsonParseException.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
#include "Engine/Profiler/ProfilerMemory.h"
|
||||
#if USE_EDITOR
|
||||
#include "Engine/Core/Collections/HashSet.h"
|
||||
#include "Engine/Core/Collections/Dictionary.h"
|
||||
@@ -20,17 +21,66 @@ bool JsonStorageProxy::IsValidExtension(const StringView& extension)
|
||||
return extension == DEFAULT_SCENE_EXTENSION || extension == DEFAULT_PREFAB_EXTENSION || extension == DEFAULT_JSON_EXTENSION;
|
||||
}
|
||||
|
||||
StringAnsiView ParseJsonString(const StringAnsiView& json, int32 start)
|
||||
{
|
||||
while (start < json.Length() && json[start] != '\"')
|
||||
start++;
|
||||
int32 end = start + 1;
|
||||
while (end < json.Length() && json[end] != '\"')
|
||||
end++;
|
||||
return json.Substring(start + 1, end - start - 1);
|
||||
}
|
||||
|
||||
bool JsonStorageProxy::GetAssetInfo(const StringView& path, Guid& resultId, String& resultDataTypeName)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
// TODO: we could just open file and start reading until we find 'ID:..' without parsing whole file - could be much more faster
|
||||
PROFILE_MEM(Content);
|
||||
ZoneText(*path, path.Length());
|
||||
|
||||
// Read the first part of the file to get asset metadata (ID and TypeName)
|
||||
auto file = File::Open(path, FileMode::OpenExisting, FileAccess::Read, FileShare::All);
|
||||
if (!file)
|
||||
return false;
|
||||
Array<byte> fileData;
|
||||
fileData.Resize(256);
|
||||
uint32 read = 0;
|
||||
file->Read(fileData.Get(), fileData.Count(), &read);
|
||||
Delete(file);
|
||||
file = nullptr;
|
||||
if (read != 0)
|
||||
{
|
||||
// Naive Json parsing to get ID and TypeName without full parsing
|
||||
StringAnsiView json((const char*)fileData.Get(), read);
|
||||
StringAnsiView idStart("\"ID\": ");
|
||||
StringAnsiView typenameStart("\"TypeName\": ");
|
||||
bool hasOneOfThem = false;
|
||||
for (int32 i = 0; i < json.Length() - 7; i++)
|
||||
{
|
||||
if (json.Substring(i).StartsWith(idStart))
|
||||
{
|
||||
StringAnsiView value = ParseJsonString(json, i + idStart.Length());
|
||||
if (Guid::Parse(value, resultId))
|
||||
continue;
|
||||
if (hasOneOfThem)
|
||||
return true;
|
||||
hasOneOfThem = true;
|
||||
i += value.Length() + idStart.Length() + 2;
|
||||
}
|
||||
if (json.Substring(i).StartsWith(typenameStart))
|
||||
{
|
||||
StringAnsiView value = ParseJsonString(json, i + typenameStart.Length());
|
||||
resultDataTypeName = String(value);
|
||||
if (hasOneOfThem)
|
||||
return true;
|
||||
hasOneOfThem = true;
|
||||
i += value.Length() + typenameStart.Length() + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Load file
|
||||
Array<byte> fileData;
|
||||
if (File::ReadAllBytes(path, fileData))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Parse data
|
||||
rapidjson_flax::Document document;
|
||||
@@ -89,11 +139,8 @@ void FindObjectIds(const rapidjson_flax::Value& obj, const rapidjson_flax::Docum
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool JsonStorageProxy::ChangeId(const StringView& path, const Guid& newId)
|
||||
{
|
||||
#if USE_EDITOR
|
||||
PROFILE_CPU();
|
||||
|
||||
// Load file
|
||||
@@ -140,8 +187,6 @@ bool JsonStorageProxy::ChangeId(const StringView& path, const Guid& newId)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
#else
|
||||
LOG(Warning, "Editing cooked content is invalid.");
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
/// <returns>True if found any asset, otherwise false.</returns>
|
||||
static bool GetAssetInfo(const StringView& path, Guid& resultId, String& resultDataTypeName);
|
||||
|
||||
#if USE_EDITOR
|
||||
/// <summary>
|
||||
/// Changes asset ID.
|
||||
/// </summary>
|
||||
@@ -37,4 +38,5 @@ public:
|
||||
/// <param name="newId">Asset ID to set</param>
|
||||
/// <returns>True if found any asset, otherwise false.</returns>
|
||||
static bool ChangeId(const StringView& path, const Guid& newId);
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -113,6 +113,8 @@ CreateAssetContext::CreateAssetContext(const StringView& inputPath, const String
|
||||
|
||||
CreateAssetResult CreateAssetContext::Run(const CreateAssetFunction& callback)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
PROFILE_MEM(Content);
|
||||
ASSERT(callback.IsBinded());
|
||||
|
||||
// Call action
|
||||
@@ -207,6 +209,9 @@ void CreateAssetContext::AddMeta(JsonWriter& writer) const
|
||||
|
||||
void CreateAssetContext::ApplyChanges()
|
||||
{
|
||||
PROFILE_CPU();
|
||||
PROFILE_MEM(Content);
|
||||
|
||||
// Get access
|
||||
auto storage = ContentStorageManager::TryGetStorage(TargetAssetPath);
|
||||
if (storage && storage->IsLoaded())
|
||||
@@ -274,6 +279,8 @@ bool AssetsImportingManager::Create(const String& tag, const StringView& outputP
|
||||
|
||||
bool AssetsImportingManager::Import(const StringView& inputPath, const StringView& outputPath, Guid& assetId, void* arg)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
PROFILE_MEM(Content);
|
||||
LOG(Info, "Importing file '{0}' to '{1}'...", inputPath, outputPath);
|
||||
|
||||
// Check if input file exists
|
||||
@@ -347,6 +354,7 @@ String AssetsImportingManager::GetImportPath(const String& path)
|
||||
bool AssetsImportingManager::Create(const Function<CreateAssetResult(CreateAssetContext&)>& callback, const StringView& inputPath, const StringView& outputPath, Guid& assetId, void* arg)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
PROFILE_MEM(Content);
|
||||
ZoneText(*outputPath, outputPath.Length());
|
||||
const auto startTime = Platform::GetTimeSeconds();
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace FlaxEngine.Collections
|
||||
public T[] ToArray()
|
||||
{
|
||||
if (Count == 0)
|
||||
return Utils.GetEmptyArray<T>();
|
||||
return Array.Empty<T>();
|
||||
|
||||
var result = new T[Count];
|
||||
if (_backItem > _frontItem)
|
||||
|
||||
@@ -44,12 +44,32 @@ public:
|
||||
IMPLEMENT_ENGINE_SETTINGS_GETTER(BuildSettings, GameCooking);
|
||||
|
||||
#include "Engine/Content/Deprecated.h"
|
||||
|
||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS;
|
||||
|
||||
bool GraphicsSettings::GetUeeHDRProbes() const
|
||||
{
|
||||
return UseHDRProbes;
|
||||
}
|
||||
|
||||
void GraphicsSettings::SetUeeHDRProbes(bool value)
|
||||
{
|
||||
MARK_CONTENT_DEPRECATED();
|
||||
UseHDRProbes = value;
|
||||
DefaultProbeCubemapFormat = value ? ProbeCubemapFormats::R11G11B10 : ProbeCubemapFormats::R8G8B8A8;
|
||||
}
|
||||
|
||||
bool GraphicsSettings::GetUseHDRProbes() const
|
||||
{
|
||||
return UseHDRProbes;
|
||||
}
|
||||
|
||||
void GraphicsSettings::SetUseHDRProbes(bool value)
|
||||
{
|
||||
DefaultProbeCubemapFormat = value ? ProbeCubemapFormats::R11G11B10 : ProbeCubemapFormats::R8G8B8A8;
|
||||
}
|
||||
|
||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS;
|
||||
|
||||
void GraphicsSettings::OnDeserializing(const CallbackContext& context)
|
||||
{
|
||||
#if 0 // TODO: move to Linear color space as default once it's ready for production
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user