Пример #1
0
        private Actor CreateBrick()
        {
            Brick      brick = new Brick();
            GameObject go    = new GameObject("Brick");

            go.transform.localScale *= VIEW_SCALE_FACTOR;
            BrickView view = go.AddComponent <BrickView>();

            view.Init(brick);
            return(brick);
        }
Пример #2
0
        private void BrickViewInstanceOnWasDestroyed(BrickView brickView)
        {
            brickView.WasDestroyed -= BrickViewInstanceOnWasDestroyed;

            _brickViewInstances.Remove(brickView);

            if (brickView.Targeted)
            {
                GameManager.Instance.GameFlowManager.CurrentGameStatus = GameFlowManager.GameStatus.Win;
            }
        }
Пример #3
0
        public IEnumerable <BrickView> GetAll()
        {
            List <BrickView> View = new List <BrickView>();

            foreach (var item in BrickList)
            {
                BrickView BVtemp = new BrickView();
                BVtemp.ID      = item.ID;
                BVtemp.ComPort = item.ComPort;
                //Lesen der aktuellen Sensorwerte für Sensor 1
                //!!! Prüfung ob Brick connected!!!
                try
                {
                    SensorUnit Sens = null;
                    Sens.Name  = item.EV3.Sensor1.GetName();
                    Sens.Value = item.EV3.Sensor1.ReadAsString();
                    BVtemp.SensorList.Add(Sens);
                }
                finally { }
                //Lesen der aktuellen Sensorwerte für Sensor 2
                try
                {
                    SensorUnit Sens = null;
                    Sens.Name  = item.EV3.Sensor2.GetName();
                    Sens.Value = item.EV3.Sensor2.ReadAsString();
                    BVtemp.SensorList.Add(Sens);
                }
                finally { }
                //Lesen der aktuellen Sensorwerte für Sensor 3
                try
                {
                    SensorUnit Sens = null;
                    Sens.Name  = item.EV3.Sensor3.GetName();
                    Sens.Value = item.EV3.Sensor3.ReadAsString();
                    BVtemp.SensorList.Add(Sens);
                }
                finally { }
                //Lesen der aktuellen Sensorwerte für Sensor 4
                try
                {
                    SensorUnit Sens = null;
                    Sens.Name  = item.EV3.Sensor4.GetName();
                    Sens.Value = item.EV3.Sensor4.ReadAsString();
                    BVtemp.SensorList.Add(Sens);
                }
                finally { }

                View.Add(BVtemp);
            }

            return(View);
        }