Beispiel #1
0
        public void Initialize()
        {
            sizeConfig = GetComponent <SizeConfig>();
            sizeConfig.RaiseResizeEvent += OnScreenResize;
            Size size = sizeConfig.Initialize();

            texture = new Texture2D(size.Image.x, size.Image.y, TextureFormat.RGB24, false);
            cam     = GameObject.FindObjectOfType <Cam>();
            cam.Initialize(ref texture, size);

            monitor = GameObject.FindObjectOfType <Monitor>();
            monitor.Initialize(size, LabelColors.CreateFromJSON(Resources.Load <TextAsset>("LabelColors").text));

            clientManager = new ClientManager(ref texture);
            clientManager.RaiseDetectionEvent += OnDetection;
        }
Beispiel #2
0
        public void Initialize()
        {
            _targetIndicatorObject = FindObjectsOfType <GameObject>().First(x => x.tag == "target");
            _plane     = FindObjectsOfType <GameObject>().First(x => x.tag == "plane");
            sizeConfig = GetComponent <SizeConfig>();
            sizeConfig.RaiseResizeEvent += OnScreenResize;
            Size size = sizeConfig.Initialize();

            _size   = size.Image;
            texture = new Texture2D(size.Image.x, size.Image.y, TextureFormat.RGB24, false);
            cam     = GameObject.FindObjectOfType <Cam>();
            cam.Initialize(ref texture, size);

            monitor = GameObject.FindObjectOfType <Monitor>();
            monitor.Initialize(size, LabelColors.CreateFromJSON(Resources.Load <TextAsset>("LabelColors").text));

            var hiResScreenShots = new HiResScreenShots();

            clientManager = new ClientManager(hiResScreenShots);
            clientManager.RaiseDetectionEvent += OnDetection;
        }