public void CloseCharacterSelect() { title.SetActive(true); SelectCharacter.SetActive(false); mainMenu.SetActive(true); EventSystem.current.SetSelectedGameObject(menuFirstButton); }
private void Awake() { button = GetComponent <Button>(); select = FindObjectOfType <SelectCharacter>(); button.interactable = false; }
void Start() { //Creamos instancia de script if (SelectCharacter.SC == null) { SC = this; } else if (SelectCharacter.SC != this) { Destroy(SelectCharacter.SC); SelectCharacter.SC = this; } characterSelected = -1; playerSelected.text = ""; info.text = "Selecciona un personaje."; if (PhotonNetwork.IsMasterClient) { startButton.SetActive(true); } else { startButton.SetActive(false); } //Quitamos el glow de todos los avatares InicializarGlow(); currentSelected = null; }
// 道济时结束,玩家没有成功选择角色,设置默认角色 public void NoCharacterIsSelect() { for (int i = 0; i < Define.MAX_PLAYER_NUMBER; ++i) { if (ioo.playerManager.GetPlayer(i).HasHead()) { continue; } else { foreach (ICharacter character in mSelectCharacter) { SelectCharacter sc = character as SelectCharacter; if (sc.hasBeenSelected) { continue; } else { sc.hasBeenSelected = true; ioo.playerManager.GetPlayer(i).SetHead(sc.attr.baseAttr.headID); } } } } }
public void PlayGame() { title.SetActive(false); SelectCharacter.SetActive(true); mainMenu.SetActive(false); EventSystem.current.SetSelectedGameObject(SelectCharacterFirstOption); }
public CharacterMenu(RenderWindow window) { _avatars = new SelectCharacter(window); _imgBackGround = this.ImgBackGround(); _buttons = Buttons(); CharaterName(); _nextState = this; }
void Start() { if (SelectCharacter.chosenCharacter != null) { GameObject clone = Instantiate(SelectCharacter.chosenCharacter, new Vector3(-18f, -1.25f, -2f), Quaternion.identity); clone.transform.localScale = new Vector3(7f, 7f, 7f); SelectCharacter.chosenCharacter = null; SelectCharacter.Bye(); } }
private void OnCharacterClicked(CharacterRow characterRow) { if (this.selected != null) { this.selected.Deselect(); } this.selected = characterRow; this.selected.Select(); SelectCharacter?.Invoke(this.selected.Character); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } m_char = Resources.Load("Data/" + GlobalData.m_ref) as Character; }
// Use this for initialization void Awake() { DontDestroyOnLoad(gameObject); if (instance == null) { instance = this; } Camera.main.transform.position = new Vector3( gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.position.z - 10); }
public override void Received(VirtualClient virtualClient) { if (virtualClient.ConnectedServerEndPoint != ServerEndPoint.GameServer) { virtualClient.LoginSuccessResult.Characters.AddRange(this.Characters.Where(x => x.ID != 0).ToList()); String logtext = ""; for (int i = 0; i < virtualClient.LoginSuccessResult.Characters.Count; i++) { SelectCharacter character = virtualClient.LoginSuccessResult.Characters[i]; logtext += i + ") Name: " + character.Name + " Level: " + character.Level + " Race: " + character.Race + "\r\n"; } virtualClient.Logger.LogInfo(logtext); virtualClient.OnLoginSuccess(); } else { CCharacterSelectPacket packet = new CCharacterSelectPacket(); packet.CharacterIndex = virtualClient.SelectedCharacterIndex; virtualClient.SendPacket(packet); } }
protected override bool OnHandleMessage(IMessage message, PhotonServerPeer serverPeer) { var para = new Dictionary <byte, object> { { (byte)ClientParameterCode.PeerId, message.Parameters[(byte)ClientParameterCode.PeerId] }, { (byte)ClientParameterCode.SubOperationCode, message.Parameters[(byte)ClientParameterCode.SubOperationCode] } }; var operation = new SelectCharacter(serverPeer.Protocol, message); if (!operation.IsValid) { Log.Error(operation.GetErrorMessage()); serverPeer.SendOperationResponse(new OperationResponse(message.Code) { ReturnCode = (int)ErrorCode.OperationInvalid, DebugMessage = operation.GetErrorMessage(), Parameters = para }, new SendParameters()); return(true); } try { using (var session = NHibernateHelper.OpenSession()) { using (var transaction = session.BeginTransaction()) { var user = session.QueryOver <User>().Where(u => u.Id == operation.UserId).List().FirstOrDefault(); if (user != null) { Log.DebugFormat("Found user {0}", user.UserName); } var character = session.QueryOver <ComplexCharacter>().Where(cc => cc.UserId == user).And(cc => cc.Id == operation.CharacterId).List().FirstOrDefault(); transaction.Commit(); if (character == null) { serverPeer.SendOperationResponse(new OperationResponse(message.Code) { ReturnCode = (int)ErrorCode.InvalidCharacter, DebugMessage = "Invalid character.", Parameters = para }, new SendParameters()); return(true); } else { Log.DebugFormat("Found character {0}", character.Name); para.Add((byte)ClientParameterCode.CharacterId, character.Id); serverPeer.SendOperationResponse(new OperationResponse(message.Code) { ReturnCode = (byte)ErrorCode.OK, Parameters = para }, new SendParameters()); } } } return(true); } catch (Exception e) { Log.Error(e); serverPeer.SendOperationResponse(new OperationResponse(message.Code) { ReturnCode = (int)ErrorCode.InvalidCharacter, DebugMessage = e.ToString(), Parameters = para }, new SendParameters()); } return(true); }
/// <summary> /// Creates an instance of the given type. /// </summary> /// <param name="requestedType"></param> /// <returns></returns> /// <remarks> /// Every object in the composite root should be instantiates before returning the requested type. /// Otherwise, classes may not work correctly with each other, if they use an indirect way of communicating /// such as through events. /// </remarks> private object CreateInstance(Type requestedType) { MetroWindow metroWindow = Application.Current.MainWindow as MetroWindow; App app = Application.Current as App; LibraryUpdater libraryUpdater = new LibraryUpdater(); DialogCoordinator dialogCoordinator = new DialogCoordinator(); Persister persister = new Persister(); UpdateEliteAPI updateEliteAPI = new UpdateEliteAPI(libraryUpdater, EventMessenger); SelectCharacter selectCharacterRequest = new SelectCharacter(EventMessenger, metroWindow); SelectAbilityRequestHandler selectAbilityRequestHandler = new SelectAbilityRequestHandler(metroWindow); BattlesViewModel battlesViewModel = new BattlesViewModel(); FollowViewModel followViewModel = new FollowViewModel(); IgnoredViewModel ignoredViewModel = new IgnoredViewModel(); LogViewModel logViewModel = new LogViewModel(); ReportViewModel reportViewModel = new ReportViewModel(); SelectProcessViewModel selectProcessViewModel = new SelectProcessViewModel(new SelectProcessDialog()); AutoAttachCharacter onLoadEvents = new AutoAttachCharacter(selectCharacterRequest, selectProcessViewModel, dialogCoordinator, EventMessenger); RestingViewModel restingViewModel = new RestingViewModel(); RoutesViewModel routesViewModel = new RoutesViewModel(); SettingsViewModel settingsViewModel = new SettingsViewModel(); TargetingViewModel targetingViewModel = new TargetingViewModel(); TargetsViewModel targetsViewModel = new TargetsViewModel(); TabViewModels tabViewModels = new TabViewModels(new List <IViewModel>() { reportViewModel, battlesViewModel, targetingViewModel, restingViewModel, routesViewModel, followViewModel, logViewModel, settingsViewModel, }); MainViewModel mainViewModel = new MainViewModel(tabViewModels); MasterViewModel masterViewModel = new MasterViewModel(mainViewModel, EventMessenger); if (requestedType == typeof(EventMessenger)) { return(EventMessenger); } if (requestedType == typeof(App)) { return(app); } if (requestedType == typeof(LibraryUpdater)) { return(libraryUpdater); } if (requestedType == typeof(SelectCharacter)) { return(selectCharacterRequest); } if (requestedType == typeof(SelectAbilityRequestHandler)) { return(selectAbilityRequestHandler); } if (requestedType == typeof(IDialogCoordinator)) { return(dialogCoordinator); } if (requestedType == typeof(IPersister)) { return(persister); } if (requestedType == typeof(UpdateEliteAPI)) { return(updateEliteAPI); } if (requestedType == typeof(AutoAttachCharacter)) { return(onLoadEvents); } if (requestedType == typeof(BattlesViewModel)) { return(battlesViewModel); } if (requestedType == typeof(FollowViewModel)) { return(followViewModel); } if (requestedType == typeof(IgnoredViewModel)) { return(ignoredViewModel); } if (requestedType == typeof(LogViewModel)) { return(logViewModel); } if (requestedType == typeof(ReportViewModel)) { return(reportViewModel); } if (requestedType == typeof(TabViewModels)) { return(tabViewModels); } if (requestedType == typeof(MainViewModel)) { return(mainViewModel); } if (requestedType == typeof(MasterViewModel)) { return(masterViewModel); } if (requestedType == typeof(SelectProcessViewModel)) { return(selectProcessViewModel); } if (requestedType == typeof(RestingViewModel)) { return(restingViewModel); } if (requestedType == typeof(RoutesViewModel)) { return(routesViewModel); } if (requestedType == typeof(SettingsViewModel)) { return(settingsViewModel); } if (requestedType == typeof(TargetingViewModel)) { return(targetingViewModel); } if (requestedType == typeof(TargetsViewModel)) { return(targetsViewModel); } throw new InvalidOperationException($"Could not create instance of requested type {requestedType.Name}"); }
public void clickButton(string button) { audio.Play(); switch (button) { case "Start": SelectCharacter.SetActive(true); MainPanel.SetActive(false); break; case "Instructions": InstructionPanel.SetActive(true); MainPanel.SetActive(false); break; case "Return": InstructionPanel.SetActive(false); PlayerTypePanel.SetActive(false); SelectCharacter.SetActive(false); MainPanel.SetActive(true); break; case "ExitGame": Application.Quit(); break; case "Resume": PausePanel.SetActive(false); break; case "Restart": SceneManager.LoadScene(SceneManager.GetActiveScene().name); break; case "Exit": ExitPanel.SetActive(true); break; case "Yes": SceneManager.LoadScene("Init"); break; case "No": ExitPanel.SetActive(false); break; case "Terry": MainManager.Character = 1; SelectCharacter.SetActive(false); PlayerTypePanel.SetActive(true); break; case "Lili": MainManager.Character = 2; SelectCharacter.SetActive(false); PlayerTypePanel.SetActive(true); break; case "Players": music.Stop(); SceneManager.LoadScene("players"); break; case "AI": music.Stop(); SceneManager.LoadScene("AI"); break; case "ExitPlayGame": music.Stop(); SceneManager.LoadScene("init"); break; } }
public IActionResult SelectCharacter(SelectCharacter input) { _gameManager.SelectCharacter(input.Character); return(Ok()); }
/// <inheritdoc /> public void HandlePacket(Player player, Span <byte> packet) { SelectCharacter message = packet; this.characterSelectAction.SelectCharacter(player, message.Name); }
public void RemoveSelectCharacter(SelectCharacter selectCharacter) { mSelectCharacter.Remove(selectCharacter); }
private void button1_Click(object sender, EventArgs e) { // Create a request using a URL that can receive a post. WebRequest request = WebRequest.Create("http://api.eve-online.com/account/Characters.xml.aspx"); // Set the Method property of the request to POST. request.Method = "POST"; // Create POST data and convert it to a byte array. string postData = "userid=1019336&apikey=MgpSLvvxgQemZfy4dUGwtnQFnOhjOExnjoZmFDx4SvIqe9TWMxPTRIpd5TFjoc4p"; byte[] byteArray = Encoding.UTF8.GetBytes(postData); // Set the ContentType property of the WebRequest. request.ContentType = "application/x-www-form-urlencoded"; // Set the ContentLength property of the WebRequest. request.ContentLength = byteArray.Length; // Get the request stream. Stream dataStream = request.GetRequestStream(); // Write the data to the request stream. dataStream.Write(byteArray, 0, byteArray.Length); // Close the Stream object. dataStream.Close(); // Get the response. WebResponse response = request.GetResponse(); // Display the status. label1.Text = ((HttpWebResponse)response).StatusDescription; // Get the stream containing content returned by the server. dataStream = response.GetResponseStream(); // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader(dataStream); // Read the content. string responseFromServer = reader.ReadToEnd(); // Display the content. textBox1.Text = responseFromServer; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(responseFromServer); EveCharater[] charList = new EveCharater[3]; if (xmlDoc != null) { XmlNodeList xmlCharacterNodes = xmlDoc.SelectNodes("//rowset/row"); if (xmlCharacterNodes.Count > 0) { int i = 0; foreach (XmlNode character in xmlCharacterNodes) { XmlAttributeCollection xac = character.Attributes; string sCharName = xac["name"].InnerText; int iCharId = Int32.Parse(xac["characterID"].InnerText); string sCorpName = xac["corporationName"].InnerText; int iCorpId = Int32.Parse(xac["corporationID"].InnerText); charList[i++] = new EveCharater(iCharId, sCharName, iCorpId, sCorpName); } } } CurEveAccount.CharacterList = charList; SelectCharacter sc = new SelectCharacter(CurEveAccount); sc.CharacterSelected += new CharacterSelectedEventHandler(sc_CharacterSelected); sc.Show(this); CurEveAccount.AccountUserId = 996611; // Clean up the streams. reader.Close(); dataStream.Close(); response.Close(); }
public void Awake() { instance = this; }
// 角色 public void AddSelectCharacter(SelectCharacter selectCharacter) { mSelectCharacter.Add(selectCharacter); }