public static void notify(ReceivablePacket packet) { // Used for kicked message. NetworkManager.instance.kicked = true; // Go to login screen. SceneFader.Fade("LoginScreen", Color.white, 0.5f); }
private void OnClickDeleteButton() { // Get current character data. CharacterDataHolder characterData = PlayerManager.instance.selectedCharacterData; // Return if no character is selected. if (characterData == null) { return; } // Disable buttons. createButton.enabled = false; deleteButton.enabled = false; enterWorldButton.enabled = false; exitButton.enabled = false; // Set text message to deleting character. textMessage.text = "Deleting character " + characterData.GetName() + "..."; // Request info. waitingServer = true; NetworkManager.instance.ChannelSend(new CharacterDeletionRequest(characterData.GetSlot())); // Wait until server deletes the character. while (waitingServer) { // Make sure server has deleted the character. } // Reload everything. Destroy(characterSelected); // Destroy clone object. SceneFader.Fade("CharacterSelection", Color.white, 0.5f); }
void Start() { rigidBodies = FindObjectsOfType <Rigidbody2D>(); switched = false; fader = GetComponent <SceneFader>(); fadeScreen.SetActive(true); StartCoroutine(fader.Fade(SceneFader.FadeDirection.Out)); }
public void ChannelSend(SendablePacket packet) { if (SocketConnected()) { socket.Send(Encryption.Encrypt(packet.GetSendableBytes())); } else // Connection closed. { DisconnectFromServer(); // Go to login screen. SceneFader.Fade("LoginScreen", Color.white, 0.5f); } }
private void OnClickEnterButton() { // Check if no character exists. if (PlayerManager.instance.selectedCharacterData == null) { textMessage.text = "You must create a character."; } else // Enter world. { Destroy(characterSelected); // Destroy clone object. SceneFader.Fade("World", Color.white, 0.5f); } }
protected override async void dialogue() { await this.wait(2); await this.showContinue("Child", "Dad, what happened to grandpa? Why can't he be around us anymore"); await this.showContinue("Dad", "Hmmmm.... I'm not sure if you're old enough to hear about the story about grandpa.."); await this.showContinue("Child", "I promise I'm old enough to hear about it dad! I'm a big boy now!"); await this.showContinue("Dad", "Alright then... well... it began like this"); end(); fader.Fade(); }
protected override void Update() { if (FlaiInput.IsNewKeyPress(this.LoadFirstSceneKey)) { SceneFader.Fade(SceneDescription.FromIndex(0), Fade.Create(0.75f), Fade.Create(0.75f)); } else if (FlaiInput.IsNewKeyPress(this.ReloadSceneKey)) { SceneFader.Fade(SceneDescription.FromIndex(Application.loadedLevel), Fade.Create(0.15f), Fade.Create(0.15f)); } else if (FlaiInput.IsNewKeyPress(this.PreviousSceneKey)) { SceneFader.Fade(SceneDescription.FromIndex(Application.loadedLevel - 1), Fade.Create(0.15f), Fade.Create(0.15f)); } else if (FlaiInput.IsNewKeyPress(this.NextSceneKey)) { SceneFader.Fade(SceneDescription.FromIndex((Application.loadedLevel == Application.levelCount - 1) ? 0 : Application.loadedLevel + 1), Fade.Create(0.15f), Fade.Create(0.15f)); } }
private void OnClickTask() { // Disable buttons. DisableButtons(); // Store login information. string account = accountNameField.text; string password = passwordField.text; // Input field checks. if (account == "") { messageText.text = "Please enter your account name."; EnableButtons(); return; } if (password == "") { messageText.text = "Please enter your password."; EnableButtons(); return; } if (account.Length < 2) { messageText.text = "Account name length is too short."; EnableButtons(); return; } if (password.Length < 2) { messageText.text = "Password length is too short."; EnableButtons(); return; } // Try to connect to server. if (!NetworkManager.instance.ConnectToServer()) { messageText.text = "Could not communicate with the server."; EnableButtons(); return; } // Authenticate. messageText.text = "Authenticating..."; status = -1; NetworkManager.instance.ChannelSend(new AccountAuthenticationRequest(account, password)); // Wait for result. authenticating = true; while (authenticating) { switch (status) { case 0: messageText.text = "Account does not exist."; authenticating = false; break; case 1: messageText.text = "Account is banned."; authenticating = false; break; case 2: messageText.text = "Account requires activation."; authenticating = false; break; case 3: messageText.text = "Wrong password."; authenticating = false; break; case 4: messageText.text = "Account is already connected."; authenticating = false; break; case 5: messageText.text = "Too many online players, please try again later."; authenticating = false; break; case 100: messageText.text = "Authenticated."; authenticating = false; break; } } // Go to player selection screen. if (status == 100) { PlayerManager.instance.accountName = account; SceneFader.Fade("CharacterSelection", Color.white, 0.5f); } else // Enable buttons. { NetworkManager.instance.DisconnectFromServer(); EnableButtons(); } }
private void OnClickCreateButton() { Destroy(characterSelected); // Destroy clone object. SceneFader.Fade("CharacterCreation", Color.white, 0.5f); }
// Start is called before the first frame update public void Retry() { m_SceneFader.Fade(SceneManager.GetActiveScene().name); // SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); //현재씬을 재시작 하기위함으로 현재씬 인덱스 다시 로드 }
public void Play() { m_SceneFader.Fade(m_sLoadString); }
public void QuitBuutonClick() { m_SceneFader.Fade(m_sMainMenuName); }
public void LevelSelect(string sLevelName) { m_SceneFacder.Fade(sLevelName); }
// Use this for initialization protected virtual void Start() { SC_Game.Instance.StartLevel(); StartCoroutine(SceneFader.Fade(Color.black, Color.clear, _startDuration)); }
public void Continue() { PlayerPrefs.SetInt("LevelReach", m_nLevelToUnlock); m_SceneFader.Fade(m_sNextLevel); }
public IEnumerator TransitionToScene(string toScene, Color fromColor, Color toColor, float duration) { yield return(StartCoroutine(SceneFader.Fade(fromColor, toColor, duration))); yield return(SceneManager.LoadSceneAsync(toScene)); }
public void Retry() { Toggle(); m_SceneFader.Fade(SceneManager.GetActiveScene().name); // SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); }
// Use this for initialization protected virtual void Start() { StartCoroutine(SceneFader.Fade(Color.black, Color.clear, _startDuration)); }
private void OnClickExitButton() { Destroy(characterSelected); // Destroy clone object. SceneFader.Fade("LoginScreen", Color.white, 0.5f); }
private IEnumerator LoadLevelAfterDelay(float delay) { yield return(new WaitForSeconds(delay)); SceneFader.Fade("LoginScreen", Color.black, 0.5f); }