protected void AddConsoleLog(string log) { if (PreloaderUI.Instantiated) { ConsoleScreen.Log(log); } }
private static void AddConsoleLog(string log) { if (PreloaderUI.Instantiated) { ConsoleScreen.Log(log); } }
private void Item_OnSelected(EventItem item, bool state) { if (item == _lastSelected) { _lastSelected = null; } else if (_selected != item) { _lastSelected = _selected; _selected = item; selectionChanged = true; ConsoleScreen.Log("SELECT", item.NameText.text); if (_lastSelected != null) { _lastSelected.Selected = false; } StartCoroutine(_MaintainScroll()); } else if (_selected == item && OnItemSelected != null) { OnItemSelected(_selected); } }
public void OnRealTimeMessageReceived(bool isReliable, string senderId, byte[] data) { ConsoleScreen.Log("OnRealTimeMessageReceived"); OnlineMessage message = deserializeMessage(data); if (!playerOneDecided) { ConsoleScreen.Log("OnRealTimeMessageReceived - decide p1"); GlobalGameManager.amIPlayerOne = PlayGamesPlatform.Instance.RealTime.GetSelf().ParticipantId.Equals(message.participantIdPlayerOne); CurrentState = GlobalGameManager.amIPlayerOne ? State.MY_TURN : State.WAIT; } else { ReceiveShoot(message.unitIndex, message.force); } //switch (CurrentState) //{ // case State.WAIT: // break; // case State.MY_TURN: // Debug.Log("OnRealTimeMessageReceived - mensaje en mi turno? WTF!!"); // break; // default: // Debug.Log("OnRealTimeMessageReceived - WTF!!"); // break; //} }
private void GoToSelection() { if (_selectedButton != null) { ConsoleScreen.Log("GO TO", AppData.Events[_selectedButton.transform.GetSiblingIndex()].Name); AppManager.SwitchToEventScreen(AppData.Events[_selectedButton.transform.GetSiblingIndex()]); } }
public void Back() { if (_instance._backStack.Count > 1) { _instance._backStack.Pop(); BackStackFrame frame = _instance._backStack.Pop(); string lastScreen = CurrentScreen; string param = ""; switch (frame.Screen) { case 0: SwitchToHomeScreen(); break; case 1: SwitchToEventScreen((EventInfo)frame.Param); param = ((EventInfo)frame.Param).Name; break; case 2: SwitchToProfileScreen((User)frame.Param); param = ((User)frame.Param).Name; break; case 3: SwitchToListScreen(); break; case 4: SwitchToMapScreen(); break; case 5: SwitchToCreateScreen(); break; } ConsoleScreen.Log("BACK", string.Format("{0} -> {1} {2}", lastScreen, CurrentScreen, param)); } }
//***************************************************************************** // What happens after a shoot is performed? //***************************************************************************** public IEnumerator managePostShoot(string _shootBy, int unitIndex, Vector3 outPower) { ConsoleScreen.Log("shoot " + outPower); //get who is did the shoot //if we had a goal after the shoot was done and just before the round change, leave the process to other controllers. timeLeft = 15; float t = 0; while (t < timeStepToAdvanceRound) { t += Time.deltaTime; if (goalHappened) { yield break; } yield return(0); } //we had a simple shoot with no goal result if (t >= timeStepToAdvanceRound) { //add to round counters switch (_shootBy) { case "Player": if (powerUpTurnoExtra == true) { round = 1; powerUpTurnoExtra = false; } else { round = 2; } break; case "Player_2": round = 1; break; case "Opponent": round = 1; break; } //TODO-REE Online if (gameMode == 2) { SoccerRealTimeMultiplayerListener.Instance.SendShoot(unitIndex, outPower); } roundTurnManager(); //cycle again between players } }
//Link up hard coded markers public void LinkMarkers() { for (int i = 0; i < MapImage.transform.childCount; i++) { Button markerButton = MapImage.transform.GetChild(i).GetComponent <Button>(); markerButton.onClick.AddListener(delegate() { EventButton.gameObject.SetActive(true); Text text = EventButton.GetComponentInChildren <Text>(); text.text = AppData.Events[markerButton.transform.GetSiblingIndex()].Name; ConsoleScreen.Log("SELECT", AppData.Events[markerButton.transform.GetSiblingIndex()].Name); _selectedButton = markerButton; }); } }
public void OnRoomConnected(bool success) { Debug.Log("OnRoomConnected " + success); if (success) { DecideWhoIsPlayerOne(); ConsoleScreen.Log("Decided"); Application.LoadLevel("Game-c#"); ConsoleScreen.Log("Loaded"); //Application.LoadLevel("Game-c#"); } else { // Error! // ...show error message to user... } }
private void ShowRegister() { if (_showingPopup) { return; } ConsoleScreen.Log("REGISTER", "Clicked"); _showingPopup = true; bool registered = _eventInfo.VolunteerIDs.Contains(AppManager.CurrentUser.ID); RegisterYesNoWithCheckBoxDialogController.DefaultChecked = registered; RegisterYesNoWithCheckBoxDialogController.message = (registered ? "Unregister" : "Register") + " for Opportunity?"; RegisterYesNoWithCheckBoxDialogController.checkBoxText = "Check to " + (registered ? "Unregister" : "Register"); RegisterYesNoWithCheckBoxDialogController.Show(); }
/** * Realiza lógica de decidir quién es el jugador 1. */ private void DecideWhoIsPlayerOne() { bool iDecide = doIDecideWhoIsPlayerOne(); ConsoleScreen.Log("i decide"); if (iDecide) { GlobalGameManager.amIPlayerOne = UnityEngine.Random.value <= 0.5; Debug.LogFormat("DecideWhoIsPlayerOne - decide p1 - %s", GlobalGameManager.amIPlayerOne); if (GlobalGameManager.amIPlayerOne) { ConsoleScreen.Log("i am"); OnlineMessage message = new OnlineMessage(); message.participantIdPlayerOne = PlayGamesPlatform.Instance.RealTime.GetSelf().ParticipantId; PlayGamesPlatform.Instance.RealTime.SendMessageToAll(true, serializeMessage(message)); playerOneDecided = true; CurrentState = State.MY_TURN; } } }
private void EventList_OnItemSelected(EventItem item) { ConsoleScreen.Log("GO TO", item.NameText.text); AppManager.SwitchToEventScreen(item.EventInfo); }
private void ApplyFilter(string filterInput) { ConsoleScreen.Log("FILTER", filterInput); filterTags = filterInput.ToLower().Split(stringSeparators, System.StringSplitOptions.RemoveEmptyEntries); BuildList(); }