Exemplo n.º 1
0
        protected override void Start()
        {
            base.Start();

            texture2D          = new Texture2D(width, height); //, TextureFormat.BGRA32, false
            texture2D.wrapMode = TextureWrapMode.Clamp;

            if (material != null)
            {
                material.SetTexture("_MainTex", texture2D);
                material.SetTextureScale("_MainTex", new Vector2(1, 1)); //z nějakýho důvodu to zobrazuje zrcadlově otočený, tím to to vrátím
            }
            if (projectorMaterial != null)
            {
                projectorMaterial.SetTexture("_MainTex", texture2D);
                projectorMaterial.SetTextureScale("_MainTex", new Vector2(1, 1));
            }

            droneRosConnector = gameObject.GetComponent <MyRosConnector>();
        }
        protected override void Start()
        {
            base.Start();

            GameObject.Find("MainCanvas/VideoMovableWindow").transform.localScale = new Vector3(1, 1, 1);
            texture2D          = new Texture2D(width, height); //, TextureFormat.BGRA32, false
            texture2D.wrapMode = TextureWrapMode.Clamp;

            if (material != null)
            {
                material.SetTexture("_MainTex", texture2D);
                material.SetTextureScale("_MainTex", new Vector2(1, 1)); //z nějakýho důvodu to zobrazuje zrcadlově otočený, tím to to vrátím
            }
            if (projectorMaterial != null)
            {
                projectorMaterial.SetTexture("_MainTex", texture2D);
                projectorMaterial.SetTextureScale("_MainTex", new Vector2(1, 1));
            }

            droneRosConnector = gameObject.GetComponent <MyRosConnector>();
            rawImage          = GameObject.Find("MainCanvas/VideoMovableWindow/Content/Video").GetComponent <RawImage>();
            rawImage.texture  = texture2D;
            GameObject.Find("MainCanvas/VideoMovableWindow").SetActive(false);
        }