Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
f65552c
Add ui components lib from MAPCO-8663
geneg Oct 9, 2025
0cf111b
install NuGet for unity
geneg Oct 9, 2025
e74d539
Add R3 Reactive Lib
geneg Oct 9, 2025
75ac0c0
Add Redux lib
geneg Oct 9, 2025
caaffc7
add
geneg Oct 22, 2025
ba71d44
WIP on feature/MAPCO-7262-Configuration-Manager-Offline-Mode
geneg Oct 27, 2025
cf4f7a0
add
EvgenyGir Oct 27, 2025
ba78140
add redux config
EvgenyGir Oct 28, 2025
ac42d4a
add redux config slice
EvgenyGir Oct 28, 2025
3e400e6
Merge branch 'master' into feature/MAPCO-7262-Configuration-Manager-O…
geneg Oct 28, 2025
99e69cb
fix explicit type
EvgenyGir Oct 29, 2025
80f0266
add app settings slice
EvgenyGir Oct 29, 2025
4a22626
Merge branch 'refs/heads/master' into feature/MAPCO-7262-Configuratio…
EvgenyGir Oct 29, 2025
7c58f6c
format fix
geneg Oct 30, 2025
ad82b1a
add actions classes
geneg Nov 2, 2025
7bead84
fix
geneg Nov 2, 2025
839b3bc
add user settings
geneg Nov 2, 2025
3e1004d
Merge branch 'master' into feature/MAPCO-7262-Configuration-Manager-O…
EvgenyGir Nov 3, 2025
7655cb1
merge format
EvgenyGir Nov 3, 2025
509bfc4
fixes
EvgenyGir Nov 3, 2025
6a24b88
add fields to state
EvgenyGir Nov 3, 2025
ea6bc38
merge fileutility and jsonloader
EvgenyGir Nov 3, 2025
93003d1
save state
EvgenyGir Nov 3, 2025
d8d36c4
unsubsribe
EvgenyGir Nov 3, 2025
f455b64
temp code
Nov 3, 2025
87e70a2
set add actions
EvgenyGir Nov 4, 2025
a018976
update
geneg Nov 5, 2025
eaa871a
Add R3 to Redux
geneg Nov 5, 2025
0012069
add functions for state change without selector
geneg Nov 5, 2025
9fa9ee9
add demo code
geneg Nov 5, 2025
1a07c1d
fix
geneg Nov 5, 2025
898ee62
clean
geneg Nov 5, 2025
1c88d8d
Merge branch 'master' into feature/MAPCO-7262-Configuration-Manager-O…
geneg Nov 5, 2025
8969c13
fix ref
geneg Nov 5, 2025
a331afd
add epics middleware
geneg Nov 6, 2025
81b8b6b
add helper functions
geneg Nov 6, 2025
0913048
epics
EvgenyGir Nov 11, 2025
90ff3a6
last
EvgenyGir Nov 11, 2025
9f35943
Revert "last"
EvgenyGir Nov 13, 2025
7eba1ce
Revert "epics"
EvgenyGir Nov 13, 2025
4427201
Revert "add helper functions"
EvgenyGir Nov 13, 2025
ea50dbc
Revert "add epics middleware"
EvgenyGir Nov 13, 2025
401bd39
workspaces
EvgenyGir Nov 13, 2025
c8e0ce3
separate json from file
geneg Nov 16, 2025
5ee785b
add workspaces
geneg Nov 16, 2025
8c21636
add workspaces
geneg Nov 16, 2025
7a65e12
Merge branch 'master' into feature/MAPCO-7262-Configuration-Manager-O…
geneg Nov 16, 2025
0612dd9
fix
geneg Nov 16, 2025
388693d
add middleware
geneg Nov 16, 2025
52610d1
format fix
EvgenyGir Nov 17, 2025
5f11446
fix
EvgenyGir Nov 17, 2025
cf845a7
change state to record
geneg Nov 18, 2025
8b84cd2
Merge remote-tracking branch 'origin/feature/MAPCO-7262-Configuration…
geneg Nov 18, 2025
096c5e6
change names
geneg Nov 18, 2025
3406001
changes
geneg Nov 18, 2025
5cd4dd0
changes
geneg Nov 18, 2025
784a789
changes
geneg Nov 18, 2025
cb42a4e
changes
geneg Nov 18, 2025
d933849
Merge branch 'master' into feature/MAPCO-7262-Configuration-Manager-O…
EvgenyGir Nov 19, 2025
9caebcf
fix
EvgenyGir Nov 19, 2025
04db2d2
fix
EvgenyGir Nov 19, 2025
50c5cee
change
EvgenyGir Nov 19, 2025
de84f71
Merge branch 'master' into feature/MAPCO-7262-Configuration-Manager-O…
EvgenyGir Nov 19, 2025
1fe1d55
Fix null ref bug
geneg Nov 20, 2025
bdcb499
add logs (#33)
baruchInsert-tech Nov 20, 2025
44177f9
add datamanagement folder
geneg Nov 20, 2025
1d64ca5
update test and build
geneg Nov 20, 2025
d54105e
Merge branch 'master' into feature/MAPCO-7262-Configuration-Manager-O…
geneg Nov 20, 2025
e091e20
update test and build
geneg Nov 20, 2025
fbc974d
remove tests
geneg Nov 20, 2025
87ebec9
move rsp
geneg Nov 20, 2025
e5e9c4d
remove rsp
geneg Nov 20, 2025
a334944
change gitignore
geneg Nov 20, 2025
8666539
remove packages.meta
geneg Nov 20, 2025
d45dec0
modify yaml
baruchInsert-tech Nov 23, 2025
b54ada4
modify yaml
baruchInsert-tech Nov 23, 2025
017445e
modify yaml
baruchInsert-tech Nov 23, 2025
b7e1320
modify yaml
baruchInsert-tech Nov 23, 2025
f5de997
modify yaml
baruchInsert-tech Nov 23, 2025
09b110f
add packages
baruchInsert-tech Nov 23, 2025
f275b5a
modify file
baruchInsert-tech Nov 23, 2025
1e8bc78
fix path
baruchInsert-tech Nov 23, 2025
04e00fe
test - remove packages from git ignore
baruchInsert-tech Nov 23, 2025
11c85b7
Revert "test - remove packages from git ignore"
baruchInsert-tech Nov 23, 2025
c2f736e
test- remove temp
baruchInsert-tech Nov 23, 2025
d822a33
Revert "test- remove temp"
baruchInsert-tech Nov 23, 2025
f454045
Revert "remove rsp"
EvgenyGir Nov 24, 2025
85ad47c
test v4
EvgenyGir Nov 24, 2025
7220695
test
EvgenyGir Nov 24, 2025
b5af15f
test
EvgenyGir Nov 24, 2025
8531157
test
EvgenyGir Nov 24, 2025
e31025c
test
EvgenyGir Nov 24, 2025
87e9b0f
test
EvgenyGir Nov 24, 2025
4d31485
feat: Scene Switching and preloader fix (MAPCO-8897) (#38)
geneg Nov 25, 2025
9077ef1
Merge branch 'master' into feature/MAPCO-7262-Configuration-Manager-O…
geneg Nov 25, 2025
0935e9c
Merge remote-tracking branch 'origin/feature/MAPCO-7262-Configuration…
geneg Nov 25, 2025
1103914
restore test and build yaml from main
geneg Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

format_check:
uses: ./.github/workflows/format.yaml

test:
name: Run Unity Tests
needs: [checklicense, format_check]
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- uses: ./.github/actions/nugetforunity-restore
with:
working-directory: .

# Build project.
- uses: game-ci/unity-builder@v4
env:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,7 @@ InitTestScene*.unity*
# Auto-generated scenes by play mode tests
/[Aa]ssets/[Ii]nit[Tt]est[Ss]cene*.unity*

# NuGet Packages
/[Aa]ssets/Packages
/[Aa]ssets/Packages.meta
/[Aa]ssets/Packages.meta

8 changes: 8 additions & 0 deletions Assets/AddressableAssetsData/Windows.meta

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

15 changes: 7 additions & 8 deletions Assets/PlayModeTests/Utilities/FileUtilityPlayModeTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections;
using System.IO;
using System.Threading.Tasks;
using com.mapcolonies.core.Utilities;
using Cysharp.Threading.Tasks;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
Expand All @@ -11,17 +11,16 @@ namespace PlayModeTests.Utilities
{
public class FileUtilityPlayModeTests
{
private static IEnumerator Await(Task t)
private static async UniTask Await(UniTask t)
{
while (!t.IsCompleted) yield return null;
if (t.IsFaulted) throw t.Exception;
await t;
}

[UnityTest]
public IEnumerator SetupFilePath_Creates_Directory_And_FilePath()
{
var dirName = "FileUtility_Setup";
var path = FileUtility.GetFullPath(dirName, "minimal.log");
var path = FileIOUtility.GetFullPath(dirName, "minimal.log");

Assert.IsNotNull(path);
Assert.IsTrue(Directory.Exists(Path.Combine(Application.persistentDataPath, dirName)), "Directory should be created");
Expand All @@ -32,10 +31,10 @@ public IEnumerator SetupFilePath_Creates_Directory_And_FilePath()
[UnityTest]
public IEnumerator Append_Writes_Single_Line()
{
var dir = FileUtility.GetFullPath("FileUtility_Append");
var dir = FileIOUtility.GetFullPath("FileUtility_Append");
var file = Path.Combine(dir, $"session-{Guid.NewGuid():N}.log");

yield return Await(FileUtility.AppendLineToFileAsync("hello", file));
yield return Await(FileIOUtility.AppendLineToFileAsync("hello", file));

Assert.IsTrue(File.Exists(file), "File should be created");
StringAssert.Contains("hello", File.ReadAllText(file));
Expand All @@ -54,7 +53,7 @@ public IEnumerator Append_Skips_When_FilePath_Null()
}

string nullPath = null;
yield return Await(FileUtility.AppendLineToFileAsync("ignored", nullPath));
yield return Await(FileIOUtility.AppendLineToFileAsync("ignored", nullPath));

Assert.IsFalse(Directory.Exists(dir), "Directory should not be created when path is null");
yield return null;
Expand Down
6 changes: 3 additions & 3 deletions Assets/Scenes/MainAppScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -464,19 +464,19 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6106143874565215203, guid: c6e6123243f885144bd66074063abc03, type: 3}
propertyPath: m_LocalRotation.y
value: 7.230792e-18
value: 7.260869e-18
objectReference: {fileID: 0}
- target: {fileID: 6106143874565215203, guid: c6e6123243f885144bd66074063abc03, type: 3}
propertyPath: m_LocalRotation.z
value: 9.279935e-19
value: 9.02991e-19
objectReference: {fileID: 0}
- target: {fileID: 7591503138926735995, guid: c6e6123243f885144bd66074063abc03, type: 3}
propertyPath: m_Name
value: CesiumGeoreference
objectReference: {fileID: 0}
- target: {fileID: 8800104130311657506, guid: c6e6123243f885144bd66074063abc03, type: 3}
propertyPath: _localToGlobeFixedMatrix.c0.z
value: -9.934400909822153e-18
value: -0.000000000000000010012625101410276
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
Expand Down
6 changes: 3 additions & 3 deletions Assets/StreamingAssets.meta

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

3 changes: 3 additions & 0 deletions Assets/StreamingAssets/DataManagement.meta

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

6 changes: 6 additions & 0 deletions Assets/StreamingAssets/DataManagement/app_settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"userSettingsFile": "DataManagement/UserSettings/user_settings.json",
"offlineConfigurationFile": "DataManagement/offline_config.json",
"workspacesDirectory": "DataManagement/workspaces",
"remoteConfigurationUrl": "https://example.com/config/getConfig?v=10"
}
3 changes: 3 additions & 0 deletions Assets/StreamingAssets/DataManagement/app_settings.json.meta

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

3 changes: 3 additions & 0 deletions Assets/StreamingAssets/DataManagement/offline_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"url": "https://www.google.com"
}

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

24 changes: 20 additions & 4 deletions Assets/com.mapcolonies.core/BaseMvvmView.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using R3;
using UnityEngine;
using UnityEngine.UIElements;
using VContainer;
Expand All @@ -7,7 +8,17 @@ namespace com.mapcolonies.core
[RequireComponent(typeof(UIDocument))]
public abstract class BaseMvvmView<T> : MonoBehaviour where T : class
{
private T _viewModel;
protected CompositeDisposable Disposables
{
get;
} = new CompositeDisposable();

protected T ViewModel
{
get;
private set;
}

[SerializeField] private UIDocument _uiDocument;

protected VisualElement RootVisualElement
Expand All @@ -20,15 +31,20 @@ protected VisualElement RootVisualElement
public void Construct(T viewModel)
{
Debug.Log($"Construct view for {typeof(T)}");
_viewModel = viewModel;
ViewModel = viewModel;
}

private void OnEnable()
{
if (_viewModel == null) return;
if (ViewModel == null) return;

RootVisualElement = _uiDocument.rootVisualElement;
RootVisualElement.dataSource = _viewModel;
RootVisualElement.dataSource = ViewModel;
}

private void OnDestroy()
{
Disposables.Dispose();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void Initialize()

private void SetupLogFile()
{
_logFilePath = FileUtility.GetFullPath(AnalyticsFileName, $"session-{SessionId}.log");
_logFilePath = FileIOUtility.GetFullPath(AnalyticsFileName, $"session-{SessionId}.log");
}

private async UniTask PublishAnalytics(LogObject logObject)
Expand Down Expand Up @@ -104,7 +104,7 @@ private async UniTask WriteLogToFileAsync(string logContent)

try
{
await FileUtility.AppendLineToFileAsync(logContent, _logFilePath);
await FileIOUtility.AppendLineToFileAsync(logContent, _logFilePath);
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using com.mapcolonies.core.Services.Analytics.Enums;
using com.mapcolonies.core.Services.Analytics.Managers;
using UnityEngine;

namespace com.mapcolonies.core.Services.Analytics.Model
Expand Down
9 changes: 2 additions & 7 deletions Assets/com.mapcolonies.core/Utilities.meta

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

Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Cysharp.Threading.Tasks;
using UnityEngine;

namespace com.mapcolonies.core.Utilities
{
public class FileUtility
public class FileIOUtility
{
public static string GetFullPath(string folderName, string fileName = null)
{
Expand All @@ -22,7 +21,6 @@ public static string GetFullPath(string folderName, string fileName = null)

if (string.IsNullOrEmpty(fileName))
{
Debug.Log($"Directory ready: {directoryPath}");
return directoryPath;
}

Expand All @@ -37,7 +35,7 @@ public static string GetFullPath(string folderName, string fileName = null)
}
}

public static async Task AppendLineToFileAsync(string line, string filePath)
public static async UniTask AppendLineToFileAsync(string line, string filePath)
{
if (string.IsNullOrEmpty(filePath))
{
Expand All @@ -47,5 +45,29 @@ public static async Task AppendLineToFileAsync(string line, string filePath)

await File.AppendAllTextAsync(filePath, line + Environment.NewLine);
}

public static async UniTask<string> ReadTextFileAsync(string path)
{
if (!File.Exists(path))
throw new FileNotFoundException($"File not found: {path}");

using StreamReader reader = new StreamReader(path);
return await reader.ReadToEndAsync();
}

public static async UniTask WriteTextFileAsync(string path, string text)
{
string? directory = Path.GetDirectoryName(path);
if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))
Directory.CreateDirectory(directory);

await using StreamWriter writer = new StreamWriter(path, false);
await writer.WriteAsync(text);
}

public static async UniTask<bool> FileExistsAsync(string path)
{
return await UniTask.RunOnThreadPool(() => File.Exists(path));
}
}
}
89 changes: 89 additions & 0 deletions Assets/com.mapcolonies.core/Utilities/JsonUtilityEx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using System.IO;
using Cysharp.Threading.Tasks;
using Newtonsoft.Json;
using UnityEngine;
using UnityEngine.Networking;

namespace com.mapcolonies.core.Utilities
{
public enum FileLocation
{
StreamingAssets = 0,
PersistentData = 1
}

public static class JsonUtilityEx
{
public static async UniTask<T> FromJsonFileAsync<T>(string path)
{
string json = await FileIOUtility.ReadTextFileAsync(path);
return JsonConvert.DeserializeObject<T>(json);
}

public static async UniTask SaveJsonToFileAsync<T>(string path, T data)
{
string json = JsonConvert.SerializeObject(data, Formatting.Indented);
await FileIOUtility.WriteTextFileAsync(path, json);
}

public static async UniTask<T> LoadRemoteJsonAsync<T>(string url)
{
using UnityWebRequest request = UnityWebRequest.Get(url);
await request.SendWebRequest();

if (request.result != UnityWebRequest.Result.Success)
throw new IOException($"Failed to load remote JSON: {request.error}");

return JsonConvert.DeserializeObject<T>(request.downloadHandler.text);
}


public static async UniTask<T> LoadJsonAsync<T>(string relativePath, FileLocation location = FileLocation.StreamingAssets)
{
string path;

switch (location)
{
case FileLocation.PersistentData:
path = Path.Combine(Application.persistentDataPath, relativePath);
break;
case FileLocation.StreamingAssets:
path = Path.Combine(Application.streamingAssetsPath, relativePath);
break;
default:
Debug.LogWarning($"Unknown file location {location}. Using streaming assets as default.");
path = Path.Combine(Application.streamingAssetsPath, relativePath);
break;
}

return await FromJsonFileAsync<T>(path);
}

public static async UniTask SaveJsonAsync<T>(string relativePath, T data)
{
string path = Path.Combine(Application.persistentDataPath, relativePath);
await SaveJsonToFileAsync(path, data);
}

public static async UniTask<bool> DoesJsonExistAsync(string relativePath, FileLocation location = FileLocation.PersistentData)
{
string path;

switch (location)
{
case FileLocation.PersistentData:
path = Path.Combine(Application.persistentDataPath, relativePath);
break;
case FileLocation.StreamingAssets:
path = Path.Combine(Application.streamingAssetsPath, relativePath);
break;
default:
Debug.LogWarning($"Unknown file location {location}. Using persistent data as default.");
path = Path.Combine(Application.persistentDataPath, relativePath);
break;
}

return await FileIOUtility.FileExistsAsync(path);
}
}
}
3 changes: 3 additions & 0 deletions Assets/com.mapcolonies.core/Utilities/JsonUtilityEx.cs.meta

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

Loading
Loading