Skip to content

Commit

Permalink
chore: Update minimal supported Unity version to 2021.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawid Sygocki committed Jul 3, 2023
1 parent f3895e8 commit 2585a1e
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 152 deletions.
2 changes: 0 additions & 2 deletions Editor/Tools/NetworkedSimulationAnalyzer/ReplayFileManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if UNITY_2020_2_OR_NEWER
using System.IO;
using System.Linq;
using System;
Expand Down Expand Up @@ -137,4 +136,3 @@ private static bool DeserializeServerData(BinaryReader br, TickListDisplayer tic
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if UNITY_2020_2_OR_NEWER
using System;
using System;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
Expand Down Expand Up @@ -30,7 +29,7 @@ internal ServerAnalyzerController(VisualElement root)
// pause toggle setup
_pauseToggle = root.Q<ToolbarToggle>("pause-control");
// because used element template contains useless element which have to be disabled - it takes up space!
_pauseToggle.Q<VisualElement>(classes: "unity-toggle__input").style.display = DisplayStyle.None;
_pauseToggle.Q<VisualElement>(classes: "unity-toggle__input").style.display = DisplayStyle.None;
_pauseToggle.SetEnabled(EditorApplication.isPlaying);
_pauseToggle.RegisterValueChangedCallback(valueChangedEvent =>
{
Expand Down Expand Up @@ -70,7 +69,7 @@ internal ServerAnalyzerController(VisualElement root)
};

_helpLink = root.Q<Label>("help-control");
_helpLink.RegisterCallback<MouseDownEvent> (e =>
_helpLink.RegisterCallback<MouseDownEvent> (e =>
{
Application.OpenURL("https://docs.elympics.cc/testing-troubleshooting/networked-simulation-analyzer/");
});
Expand Down Expand Up @@ -181,4 +180,3 @@ internal void ApplyLatestTickIfNeeded(bool force = false, bool reloadedPreLoadSt
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if UNITY_2020_2_OR_NEWER
using UnityEngine;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEditor;
using System.Collections.Generic;
Expand All @@ -21,8 +20,8 @@ public class ServerAnalyzerEditor : EditorWindow, ITickAnalysis
private TickListDisplayer _tickListDisplayer = null;
private TickDataDisplayer _tickDataDisplayer = null;
private ServerAnalyzerController _serverAnalyzerController = null;
// TODO: find better way because its a bit dirty (maybe use change event from ElympicsConfig)

// TODO: find better way because its a bit dirty (maybe use change event from ElympicsConfig)
private bool closedForcefully = false;

public bool Paused => _serverAnalyzerController?.Paused ?? false;
Expand Down Expand Up @@ -94,4 +93,3 @@ public void AddSnapshotToAnalysis(ElympicsSnapshotWithMetadata snapshot, List<El
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if UNITY_2020_2_OR_NEWER
using UnityEngine;

namespace Elympics
Expand Down Expand Up @@ -39,4 +38,3 @@ public static string FormatFloatMilliseconds(float value)
}
}
}
#endif
2 changes: 0 additions & 2 deletions Editor/Tools/NetworkedSimulationAnalyzer/TickDataDisplayer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if UNITY_2020_2_OR_NEWER
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -152,4 +151,3 @@ private int SizeOfNetworkData(KeyValuePair<int, byte[]> item)
}
}
}
#endif
2 changes: 0 additions & 2 deletions Editor/Tools/NetworkedSimulationAnalyzer/TickEntryData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if UNITY_2020_2_OR_NEWER
using System.Collections.Generic;
using UnityEngine;

Expand Down Expand Up @@ -54,4 +53,3 @@ internal InputInfo(ElympicsSnapshotWithMetadata snapshot, int i)
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if UNITY_2020_2_OR_NEWER
using UnityEngine.UIElements;

namespace Elympics
Expand Down Expand Up @@ -28,4 +27,3 @@ internal void SetTickEntryData(TickEntryData tickEntryData)
}
}
}
#endif
14 changes: 0 additions & 14 deletions Editor/Tools/NetworkedSimulationAnalyzer/TickListDisplayer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if UNITY_2020_2_OR_NEWER
using System.Collections.Generic;
using UnityEngine.UIElements;

Expand Down Expand Up @@ -34,11 +33,7 @@ internal TickListDisplayer(VisualElement root, VisualTreeAsset tickEntryTemplate
private void InitializeTickList(VisualTreeAsset listEntryTemplate)
{
// Ensure proper displaying
#if UNITY_2021_2_OR_NEWER
_tickList.Q<ScrollView>().horizontalScrollerVisibility = ScrollerVisibility.Hidden;
#else
_tickList.Q<ScrollView>().showHorizontal = false;
#endif

// Set up a make item function for a list entry
_tickList.makeItem = () =>
Expand Down Expand Up @@ -70,25 +65,16 @@ private void InitializeTickList(VisualTreeAsset listEntryTemplate)
_tickList.itemsSource = _allTicksData;

// Set up list properties
#if UNITY_2021_2_OR_NEWER
_tickList.fixedItemHeight = TickEntryHeight;
_tickList.Q<ScrollView>().verticalScrollerVisibility = ScrollerVisibility.AlwaysVisible;
#else
_tickList.itemHeight = TickEntryHeight;
#endif
}

internal void AddTick(ElympicsSnapshotWithMetadata snapshot)
{
_allTicksData.Add(new TickEntryData(snapshot, _tickDataDisplayer.IsBots.Length));

// Refresh list visual state
#if UNITY_2021_2_OR_NEWER
_tickList.RefreshItems();
#else
_tickList.Refresh();
#endif
}
}
}
#endif
4 changes: 0 additions & 4 deletions Runtime/BehaviourPredefined/ElympicsUnityPhysicsSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ public void Initialize()
_currentPhysicsScene2D = currentScene.GetPhysicsScene2D();

Physics.autoSimulation = false;
#if UNITY_2020_1_OR_NEWER
Physics2D.simulationMode = SimulationMode2D.Script;
#else
Physics2D.autoSimulation = false;
#endif
}

public void ElympicsUpdate()
Expand Down
13 changes: 13 additions & 0 deletions Runtime/GameEngine/Libraries/GameEngineCore.dll.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
93 changes: 0 additions & 93 deletions Runtime/GameEngine/Libraries/UnityConnectors-packed2.0.dll.meta

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions Runtime/Tools/BuildTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ public static class BuildTools
@"build target (was )?unsupported|LinuxStandalone|scripting backend (\(\w+\) )?(is )?not installed",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
private const string MissingModuleErrorMessage =
#if UNITY_2021_2_OR_NEWER
"Installation of Unity modules is required: Linux Build Support (Mono) and Linux Dedicated Server Build Support";
#else
"Installation of Unity module is required: Linux Build Support (Mono)";
#endif

public static void UpdateElympicsGameVersion(string newGameVersion)
{
Expand Down Expand Up @@ -111,12 +107,8 @@ private static bool BuildServer(string appName, BuildTarget target)
locationPathName = Path.Combine(ServerBuildPath, EngineSubdirectory, UnityBuildPath, appName),
targetGroup = buildTargetGroup,
target = target,
#if UNITY_2021_2_OR_NEWER
subtarget = (int)StandaloneBuildSubtarget.Server,
options = BuildOptions.CompressWithLz4HC
#else
options = BuildOptions.EnableHeadlessMode | BuildOptions.CompressWithLz4HC
#endif
options = BuildOptions.CompressWithLz4HC,
};

var report = BuildPipeline.BuildPlayer(buildPlayerOptions);
Expand Down
8 changes: 0 additions & 8 deletions Runtime/Util/UnityWebRequestExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,12 @@ public static class UnityWebRequestExtension
{
public static bool IsConnectionError(this UnityWebRequest request)
{
#if UNITY_2020_2_OR_NEWER
return request != null && request.result == UnityWebRequest.Result.ConnectionError;
#else
return request != null && request.isNetworkError;
#endif
}

public static bool IsProtocolError(this UnityWebRequest request)
{
#if UNITY_2020_2_OR_NEWER
return request != null && request.result == UnityWebRequest.Result.ProtocolError;
#else
return request != null && request.isHttpError;
#endif
}

public static void SetTestCertificateHandlerIfNeeded(this UnityWebRequest request)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.7.3",
"description": "Elympics is a complete toolset for multiplayer games. Learn more at https://elympics.cc/",
"displayName": "Elympics",
"unity": "2019.4",
"unity": "2021.3",
"author": {
"name": "Elympics",
"email": "hello@elympics.cc",
Expand Down Expand Up @@ -59,4 +59,4 @@
"interactiveImport": true
}
]
}
}

0 comments on commit 2585a1e

Please sign in to comment.