private void processEndGame(JObject pointsReceived) { try { if (pointsReceived.ContainsKey("points")) { JArray a = (JArray)pointsReceived["points"]; IList <Points> points = a.ToObject <IList <Points> >(); int i = 1; foreach (var item in points) { PointsDisplay temp = new PointsDisplay(item.username, item.points, i++); Points.Add(temp); } App.Current.Dispatcher.Invoke(delegate { DialogContent = new EndGameControl(); IsEndGameDialogOpen = true; }); } else { ShowMessageBox("Game cancelled"); } } catch (Exception) { Mediator.Notify("LeaveLobby"); } }
public void InitTarget() { //get component moveTowards = GetComponent <MoveTowards>(); rotateTowards = GetComponent <RotateTowards>(); destructionParticles = destructionParticlesContainer.GetComponentsInChildren <ParticleSystem>(); //set points value loss pointsValueLoss = targetManager.pointsValueLoss; //set target transform moveTowards.target = player.transform; rotateTowards.target = player.transform; //store original pitch originalPitch = hitClip.pitch; //set points display pointsDisplay = targetManager.pointsDisplay; //enable scripts moveTowards.enabled = true; rotateTowards.enabled = true; }
void Start() { pointsDisplay = GetComponentInChildren <PointsDisplay>(); }
public void SetPoints(int points) { Points = Mathf.Max(0, points); PointsDisplay.DisplayPoints(); }