public void OneVOneOnClick() { GetComponent <CanvasGroup>().interactable = false; SyncActions = false; PopUpNotification.Push("Do you want to queue up for " + MyText.Colofied(" Arena 1v1", "yellow") + "?", PopUpNotification.Type.Select); StartCoroutine(PopUpNotification.WaitForDecisionThenPerformAction(QueueUpArena, CancelRequest)); }
private void PopQueueEntrance(Decipher decipher) { Interaction.TurnOffAllInteractionWindow(); ControllerManager.SyncActions = false; PopUpNotification.Push("Your queue is ready, do you want to join?", PopUpNotification.Type.Select); StartCoroutine(PopUpNotification.WaitForDecisionThenPerformAction(AcceptEntrance, DenyEntrance)); }
private void DisconnectByServer(Decipher decipher) { byte error; NetworkTransport.Disconnect(decipher.tail, ClientID, out error); if (decipher.content != string.Empty) { PopUpNotification.Push(decipher.content, PopUpNotification.Type.Confirm); } }
IEnumerator WaitFroDeleteDecision() { PopUpNotification.Push("Are you sure?", PopUpNotification.Type.Select); yield return(PopUpNotification.WaitForDecision()); if (PopUpNotification.Decision) { Client.Send(Protocols.DeleteCharacter, new DeletionData(Slot)); PopUpNotification.Push("Waiting for server..."); } }
public void Login() { if (DataManager.Username == null) { PopUpNotification.Push("You have not yet registered.", PopUpNotification.Type.Confirm); } else { PopUpNotification.Push("Waiting for server...", PopUpNotification.Type.Pending); Client.Connect(); StartCoroutine(CheckConnectionAndSendRequest(0.5f)); } }
private IEnumerator CheckConnectionAndSendRequest(float time) { yield return(new WaitForSeconds(time)); if (!Client.Connected) { PopUpNotification.Push("No connection to server.", PopUpNotification.Type.Confirm); } else { Client.Send(Protocols.UserLogin, DataManager.Username); } }
//public InputField Password; public void Register() //This function will be disable after hook up with Steam login { if (Username.text == "" /*|| Password.text == ""*/) { PopUpNotification.Push("Username is invalid.", PopUpNotification.Type.Confirm); } else { PopUpNotification.Push("Waiting for server...", PopUpNotification.Type.Pending); Client.Connect(); StartCoroutine(CheckConnectionAndSendRequest(2)); } }
public void CreatCharacter() { if (Name.text == "") { PopUpNotification.Push("Name can not be empty.", PopUpNotification.Type.Confirm); } else if (!ClassRegistered) { PopUpNotification.Push("Please select a class.", PopUpNotification.Type.Confirm); } else { PopUpNotification.Push("Waiting for server...", PopUpNotification.Type.Pending); CreationData CreationData = new CreationData(CacheManager.CachedPlayerSlotIndex, new RGB(R.value, G.value, B.value), Name.text, RegisteredClass); Client.Send(Protocols.CreateCharacter, CreationData); } }
public void DeleteButtonOnClick() { PopUpNotification.Push("Are you sure?", PopUpNotification.Type.Select); StartCoroutine(WaitFroDeleteDecision()); }
public void PlayButtonOnClick() { CacheManager.CachedPlayerSlotIndex = Slot; PopUpNotification.Push("Waiting for server..."); Client.Send(Protocols.SubscribeIdentityAndInstance, Slot); }
private void PopUpNotify(Decipher decipher) { PopUpNotification.Push(decipher.content, PopUpNotification.Type.Confirm); }
private void CreateUsername(Decipher decipher) { DataManager.CreateUsernameProfile(decipher.content); PopUpNotification.Push("Successfully registered.", PopUpNotification.Type.Confirm); }