本文整理汇总了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();
}
示例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);
}
示例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;
}