public void OnTriggerEnter(Collider other) { if (!other.CompareTag("Player")) { return; } Service.Get <ActionConfirmationService>().ConfirmAction(typeof(ZoneTransition), null, delegate { bool flag = false; if (DestinationSpawnPoint != Vector3.zero) { PlayerSpawnPositionManager component = SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject.GetComponent <PlayerSpawnPositionManager>(); if (component != null) { component.SpawnPlayer(new SpawnPlayerParams.SpawnPlayerParamsBuilder(DestinationSpawnPoint).Rotation(Quaternion.Euler(DestinationSpawnRotation)).Zone(Zone).SceneName(Zone.SceneName) .SpawnedAction(new SpawnedAction()) .Build()); flag = true; } } if (!flag) { Service.Get <ZoneTransitionService>().LoadZone(Zone, LoadingScene); } }); }
public void OnEnable() { if (SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject != null) { PlayerSpawnPositionManager component = SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject.GetComponent <PlayerSpawnPositionManager>(); if (component != null) { component.spawnAtSceneLocation(); } } }