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


C# Camera.GetComponent方法代码示例

本文整理汇总了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>();
 }
开发者ID:KandyMan1990,项目名称:GamesCreationAssignment,代码行数:7,代码来源:BossCharacter.cs

示例2: OnClick

    // Use this for initialization
    public void OnClick()
    {
        mainCam = FindObjectOfType<Camera>();

        if (mainCam.GetComponent<GameScript>().state.Equals("stand"))
            mainCam.GetComponent<GameScript>().state = "right";
    }
开发者ID:dwilkinson7,项目名称:tictacturn,代码行数:8,代码来源:RightClick.cs

示例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);
    }
开发者ID:A01492492,项目名称:Repo,代码行数:29,代码来源:AssessmentManager.cs

示例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;
 }
开发者ID:ferdbold,项目名称:littleawfuljam2016,代码行数:9,代码来源:ModeEnabler.cs

示例5: Seen

 void Seen(Camera cam)
 {
     if(cam.GetComponent<CameraObjectScanner>() != null){
         cam.GetComponent<CameraObjectScanner>().SeeingObject(this.gameObject);
     }
     if (OnCameraStay != null) {
         OnCameraStay (cam,this.gameObject);
     }
 }
开发者ID:Darkfafi,项目名称:Summer_Game_Dev_2015_GameJam,代码行数:9,代码来源:CameraSeeTriggerObject.cs

示例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);
     }
 }
开发者ID:Darkfafi,项目名称:Summer_Game_Dev_2015_GameJam,代码行数:10,代码来源:CameraSeeTriggerObject.cs

示例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);
     }
 }
开发者ID:Darkfafi,项目名称:Summer_Game_Dev_2015_GameJam,代码行数:10,代码来源:CameraSeeTriggerObject.cs

示例8: Start

 void Start()
 {
     cam = Camera.mainCamera;
     guin = cam.GetComponent<GUINavigation>();
     mapg = cam.GetComponent<MapGui>();
     zoomedIn = true;
     mdown = false;
     onguidown = false;
     mdowncool = 0;
 }
开发者ID:Crismis333,项目名称:MSU_TheSiege2,代码行数:10,代码来源:MapMovementController.cs

示例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;
    }
开发者ID:3dAnon,项目名称:PoniGame,代码行数:13,代码来源:CameraManager.cs

示例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();
    }
开发者ID:mesterjagels,项目名称:rollinghead,代码行数:13,代码来源:Bounce.cs

示例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;
    }
开发者ID:gunman7840,项目名称:Test_Win,代码行数:14,代码来源:EnemyType.cs

示例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());

    }
开发者ID:can2apple,项目名称:coloring-ar,代码行数:49,代码来源:CustomRenderTextureCamera.cs

示例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>();
    }
开发者ID:yuk0416,项目名称:team-seisaku-3,代码行数:16,代码来源:PlayerCamera.cs

示例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;
    }
开发者ID:pierre-galaup,项目名称:globalgamejam2016,代码行数:31,代码来源:MirrorCameraScript.cs

示例15: Start

 void Start ()
 {
     currentCamera = mng.cameraManager.currentCamera;
     mainCameraScript = currentCamera.GetComponent<MainCameraScript>();
     shotManager = mng.shotManager;
     mng.eventManager.StartListening(EventManager.EventType.CAMERA_CHANGED, CameraChanged);
 }
开发者ID:ChromaTeamUPC,项目名称:ChromaVirus,代码行数:7,代码来源:PlayerController.cs


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