本文整理汇总了C#中Camera.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# Camera.GetComponent方法的具体用法?C# Camera.GetComponent怎么用?C# Camera.GetComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.GetComponent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
audioSource = GetComponent<AudioSource>();
cam = Camera.main;
twirl = cam.GetComponent<UnityStandardAssets.ImageEffects.Twirl>();
vignette = cam.GetComponent<UnityStandardAssets.ImageEffects.VignetteAndChromaticAberration>();
}
示例2: OnClick
// Use this for initialization
public void OnClick()
{
mainCam = FindObjectOfType<Camera>();
if (mainCam.GetComponent<GameScript>().state.Equals("stand"))
mainCam.GetComponent<GameScript>().state = "right";
}
示例3: AssesmentMode
// displays the assesment window and enables assesment camera
internal void AssesmentMode()
{
// Remove all records
RemoveAllRecords();
Debug.Log("REMOVED ALL RECORDS");
mAssesmentCam.enabled = true;
mAssesmentGui.AssessmentMode = true;
mMainCam = Camera.mainCamera;
mMainCam.rect = mMiniScreen;
if (mMainCam.GetComponent<MouseLook>())
{
mMainCam.GetComponent<MouseLook>().enabled = false;
}
mPlayer = GameObject.Find("Player");
if (mPlayer == null)
return;
mPlayer.GetComponent<CharacterMotor>().enabled = false;
mPlayer.GetComponent<MouseLook>().enabled = false;
mPlayer.GetComponent<FPSInputController>().enabled = false;
//EnablePlayer.EnablePlayer(false);
}
示例4: Awake
void Awake() {
_camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
_topDownCamera = _camera.GetComponent<TopDownCamera>();
_lookAtCamera = _camera.GetComponent<LookAtCamera>();
_slothAnimator = GameObject.FindGameObjectWithTag("SlothNinja").GetComponentInChildren<Animator>();
_ikSlothController = _slothAnimator.GetComponent<IKSlothController>();
killCamCanvas.worldCamera = _camera;
killCamCanvas.planeDistance = planeDistance;
}
示例5: Seen
void Seen(Camera cam)
{
if(cam.GetComponent<CameraObjectScanner>() != null){
cam.GetComponent<CameraObjectScanner>().SeeingObject(this.gameObject);
}
if (OnCameraStay != null) {
OnCameraStay (cam,this.gameObject);
}
}
示例6: StopSeen
void StopSeen(Camera cam)
{
if (cam.GetComponent<CameraObjectScanner> () != null) {
cam.GetComponent<CameraObjectScanner>().StopSeeingObject(this.gameObject);
}
_camerasThatSeeObject.Remove(cam);
if(OnCameraExit != null){
OnCameraExit (cam,this.gameObject);
}
}
示例7: StartSeen
void StartSeen(Camera cam)
{
if(cam.GetComponent<CameraObjectScanner>() != null){
cam.GetComponent<CameraObjectScanner>().StartSeeingObject(this.gameObject);
}
_camerasThatSeeObject.Add(cam);
if(OnCameraEnter != null){
OnCameraEnter (cam,this.gameObject);
}
}
示例8: Start
void Start()
{
cam = Camera.mainCamera;
guin = cam.GetComponent<GUINavigation>();
mapg = cam.GetComponent<MapGui>();
zoomedIn = true;
mdown = false;
onguidown = false;
mdowncool = 0;
}
示例9: Start
void Start()
{
m_cam = Camera.main;
m_sunShafts = m_cam.GetComponent<SunShafts>();
m_bloom = m_cam.GetComponent<Bloom>();
m_motionBlur = m_cam.GetComponent<CameraMotionBlur>();
m_antiAliasing = m_cam.GetComponent<AntiAliasing>();
m_colorGrading = m_cam.GetComponent<TonemappingColorGrading>();
m_defaultGrading = m_colorGrading.colorGrading;
GameController.GameOver += OnGameOver;
}
示例10: Awake
void Awake()
{
canvas = FindObjectOfType<Canvas>();
audio = GetComponent<AudioSource>();
rb = GetComponent<Rigidbody2D>();
camera = FindObjectOfType<Camera>();
rb.isKinematic = true;
canvas.enabled = true;
camera.GetComponent<cameraMove>().cameraSpeed = 0;
camera.GetComponent<AudioSource>().clip = suspenseMusic;
camera.GetComponent<AudioSource>().Play();
}
示例11: EnemyType_Awake
protected void EnemyType_Awake()
{
//Debug.Log("enemy type awake");
_transform = transform;
_camera = GameObject.Find("Main Camera").GetComponent<Camera>();
enemymanager = _camera.GetComponent<EnemyManager>();
debugmanager = GameObject.Find("DebugManager").GetComponent<DebugManager>();
eventmanager = _camera.GetComponent<EventManager>();
//resourceManager = _camera.GetComponent<ResourceManager>();
navigation = _camera.GetComponent<Navigation>(); //Получаем доступ к классу
myLayerMask = enemymanager.myLayerMask;
}
示例12: StartRenderingToTexture
IEnumerator StartRenderingToTexture()
{
yield return new WaitForSeconds(0.5f);
Render_Texture_Camera = GetComponentInChildren<Camera>();
Render_Texture_Camera.GetComponent<Camera>().orthographicSize = transform.localScale.z * 5;
if (transform.localScale.x >= transform.localScale.z)
{
TextureResolutionX = TextureResolution;
TextureResolutionY = (int)(TextureResolution * transform.localScale.z / transform.localScale.x);
}
if (transform.localScale.x < transform.localScale.z)
{
TextureResolutionX = (int)(TextureResolution * transform.localScale.x / transform.localScale.z);
TextureResolutionY = TextureResolution;
}
CameraOutputTexture = new RenderTexture(TextureResolutionX, TextureResolutionY, 0);
CameraOutputTexture.Create();
Render_Texture_Camera.GetComponent<Camera>().targetTexture = CameraOutputTexture;
gameObject.layer = 20;
Render_Texture_Camera.cullingMask = 1 << 20;
Film_Plane = new GameObject("Film_Plane");
Film_Plane.transform.parent = transform;
Film_Plane.transform.localPosition = new Vector3(0.0f, -4.0f, 0.0f);
Film_Plane.transform.localScale = Vector3.one;
Film_Plane.transform.localEulerAngles = new Vector3(0.0f, 180.0f, 0.0f);
Film_Plane.AddComponent<MeshFilter>();
Film_Plane.GetComponent<MeshFilter>().sharedMesh = GetComponent<MeshFilter>().sharedMesh;
Film_Plane.AddComponent<MeshRenderer>();
Film_Plane.GetComponent<Renderer>().sharedMaterial = Film_Textured;
Film_Plane.GetComponent<Renderer>().sharedMaterial.SetTexture("_MainTex", MarkerBackground);
Film_Plane.GetComponent<Renderer>().shadowCastingMode = 0;
Film_Plane.GetComponent<Renderer>().useLightProbes = false;
Film_Plane.GetComponent<Renderer>().reflectionProbeUsage = 0;
Film_Plane.GetComponent<Renderer>().receiveShadows = false;
Film_Plane.layer = 20;
StartCoroutine(ShowTextureOnGUI());
}
示例13: Start
// Use this for initialization
void Start () {
// カメラオブジェクトを取得します
GameObject obj = GameObject.Find("Main Camera");
_mainCamera = obj.GetComponent<Camera>();
//カメラの範囲の距離を取得します
camPos_x = _mainCamera.GetComponent<Camera>().orthographicSize * 1.8f;
camPos_y = _mainCamera.GetComponent<Camera>().orthographicSize;
//カメラの動く範囲を取得します
limitPosTopLeft = limitTopLeft.transform.position;
limitPosBottomRight = limitBottomRight.transform.position;
resultChecker = _player.GetComponent<Player>();
}
示例14: UpdateCameraProperties
private void UpdateCameraProperties(Camera src, Camera dest)
{
dest.clearFlags = src.clearFlags;
dest.backgroundColor = src.backgroundColor;
if (src.clearFlags == CameraClearFlags.Skybox)
{
Skybox sky = src.GetComponent<Skybox>();
Skybox mysky = dest.GetComponent<Skybox>();
if (!sky || !sky.material)
{
mysky.enabled = false;
}
else
{
mysky.enabled = true;
mysky.material = sky.material;
}
}
dest.orthographic = src.orthographic;
dest.orthographicSize = src.orthographicSize;
if (mirrorScript.AspectRatio > 0.0f)
{
dest.aspect = mirrorScript.AspectRatio;
}
else
{
dest.aspect = src.aspect;
}
dest.renderingPath = src.renderingPath;
}
示例15: Start
void Start ()
{
currentCamera = mng.cameraManager.currentCamera;
mainCameraScript = currentCamera.GetComponent<MainCameraScript>();
shotManager = mng.shotManager;
mng.eventManager.StartListening(EventManager.EventType.CAMERA_CHANGED, CameraChanged);
}