scene transfer fixes
This commit is contained in:
+6714
-77907
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 1aa8851f1bf646546ac965f2f963173e
|
guid: 9f59655503e97544d828c29e7f5de737
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 9f59655503e97544d828c29e7f5de737
|
guid: 1aa8851f1bf646546ac965f2f963173e
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
@@ -11,22 +11,11 @@ public class Door : BaseInteractableObject
|
|||||||
|
|
||||||
protected override void PrepareMenuActions()
|
protected override void PrepareMenuActions()
|
||||||
{
|
{
|
||||||
if (PlayerPrefs.GetString("lastExitName") == _exitName.ToLower())
|
|
||||||
{
|
|
||||||
print($"Player came from to {_scene}");
|
|
||||||
Player.Instance.SetPosition(_interactionPoint.position);
|
|
||||||
}
|
|
||||||
|
|
||||||
_menuActions[RadialMenuActions.Enter].IsEnabled = true;
|
_menuActions[RadialMenuActions.Enter].IsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void InteractAction(RadialMenuActions interactAction)
|
protected override void InteractAction(RadialMenuActions interactAction)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(_exitName))
|
|
||||||
{
|
|
||||||
PlayerPrefs.SetString("lastExitName", _exitName.ToLower());
|
|
||||||
}
|
|
||||||
|
|
||||||
GameManager.Instance.Scene.Change(_scene, _spawnPointInSceneName);
|
GameManager.Instance.Scene.Change(_scene, _spawnPointInSceneName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class GameManager : MonoBehaviour
|
|||||||
public TimeSystem Time => _timeSystem;
|
public TimeSystem Time => _timeSystem;
|
||||||
public UISystem UI => _uiSystem;
|
public UISystem UI => _uiSystem;
|
||||||
|
|
||||||
public CameraSystem Camera =>_cameraSystem;
|
public CameraSystem Camera => _cameraSystem;
|
||||||
|
|
||||||
public static GameManager Instance { get; private set; }
|
public static GameManager Instance { get; private set; }
|
||||||
|
|
||||||
@@ -29,14 +29,14 @@ public class GameManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
DontDestroyOnLoad(gameObject);
|
DontDestroyOnLoad(gameObject);
|
||||||
|
|
||||||
|
_inputSystem = new InputSystem();
|
||||||
|
_sceneManager = new SceneManager();
|
||||||
|
_timeSystem = new TimeSystem();
|
||||||
|
_gameMouseHandler = new InGameMouseHandler(_cameraSystem.MainCamera);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
|
|
||||||
_inputSystem = new InputSystem();
|
|
||||||
_sceneManager = new SceneManager();
|
|
||||||
_timeSystem = new TimeSystem();
|
|
||||||
_gameMouseHandler = new InGameMouseHandler(_cameraSystem.MainCamera);
|
|
||||||
}
|
}
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class InGameMouseHandler : UnityEngine.Object
|
|||||||
_walkableLayerMask = LayerMask.GetMask("Walking");
|
_walkableLayerMask = LayerMask.GetMask("Walking");
|
||||||
|
|
||||||
var waypointPrefab = Resources.Load("WayPointSign", typeof(WaypointVisual)) as WaypointVisual;
|
var waypointPrefab = Resources.Load("WayPointSign", typeof(WaypointVisual)) as WaypointVisual;
|
||||||
_waypointVisual = Instantiate(waypointPrefab);
|
_waypointVisual = Instantiate(waypointPrefab,GameManager.Instance.transform);
|
||||||
|
|
||||||
GameManager.Instance.Input.PlayerAction.PointClick.performed += ClickToMove;
|
GameManager.Instance.Input.PlayerAction.PointClick.performed += ClickToMove;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,10 +25,11 @@ public class SceneManager
|
|||||||
{
|
{
|
||||||
foreach (var spawn in spawnPoints)
|
foreach (var spawn in spawnPoints)
|
||||||
{
|
{
|
||||||
if (spawn.name == _spawnLocationName)
|
if (spawn.name.ToLower() == _spawnLocationName.ToLower())
|
||||||
{
|
{
|
||||||
var interactable = spawn.GetComponent<BaseInteractableObject>();
|
var interactable = spawn.GetComponent<BaseInteractableObject>();
|
||||||
Player.Instance.SetPosition(interactable._interactionPoint.position);
|
Player.Instance.SetPosition(interactable._interactionPoint.position);
|
||||||
|
Player.Instance.Rotate(interactable._interactionPoint.forward * -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ EditorBuildSettings:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Scenes:
|
m_Scenes:
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/Scenes/City.unity
|
path: Assets/Scenes/obsolete_city.unity
|
||||||
guid: 1aa8851f1bf646546ac965f2f963173e
|
guid: 1aa8851f1bf646546ac965f2f963173e
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/Scenes/House.unity
|
path: Assets/Scenes/House.unity
|
||||||
@@ -18,3 +18,4 @@ EditorBuildSettings:
|
|||||||
path: Assets/Scenes/MiniMarket.unity
|
path: Assets/Scenes/MiniMarket.unity
|
||||||
guid: c62496298062c0545bcd71ff37f4cf79
|
guid: c62496298062c0545bcd71ff37f4cf79
|
||||||
m_configObjects: {}
|
m_configObjects: {}
|
||||||
|
m_UseUCBPForAssetBundles: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user