Beispiel #1
0
        public static LabelColors CreateFromJSON(string json)
        {
            LabelColors instance = JsonUtility.FromJson <LabelColors>(json);

            instance.Initialize();
            return(instance);
        }
Beispiel #2
0
        public void Initialize(Size size, LabelColors labelColors)
        {
            labelTemplate = transform.GetComponentInChildren <Label>();
            labels        = new List <Label>()
            {
                labelTemplate
            };
            rect = GetComponent <RectTransform>();

            this.labelColors = labelColors;
            SetSize(size);
        }
Beispiel #3
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 #4
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;
        }