// Use this for initialization void Start() { _dataScore = GameObject.FindGameObjectWithTag("DataScoreTag").GetComponent <DataScore>(); _ScoreCount = _dataScore.Score_; _HighScoreCount = _dataScore.HightScore_; _Scoretxt.text = "Score : " + Mathf.Round(_ScoreCount); _HighScoretxt.text = " : " + Mathf.Round(_HighScoreCount); }
void Start () { DS = GameObject.FindGameObjectWithTag ("DataScoreTag").GetComponent <DataScore> (); if(PlayerPrefs.HasKey("HighScore")) { HighScoreCount = PlayerPrefs.GetFloat ("HighScore"); } }
void Start() { _rb = GetComponent <Rigidbody>(); DS = GameObject.FindGameObjectWithTag("DataScoreTag").GetComponent <DataScore> (); AudioMan = GetComponent <AudioSource>(); SCM = GameObject.FindGameObjectWithTag("ScoreManagerTag").GetComponent <ScoreManagerSc> (); SpawnParticule = GameObject.FindGameObjectWithTag("PuntoCalienteManagerTag").GetComponent <Transform>(); }
public void SetTimer(string username, string value) { Init(); if (playerTimers.ContainsKey(username) == false) { playerTimers[username] = new DataScore(); } playerTimers[username].timer = value; }
public void SetPosition(string username, int position) { Init(); if (playerTimers.ContainsKey(username) == false) { playerTimers[username] = new DataScore(); } playerTimers[username].position = position; }
public int CompareTo(DataScore <T> other) { if (Score > other.Score) { return(-1); } else if (Score < other.Score) { return(1); } return(0); }
public void AddScoreElection(string id, [FromBody] DataScore addScore) { var getArea = AreaCollection.Find(it => it.Id == id).FirstOrDefault(); addScore.DateElection = DateTime.Now; getArea.ScoreReceive.Add(new DataScore { DateElection = addScore.DateElection, Score = addScore.Score }); AreaCollection.ReplaceOne(it => it.Id == id, getArea); }
void Awake() { if (groupSc == null) { DontDestroyOnLoad(gameObject); groupSc = this; } else if (groupSc != this) { Destroy(gameObject); } ItsFinishScoreInGame = false; }
public IEnumerable <Tuple <object, T> > GetNearestNeighbors(int k, decimal value) { // This is computing distance and a score in one loop, weighted // by the inverse of the distance from our test value, and that way // we favor training with lots of nearby values. But a small number // of nearby values could be beaten by a large number of not super close // values. Dictionary <T, DataScore <T> > scores = new Dictionary <T, DataScore <T> >(); foreach (var pair in features) { T label = pair.Key; for (int i = 0, n = pair.Value.Values.Count; i < n; i++) { var item = pair.Value.Values[i]; var data = pair.Value.Data[i]; var distance = Math.Abs(item - value); decimal score = 0; if (distance < 1) { score = 2; } else { score = 1 / distance; } if (scores.TryGetValue(label, out DataScore <T> s)) { s.Score += score; } else { scores[label] = new DataScore <T>(data, label, score); } } } SortedSet <DataScore <T> > sorted = new SortedSet <DataScore <T> >(scores.Values); return(from i in sorted.Take(k) select new Tuple <object, T>(i.Data, i.Label)); }
void Start() { DS = GameObject.FindGameObjectWithTag("DataScoreTag").GetComponent <DataScore> (); thisParticuleSystem = GetComponent <ParticleSystem>(); }