Partially restore Samples: Visitor Desktop & Start Site
@ -20,33 +20,43 @@ namespace Passer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void InitializeSiteNames() {
|
protected virtual void InitializeSiteNames() {
|
||||||
|
HumanoidVisitors.CheckScenes();
|
||||||
|
List<string> humanoidVisitors = HumanoidVisitors.visitors;
|
||||||
|
|
||||||
EditorBuildSettingsScene[] editorBuildSettingsScenes = EditorBuildSettings.scenes;
|
EditorBuildSettingsScene[] editorBuildSettingsScenes = EditorBuildSettings.scenes;
|
||||||
int siteCount = editorBuildSettingsScenes.Length - HumanoidVisitors.visitors.Count;
|
int siteCount = editorBuildSettingsScenes.Length; // - HumanoidVisitors.visitors.Count;
|
||||||
|
|
||||||
List<string> siteList = new List<string>();
|
List<string> siteList = new List<string>();
|
||||||
siteList.Add("-none-");
|
siteList.Add("-none-");
|
||||||
int j = 0;
|
|
||||||
for (int i = 0; i < siteCount; i++) {
|
for (int i = 0; i < siteCount; i++) {
|
||||||
if (!editorBuildSettingsScenes[j].enabled) {
|
if (!editorBuildSettingsScenes[i].enabled) {
|
||||||
j++;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
string sceneName = editorBuildSettingsScenes[j].path;
|
string sceneName = editorBuildSettingsScenes[i].path;
|
||||||
int lastSlash = sceneName.LastIndexOf('/');
|
int lastSlash = sceneName.LastIndexOf('/');
|
||||||
sceneName = sceneName.Substring(lastSlash + 1);
|
sceneName = sceneName.Substring(lastSlash + 1);
|
||||||
sceneName = sceneName.Substring(0, sceneName.Length - 6); // remove .unity
|
sceneName = sceneName.Substring(0, sceneName.Length - 6); // remove .unity
|
||||||
|
|
||||||
bool isVisitor = HumanoidVisitors.visitors.Contains(sceneName);
|
// Does not work at the moment the visitors are all scenes
|
||||||
if (!isVisitor) {
|
//bool isVisitor = IsHumanoidVisitor(sceneName, humanoidVisitors);
|
||||||
//siteNames[i] = sceneName;
|
//if (!isVisitor) {
|
||||||
siteList.Add(sceneName);
|
siteList.Add(sceneName);
|
||||||
j++;
|
//}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
siteNames = siteList.ToArray();//new string[siteCount];
|
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
|
#endregion Enable
|
||||||
|
|
||||||
#region Inspector
|
#region Inspector
|
||||||
|
@ -180,6 +180,8 @@ namespace Passer.Humanoid {
|
|||||||
private static string[] visitorNames;
|
private static string[] visitorNames;
|
||||||
private static bool VisitorSceneInspector() {
|
private static bool VisitorSceneInspector() {
|
||||||
bool anyChanged = false;
|
bool anyChanged = false;
|
||||||
|
|
||||||
|
HumanoidVisitors.CheckScenes();
|
||||||
if (HumanoidVisitors.visitors == null || HumanoidVisitors.visitors.Count <= 0)
|
if (HumanoidVisitors.visitors == null || HumanoidVisitors.visitors.Count <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ namespace Passer {
|
|||||||
if (humanoid == null) {
|
if (humanoid == null) {
|
||||||
string visitorSceneName = HumanoidPreferences.visitorSceneName;
|
string visitorSceneName = HumanoidPreferences.visitorSceneName;
|
||||||
if (!string.IsNullOrEmpty(visitorSceneName)) {
|
if (!string.IsNullOrEmpty(visitorSceneName)) {
|
||||||
Debug.Log(visitorSceneName);
|
//Debug.Log(visitorSceneName);
|
||||||
UnityEngine.SceneManagement.SceneManager.LoadScene(visitorSceneName, LoadSceneMode.Additive);
|
UnityEngine.SceneManagement.SceneManager.LoadScene(visitorSceneName, LoadSceneMode.Additive);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -17,7 +17,7 @@ namespace Passer.Humanoid {
|
|||||||
|
|
||||||
private const string fileName = "HumanoidVisitors.cs";
|
private const string fileName = "HumanoidVisitors.cs";
|
||||||
|
|
||||||
private static void CheckScenes() {
|
public static void CheckScenes() {
|
||||||
EditorBuildSettingsScene[] editorBuildSettingsScenes = EditorBuildSettings.scenes;
|
EditorBuildSettingsScene[] editorBuildSettingsScenes = EditorBuildSettings.scenes;
|
||||||
foreach (EditorBuildSettingsScene editorBuildSettingsScene in editorBuildSettingsScenes) {
|
foreach (EditorBuildSettingsScene editorBuildSettingsScene in editorBuildSettingsScenes) {
|
||||||
string localSceneName = editorBuildSettingsScene.path;
|
string localSceneName = editorBuildSettingsScene.path;
|
||||||
|
@ -80,7 +80,7 @@ namespace Passer {
|
|||||||
HumanoidControl humanoid = GetComponentInParent<HumanoidControl>();
|
HumanoidControl humanoid = GetComponentInParent<HumanoidControl>();
|
||||||
if (humanoid != null) {
|
if (humanoid != null) {
|
||||||
if (!clearOnAwake) {
|
if (!clearOnAwake) {
|
||||||
Debug.Log("Retrieve possessions from " + filePath);
|
//Debug.Log("Retrieve possessions from " + filePath);
|
||||||
|
|
||||||
if (File.Exists(filePath)) {
|
if (File.Exists(filePath)) {
|
||||||
string json = File.ReadAllText(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 |