public void InitiatePack(List <GameObject> cards) { if (isMyTurn) { if (turnType == TurnType.none || turnType == TurnType.pick) { if (cards.Count > 0) { packInitiator.InitiatePack(cards); // if(!firstCheckDone) // turnType = TurnType.through; // else{ // turnType = TurnType.throughtorshow; // } turnType = TurnType.throughtorshow; } } else { if (!showChangeTurn) { dialog = "Cant pick card,\n" + turnType.ToString() + " one card to pick"; } else { dialog = "Cant Pick card,\n" + " Press Change Turn Button"; } UIEventHandler.Ins.OpenMenu("PickCardNotification"); UIEventHandler.Ins.pickNotificationText.text = dialog; //showDialogBox = true; } } }
void UpdateBrakingForIntersection(Collider other) { try { IntersectionLightSingleton intersection = other.transform.gameObject.GetComponentInChildren <IntersectionLightSingleton>(); TargetNavigation tv = GetComponent <TargetNavigation>(); TurnType turnType = tv.CurrentTrajectory.Turn; IntersectionRoad road = tv.CurrentTrajectory.Road; LightPhase phase = (road == IntersectionRoad.Road1) ? intersection.phase.road1 : intersection.phase.road2; switch (phase) { case LightPhase.Green: _brakingForRedLight = false; break; case LightPhase.Yellow: _brakingForRedLight = true; break; case LightPhase.Red: _brakingForRedLight = true; break; } Debug.Log("Vehicle performing " + turnType.ToString() + " movement on " + road.ToString() + " has entered IntersectionInteriorVolume when light is " + phase.ToString()); } catch (NullReferenceException ex) { Debug.Log(ex.Message); } return; }
public void ShowTurn(TurnType current, float time) { turnText.text = current.ToString(); float widthScale; switch (current) { case TurnType.MovePiece: turnTime = 0; widthScale = 1 - time / GameManager.inst.turnSystem.turnTimers[current]; turnImage.color = new Color(0, 1, 0.5f); break; case TurnType.Attack: case TurnType.AttackReady: turnTime = turnTime > 1 ? time + 1 : time; widthScale = turnTime * 0.5f; turnImage.color = Color.red; break; default: Debug.LogError("[ERR-ShowTurn] default called"); widthScale = 1; break; } turnImage.fillAmount = widthScale; }
public static async Task <bool> Turn(double amount, TurnType type) { try { var values = new Dictionary <string, string> { { "amount", amount.ToString() }, { "type", type.ToString() } }; var content = new FormUrlEncodedContent(values); return((await Client.PostAsync($"{BackendUrl}/RaspPi/Turn", content)).IsSuccessStatusCode); } catch (Exception) { return(false); } }
public void OnTurnCamera(TurnType type) { animator.SetTrigger(type.ToString()); }