scene transfer fixes

This commit is contained in:
Vova
2023-12-11 20:30:23 +02:00
parent 0c4d9b2481
commit d9273466ef
10 changed files with 87047 additions and 87051 deletions
+6714 -77907
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1aa8851f1bf646546ac965f2f963173e
guid: 9f59655503e97544d828c29e7f5de737
DefaultImporter:
externalObjects: {}
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
guid: 9f59655503e97544d828c29e7f5de737
guid: 1aa8851f1bf646546ac965f2f963173e
DefaultImporter:
externalObjects: {}
userData:
+1 -12
View File
@@ -11,22 +11,11 @@ public class Door : BaseInteractableObject
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;
}
protected override void InteractAction(RadialMenuActions interactAction)
{
if (!string.IsNullOrEmpty(_exitName))
{
PlayerPrefs.SetString("lastExitName", _exitName.ToLower());
}
{
GameManager.Instance.Scene.Change(_scene, _spawnPointInSceneName);
}
}
+6 -6
View File
@@ -19,7 +19,7 @@ public class GameManager : MonoBehaviour
public TimeSystem Time => _timeSystem;
public UISystem UI => _uiSystem;
public CameraSystem Camera =>_cameraSystem;
public CameraSystem Camera => _cameraSystem;
public static GameManager Instance { get; private set; }
@@ -29,14 +29,14 @@ public class GameManager : MonoBehaviour
{
Instance = this;
DontDestroyOnLoad(gameObject);
_inputSystem = new InputSystem();
_sceneManager = new SceneManager();
_timeSystem = new TimeSystem();
_gameMouseHandler = new InGameMouseHandler(_cameraSystem.MainCamera);
}
else
Destroy(gameObject);
_inputSystem = new InputSystem();
_sceneManager = new SceneManager();
_timeSystem = new TimeSystem();
_gameMouseHandler = new InGameMouseHandler(_cameraSystem.MainCamera);
}
private void OnEnable()
{
@@ -25,7 +25,7 @@ public class InGameMouseHandler : UnityEngine.Object
_walkableLayerMask = LayerMask.GetMask("Walking");
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;
}
+2 -1
View File
@@ -25,10 +25,11 @@ public class SceneManager
{
foreach (var spawn in spawnPoints)
{
if (spawn.name == _spawnLocationName)
if (spawn.name.ToLower() == _spawnLocationName.ToLower())
{
var interactable = spawn.GetComponent<BaseInteractableObject>();
Player.Instance.SetPosition(interactable._interactionPoint.position);
Player.Instance.Rotate(interactable._interactionPoint.forward * -1);
}
}
}