void ConnectToWorld() { var randomWorld = SubSceneManager.RequestRandomAwayWorldLink(this); if (randomWorld == null) { Logger.Log("StationGateway failed to connect to an away world"); SetOffline(); return; } selectedWorld = randomWorld; Message = "Teleporting to: " + selectedWorld.WorldName; if (selectedWorld.spawnMobsOnConnection) { selectedWorld.SetUp(this); } if (HasPower) { SetOnline(); ServerChangeState(true); var text = "Alert! New Gateway connection formed.\n\n Connection established to: " + selectedWorld.WorldName; CentComm.MakeAnnouncement(CentComm.CentCommAnnounceTemplate, text, CentComm.UpdateSound.alert); } }
public void OpenConfirmationWindow(URLType eURLType, string androidURLWeblink, string appleURLWeblink, MultiLanguageText confirmationDescription, SubSceneManager previousScene = null, ObjectTransitionAnimation previousNotePage = null) { if (m_rConfirmationWindowDisplay != null) { // Hide whatever notes are currently active (if applicable) if (ObjectTransitionAnimation.CurrentlyActive != null) { ObjectTransitionAnimation.CurrentlyActive.Disappear(false); } // Reveal Confirmation Window & Show URL Confirmation Description m_rConfirmationWindowDisplay.Reveal(); if (m_rTextDisplay != null && confirmationDescription != null) { confirmationDescription.ApplyEffects(m_rTextDisplay); } // Show Background Vignette VignetteManager.TransitionVignette(m_oVignetteInfo); // Assign URL variables as provided. m_eType = eURLType; androidURL = androidURLWeblink; URL = appleURLWeblink; m_rPreviousScene = previousScene; m_rPreviousNotePage = previousNotePage; if (m_rDoNotOpenURLButton != null) { m_rDoNotOpenURLButton.PreviousScene = previousScene; m_rDoNotOpenURLButton.PreviousNotePage = previousNotePage; } } }
public void BeginFadein(SubSceneManager previousScene, ObjectTransitionAnimation previousNote) { m_rPreviousScene = previousScene; m_rPreviousNotePage = previousNote; if (!SupressPlugWindow) { // Show Vignette VignetteManager.TransitionVignette(m_oVignetteInfo); if (SettingsMenuManager.Opened) { SettingsMenuManager.Close(); } // Toggle animation and disable user input for now ShowFirstAnimationFrames(); m_eTransitionPhase = TransitionPhase.SETTINGS_MENU; m_bFadeinResults = true; ButtonManager.ToggleAllButtons(false); } else { if (previousNote != null) { previousNote.Reveal(false); } } }
public override void Process() { if (CustomNetworkManager.Instance._isServer) { return; } SubSceneManager.ManuallyLoadScene(ToLoadSceneName); }
private GameObject StationGateway = null; // doesnt have to be station just the gateway this one will connect to public override void OnStartServer() { SetOffline(); registerTile = GetComponent <RegisterTile>(); Position = registerTile.WorldPosition; SubSceneManager.RegisterWorldGateway(this); ServerChangeState(false); }
void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
//TODO OldSceneNameContext (the scene we want to stop observing) public override void Process(NetMessage msg) { var sceneContext = SceneManager.GetSceneByName(msg.NewSceneNameContext); if (!sceneContext.IsValid()) { Logger.LogError("No scene was found for Observer refresh!!", Category.Connections); return; } SubSceneManager.ProcessObserverRefreshReq(SentByPlayer, sceneContext); }
//TODO OldSceneNameContext (the scene we want to stop observing) public override void Process() { var sceneContext = SceneManager.GetSceneByName(NewSceneNameContext); if (!sceneContext.IsValid()) { Logger.LogError("No scene was found for Observer refresh!!"); return; } SubSceneManager.ProcessObserverRefreshReq(SentByPlayer, sceneContext); }
public override void OnStartServer() { SetOffline(); registerTile = GetComponent <RegisterTile>(); ServerChangeState(false); if (ifWorldGateToWorldGate && StationGateway != null) { SetUpWorldToWorld(); } else if (!ifWorldGateToWorldGate) { SubSceneManager.RegisterWorldGateway(this); } }
protected override void OnUpdate() { EntityManager manager = World.EntityManager; List <Entity> toDelete = new List <Entity>(); Entities.ForEach((Entity entity, ref SubSceneTag tag, ref ButtonActivation activation) => { if (activation.isActivated) { if (tag.sceneId == 1) { sceneSystem.LoadSceneAsync(SubSceneManager.GetInstance().subScene.SceneGUID); toDelete.Add(entity); } } }); foreach (var entity in toDelete) { manager.DestroyEntity(entity); } }
public override void OnStartServer() { SetOffline(); registerTile = GetComponent <RegisterTile>(); Position = registerTile.WorldPosition; SubSceneManager.RegisterStationGateway(this); ServerChangeState(false); bool loadNormally = true; if (Application.isEditor) { #if UNITY_EDITOR if (EditorPrefs.HasKey("prevEditorScene")) { if (!string.IsNullOrEmpty(EditorPrefs.GetString("prevEditorScene"))) { if (SubSceneManager.Instance.awayWorldList.AwayWorlds.Contains( EditorPrefs.GetString("prevEditorScene"))) { loadNormally = false; //This will ensure that the gateway is ready in 30 seconds //if you are working on an awaysite in the editor WaitTimeBeforeActivation = 30f; } } } #endif } if (loadNormally) { WaitTimeBeforeActivation = Random.Range(RandomCountBegining, RandomCountEnd); } Invoke(nameof(ConnectToWorld), WaitTimeBeforeActivation); }
private void Awake() { manager = this; }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Methods: Begin Fadein //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void BeginFadein(SubSceneManager previousScene) { BeginFadein(previousScene, null); }
protected override void OnCreate() { sceneSystem = World.GetOrCreateSystem <SceneSystem>(); SubSceneManager.GetInstance(); }