Partially restore Samples: Visitor Desktop & Start Site

This commit is contained in:
Pascal Serrarens 2022-01-28 15:04:55 +01:00
parent fce1d284f4
commit de2eb6188d
570 changed files with 23719 additions and 24793 deletions

View File

@ -20,33 +20,43 @@ namespace Passer {
}
protected virtual void InitializeSiteNames() {
HumanoidVisitors.CheckScenes();
List<string> humanoidVisitors = HumanoidVisitors.visitors;
EditorBuildSettingsScene[] editorBuildSettingsScenes = EditorBuildSettings.scenes;
int siteCount = editorBuildSettingsScenes.Length - HumanoidVisitors.visitors.Count;
int siteCount = editorBuildSettingsScenes.Length; // - HumanoidVisitors.visitors.Count;
List<string> siteList = new List<string>();
siteList.Add("-none-");
int j = 0;
for (int i = 0; i < siteCount; i++) {
if (!editorBuildSettingsScenes[j].enabled) {
j++;
if (!editorBuildSettingsScenes[i].enabled) {
continue;
}
string sceneName = editorBuildSettingsScenes[j].path;
string sceneName = editorBuildSettingsScenes[i].path;
int lastSlash = sceneName.LastIndexOf('/');
sceneName = sceneName.Substring(lastSlash + 1);
sceneName = sceneName.Substring(0, sceneName.Length - 6); // remove .unity
bool isVisitor = HumanoidVisitors.visitors.Contains(sceneName);
if (!isVisitor) {
//siteNames[i] = sceneName;
// Does not work at the moment the visitors are all scenes
//bool isVisitor = IsHumanoidVisitor(sceneName, humanoidVisitors);
//if (!isVisitor) {
siteList.Add(sceneName);
j++;
}
//}
}
siteNames = siteList.ToArray();//new string[siteCount];
}
private bool IsHumanoidVisitor(string sceneName, List<string> humanoidVisitors) {
foreach(string visitor in humanoidVisitors) {
int lastSlash = visitor.LastIndexOf('/');
string visitorSceneName = visitor.Substring(lastSlash + 1, visitor.Length - lastSlash - 7);
if (visitorSceneName == sceneName)
return true;
}
return false;
}
#endregion Enable
#region Inspector

View File

@ -180,6 +180,8 @@ namespace Passer.Humanoid {
private static string[] visitorNames;
private static bool VisitorSceneInspector() {
bool anyChanged = false;
HumanoidVisitors.CheckScenes();
if (HumanoidVisitors.visitors == null || HumanoidVisitors.visitors.Count <= 0)
return false;

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ namespace Passer {
if (humanoid == null) {
string visitorSceneName = HumanoidPreferences.visitorSceneName;
if (!string.IsNullOrEmpty(visitorSceneName)) {
Debug.Log(visitorSceneName);
//Debug.Log(visitorSceneName);
UnityEngine.SceneManagement.SceneManager.LoadScene(visitorSceneName, LoadSceneMode.Additive);
}
else

View File

@ -17,7 +17,7 @@ namespace Passer.Humanoid {
private const string fileName = "HumanoidVisitors.cs";
private static void CheckScenes() {
public static void CheckScenes() {
EditorBuildSettingsScene[] editorBuildSettingsScenes = EditorBuildSettings.scenes;
foreach (EditorBuildSettingsScene editorBuildSettingsScene in editorBuildSettingsScenes) {
string localSceneName = editorBuildSettingsScene.path;

View File

@ -80,7 +80,7 @@ namespace Passer {
HumanoidControl humanoid = GetComponentInParent<HumanoidControl>();
if (humanoid != null) {
if (!clearOnAwake) {
Debug.Log("Retrieve possessions from " + filePath);
//Debug.Log("Retrieve possessions from " + filePath);
if (File.Exists(filePath)) {
string json = File.ReadAllText(filePath);

View File

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Some files were not shown because too many files have changed in this diff Show More