当前位置: 首页>>代码示例>>C#>>正文


C# Camera.GetComponentInChildren方法代码示例

本文整理汇总了C#中UnityEngine.Camera.GetComponentInChildren方法的典型用法代码示例。如果您正苦于以下问题:C# Camera.GetComponentInChildren方法的具体用法?C# Camera.GetComponentInChildren怎么用?C# Camera.GetComponentInChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.Camera的用法示例。


在下文中一共展示了Camera.GetComponentInChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

        void Start()
        {
            currentTexture = 0;
            textures = new UnityEngine.RenderTexture[2];
            Resize();

            cameraRender = GetComponent<Camera>();
            materialRender = GetComponentInChildren<Renderer>().material;

            cameraEffect = Camera.main;
            materialEffect = cameraEffect.GetComponentInChildren<Renderer>().material;

            UnityEngine.Shader.SetGlobalTexture("_SamplerRenderTarget", GetCurrentTexture());
            NextTexture();
            cameraRender.targetTexture = GetCurrentTexture();
            materialEffect.mainTexture = GetCurrentTexture();
        }
开发者ID:leon196,项目名称:WJ,代码行数:17,代码来源:RenderTexture.cs

示例2: Start

        //private Texture2D stampTexture;
        //private Vector2 swipeAngle = Vector2.zero;
        //private Vector3 localUp = Vector3.up;
        //private Vector3 localLeft = Vector3.left;
        private void Start()
        {
            OriginalSlider = PaintSlider.sprite;
            OriginalSliderBar = PaintSliderBar.sprite;

            MainCamera = GameObject.FindObjectOfType<Camera>();

            Renderer rend = MainCamera.GetComponentInChildren<Renderer>();
            ModelTransform = rend.transform;
            ModelTexture = new Texture2D(GlobalSettings.TextureSize, GlobalSettings.TextureSize);
            Color[] colors = ModelTexture.GetPixels();

            for (int i = 0; i < colors.Length; ++i)
            {
                colors[i] = Color.white;
            }
            ModelTexture.SetPixels(colors);
            ModelTexture.Apply();
            rend.material.mainTexture = ModelTexture;

            Palette = GameObject.FindObjectOfType<ColorPalette>();

            //PaintImage = PaintButton.targetGraphic as Image;
            //OriginalPaintSprite = PaintImage.sprite;

            //RotateImage = RotateButton.targetGraphic as Image;
            //OriginalRotate = RotateImage.sprite;

            //OffsetPoints = new List<Vector3>();
            //OffsetPoints.Add(new Vector3(1, 0, 0));
            //OffsetPoints.Add(new Vector3(-1, 0, 0));
            //OffsetPoints.Add(new Vector3(0, 1, 0));
            //OffsetPoints.Add(new Vector3(0, -1, 0));

            PaintSliderControl.minValue = 1;
            PaintSliderControl.maxValue = IngameSettings.MaxBrushCount;
            PaintSliderControl.value = (IngameSettings.MaxBrushCount / 2);

            EraserSliderControl.minValue = 1;
            EraserSliderControl.maxValue = IngameSettings.MaxBrushCount;
            EraserSliderControl.value = (IngameSettings.MaxBrushCount / 2);

            ToggleEraser(false);
            TogglePaint(true);
        }
开发者ID:rsumathijs,项目名称:Coloring-Book-WIP,代码行数:49,代码来源:TouchManager.cs

示例3: Awake

        public void Awake()
        {
            // Get reference to Game Manager within the scene
            m_gameManager = FindObjectOfType<GameManager>();

            // Get capture camera reference
            m_captureCamera = GetComponentInChildren<Camera>();

            // Get capture canvas reference and ensure it's at 0,0,0 in local space
            m_captureCanvas = m_captureCamera.GetComponentInChildren<Canvas>();
            m_captureCanvas.transform.localPosition = Vector3.zero;

            // Cache common properties
            m_transform = transform;
        }
开发者ID:patferguson,项目名称:Storms-Project,代码行数:15,代码来源:Minimap.cs


注:本文中的UnityEngine.Camera.GetComponentInChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。