Ejemplo n.º 1
0
        public override void OnRunComplete()
        {
            var accuracy     = _results.Select(p => p.Value.Reward > 0.9 ? 1 : 0).Average();
            var avgDistScore = _results.Select(r => r.Value.DistScore).Average();

            Debug.Log(string.Format("Accuracy: {0:P} Avg. Distance Score: {1:F}", accuracy, avgDistScore));
            BenchmarkSave.WriteGridResult(accuracy, avgDistScore);
        }
Ejemplo n.º 2
0
        public List <PlayerItem> GetPlayers(Func <PlayerItem, bool> func = null)
        {
            List <PlayerItem> result = null;

            lock (Instance)
            {
                if (func == null)
                {
                    result = playerLogins.Select(x => x.Value).ToList();
                }
                else
                {
                    result = playerLogins.Select(x => x.Value).Where(func).ToList();
                }
            }

            return(result);
        }
Ejemplo n.º 3
0
        private void Awake()
        {
            slider = GetComponent <Slider>();

            slider.onValueChanged.AddListener(ChangeColor);

            steps = ColorPerPercentage.Select(pair => pair.Key).ToList();
            steps.Sort();
        }