public void Assembling_Draft() { SendDestroyMessage(); GameObject elem_prefab = Resources.Load("Elements/DraftElement") as GameObject; Transform Plate = Instantiate((Resources.Load("Elements/DraftPlate") as GameObject).transform, new Vector3(PP.Width / 2, -0.5f, PP.Height / 2), Quaternion.identity) as Transform; NewPlate(Plate); Transform Elem; for (int i = 0; i < DataStorage.N; i++) { CircuitElement t = DataStorage.cm[i]; Elem = Instantiate(elem_prefab.transform) as Transform; Elem.Find("Scale").transform.localScale = new Vector3(t.Width - 3, t.Height - 3, 1); Elem.parent = Rotator; Elem.localPosition = new Vector3(t.x + t.Width / 2, t.y + t.Height / 2, 0); Elem.localEulerAngles = Vector3.zero; Elem.gameObject.name = i.ToString(); Elem.Find("Label").GetComponent <TextMesh>().text = DataStorage.cm[i].Name; } HiResScreenShots.TakeHiResShot(new Vector3(PP.Width / 2, PP.Height / 2)); SaveButton.interactable = false; }
private void Start() { if (Instance == null) { Instance = this; } rt = new RenderTexture(resWidth, resHeight, 24); }
// Use this for initialization void Start() { hrss = GameObject.FindObjectOfType <HiResScreenShots>(); triggerList = GameObject.FindObjectsOfType <TriggerTest>(); screenShotName = ""; storedImage.gameObject.SetActive(false); storedSigils = new Dictionary <string, Texture>(); StartCoroutine(GetFiles()); }
private const int IntervalInMilliseconds = 200; // throttle requests public ClientManager(HiResScreenShots screenShotService) { this._screenShotService = screenShotService; _channel = new Channel("127.0.0.1:50052", ChannelCredentials.Insecure); _client = new ClientWrapper(new YoloService.YoloServiceClient(_channel)); _result = new YoloResult(); _detectionArgs = new DetectionEventArgs(_result); _timer = new Stopwatch(); _timer.Start(); }
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; }
// Use this for initialization void Awake() { screenshotter = GetComponent <HiResScreenShots>(); }
void Start() { hrss = GetComponent <HiResScreenShots>(); }