Пример #1
0
 // 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);
 }
Пример #2
0
	void Start () 
	{
		DS = GameObject.FindGameObjectWithTag ("DataScoreTag").GetComponent <DataScore> ();
		if(PlayerPrefs.HasKey("HighScore"))
		{
			HighScoreCount =	PlayerPrefs.GetFloat ("HighScore");
		}
	}
Пример #3
0
 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>();
 }
Пример #4
0
    public void SetTimer(string username, string value)
    {
        Init();

        if (playerTimers.ContainsKey(username) == false)
        {
            playerTimers[username] = new DataScore();
        }
        playerTimers[username].timer = value;
    }
Пример #5
0
    public void SetPosition(string username, int position)
    {
        Init();

        if (playerTimers.ContainsKey(username) == false)
        {
            playerTimers[username] = new DataScore();
        }
        playerTimers[username].position = position;
    }
Пример #6
0
 public int CompareTo(DataScore <T> other)
 {
     if (Score > other.Score)
     {
         return(-1);
     }
     else if (Score < other.Score)
     {
         return(1);
     }
     return(0);
 }
Пример #7
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);
        }
Пример #8
0
 void Awake()
 {
     if (groupSc == null)
     {
         DontDestroyOnLoad(gameObject);
         groupSc = this;
     }
     else if (groupSc != this)
     {
         Destroy(gameObject);
     }
     ItsFinishScoreInGame = false;
 }
Пример #9
0
        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));
        }
Пример #10
0
 void Start()
 {
     DS = GameObject.FindGameObjectWithTag("DataScoreTag").GetComponent <DataScore> ();
     thisParticuleSystem = GetComponent <ParticleSystem>();
 }