Partially restore Samples: Visitor Desktop & Start Site
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Before Width: | Height: | Size: 5.0 MiB After Width: | Height: | Size: 5.0 MiB |
Before Width: | Height: | Size: 684 KiB After Width: | Height: | Size: 684 KiB |
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 1.8 MiB |
Before Width: | Height: | Size: 710 KiB After Width: | Height: | Size: 710 KiB |
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 204 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |