Exemple #1
0
        public void Init()
        {
            if (TouchReactCamera)
            {
                TouchReactCamera.enabled = true;
            }

            if (!TouchReactCamera)
            {
                CreateTouchReactCamera();
            }

            UpdateTouchReactCamera();

            if (AutoselectCamera)
            {
                SelectedCamera = Camera.main;
            }
#if VEGETATION_STUDIO || VEGETATION_STUDIO_PRO
            VegetationStudioManager.EnableTouchReact(true);
#endif

            SetupMaterial();
            UpdateCamera();
        }
Exemple #2
0
        // ReSharper disable once UnusedMember.Local
        private void OnDisable()
        {
#if VEGETATION_STUDIO || VEGETATION_STUDIO_PRO
            VegetationStudioManager.EnableTouchReact(false);
#endif
            if (TouchReactCamera)
            {
                TouchReactCamera.enabled = false;
            }

            if (TouchReactCamera)
            {
                RenderTexture rt = TouchReactCamera.targetTexture;
                TouchReactCamera.targetTexture = null;
                DestroyImmediate(rt);
            }
        }