• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CameraController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CameraController的典型用法代码示例。如果您正苦于以下问题:C# CameraController类的具体用法?C# CameraController怎么用?C# CameraController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CameraController类属于命名空间,在下文中一共展示了CameraController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FindScripts

    void FindScripts()
    {
        // Find Controller GameObject
        GameObject controller =  Camera.main.gameObject;

        // Attach scripts that are attached to controller object
        sc_CameraController = controller.GetComponent<CameraController>();
        sc_GameController   = controller.GetComponent<GameController>();
        sc_LevelManager     = controller.GetComponent<LevelManager>();
        sc_RowManager       = controller.GetComponent<RowManager>();

        // Find Scripts not attached to controller object
        sc_AudioManager     = GameObject.Find("audio_manager").GetComponent<AudioManager>();

        if (LevelName == "Intro") return;

        sc_FadeToScene      = GameObject.FindGameObjectWithTag("Fade").GetComponent<FadeToScene>();
        sc_HighScoreManager = GameObject.FindGameObjectWithTag("Scores").GetComponent<HighScoreManager>();

        if (CheckObjectExist("score_tracker"))
            sc_ScoreTracker     = GameObject.Find("score_tracker").GetComponent<ScoreTracker>();

        if (CheckObjectExist("glow_ball"))
            sc_BallController   = GameObject.Find("glow_ball").GetComponent<BallController>();

        if (CheckObjectExist("boundaries"))
            sc_BoundaryManager   = GameObject.Find("boundaries").GetComponent<BoundaryManager>();
    }
开发者ID:Kurukshetran,项目名称:Glowball,代码行数:28,代码来源:ScriptHelper.cs


示例2: Start

	// Use this for initialization
	public void Start ()
	{
		PauseController = GameObject.Find("PauseCanvas").GetComponent<PauseController>();
		_timeAffected = GetComponent<TimeAffected> ();
		_timeAffected.ShadowBlinkHandler += OnShadowBlink;
		_timeAffected.PassPauseController (PauseController);
		_layeredController = GetComponent<LayeredController> ();
		_targetable = gameObject.GetComponent<Targetable> ();
		_targetable.DeathEventHandler += OnDeath;
		_camera = Camera.main.GetComponent<CameraController> ();
		_musicController = gameObject.GetComponent<MusicController> ();
		GetComponent<LayeredController> ().LayerChangedEventHandler += UpdateLayerTransparencyOnLayerChange;
		GetComponent<LayeredController> ().LayerChangedEventHandler += UpdateMusicOnLayerChange;

		_bigGearPrefab = (GameObject)Resources.Load ("BigGear");
		_smallGearPrefab = (GameObject)Resources.Load ("SmallGear");
		_bigGear = Instantiate (_bigGearPrefab).GetComponent<GearController> ();
		_bigGear.PassPauseController (PauseController);
		_smallGear = Instantiate (_smallGearPrefab).GetComponent<GearController> ();
		_smallGear.PassPauseController (PauseController);
		_bigGear.Player = this;
		_smallGear.Player = this;
		_bigGear.RotationSpeed = _bigGearDefaultRotationSpeed;
		_smallGear.RotationSpeed = _smallGearDefaultRotationSpeed;
		_bigGear.Damage = _bigGearDamage;
		_smallGear.Damage = _smallGearDamage;
        _layeredController.Initialize();

        UpdateLayerTransparencyOnLayerChange();
        SaveCheckpoint ();
	}
开发者ID:LayeredPlatformer,项目名称:LayeredPlatformerUnity,代码行数:32,代码来源:PlayerController.cs


示例3: Start

 // Use this for initialization
 void Start()
 {
     //Get PlayerController Object that already exists in the scene
     player = FindObjectOfType<PlayerController>();
     //Get CameraController Object that already exists in the scene
     camera = FindObjectOfType<CameraController>();
 }
开发者ID:DnLKnR,项目名称:Practice,代码行数:8,代码来源:LevelManager.cs


示例4: Start

    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("MainCamera");
        if (gameControllerObject != null)
        {
            camera = gameControllerObject.GetComponent<CameraController>();
        }
        if (camera == null)
        {
            Debug.Log("Cannot find Camera script");
        }

        gameControllerObject = GameObject.FindWithTag("Player");
        if (gameControllerObject != null)
        {
            player = gameControllerObject.GetComponent<PlayerController>();
        }
        if (player == null)
        {
            Debug.Log("Cannot find player script");
        }

        gameOver = false;
        restart = false;
        score = 0;
        UpdateScore();
        UpdateLives();
        //StartCoroutine(SpawnWaves());
    }
开发者ID:PCVinnie,项目名称:LavaGame,代码行数:29,代码来源:GameController.cs


示例5: Initialize

	// ================================================================
	//  Initialize
	// ================================================================
	public void Initialize (Transform _parentTransform, BGDials _bgDialsRef, CameraController _cameraControllerRef) {
		bgDialsRef = _bgDialsRef;
		cameraControllerRef = _cameraControllerRef;
		this.transform.SetParent (_parentTransform);
		
		spriteRenderer = GetComponent<SpriteRenderer> ();
		
		// Just gimmie some defaults for shiggles.
		lifetimeDuration = 5 * bgDialsRef.LifetimeScale;// * lifetimeDurationOnSpawnScale;
		vel = Vector3.zero;
//		spriteAlphaVel = 0;
		diameterVel = 0;
		rotationVel = 0;
		parallaxScale = 0;
		baseColor = Color.white;
		spriteRenderer.color = baseColor;
		GameUtils.SizeSprite (spriteRenderer, diameter,diameter);

		// Spawn and prewarm!
		Spawn ();
		timeAlive = Random.Range (0, lifetimeDuration);
		
		// Add event listeners!
//		GameManagers.Instance.EventManager.CameraPosChangedEvent += OnCameraPosChanged;
//		GameManagers.Instance.EventManager.CameraViewSectorChangedEvent += OnCameraViewSectorChanged;
//		GameManagers.Instance.EventManager.CameraZoomChangedEvent += OnCameraZoomChanged;
	}
开发者ID:BATzerk,项目名称:Unity-GGJ2016,代码行数:30,代码来源:BPBase.cs


示例6: Start

 // Use this for initialization
 void Start()
 {
     player = FindObjectOfType<PlayerController> ();
     gravityStore = player.GetComponent<Rigidbody2D> ().gravityScale;
     camera = FindObjectOfType<CameraController> ();
     healthManager = FindObjectOfType<HealthManager> ();
 }
开发者ID:faiaz-halim,项目名称:Sample,代码行数:8,代码来源:LevelManager.cs


示例7: ReadSSIDAsync

 public async Task ReadSSIDAsync()
 {
     var controller = new CameraController();
     var setting = await controller.Settings.SSID.ReadAsync();
     Assert.Equal("unknown", setting.Value.Value);
     Assert.True(setting.Value.ReadOnly);
 }
开发者ID:milliyang,项目名称:ZE1Sharp,代码行数:7,代码来源:FileSystemControllerTests.cs


示例8: Start

	// Use this for initialization
	void Start () {
		playerRB = GetComponent<Rigidbody> ();
		playerTransform = GetComponent<Transform> ();
		playerPrefix = gameObject.name;

		if ((Application.platform == RuntimePlatform.OSXEditor) || (Application.platform == RuntimePlatform.OSXPlayer)) {
			moveButtonHoriz = "HorizontalMac" + playerPrefix;
			moveButtonVert = "VerticalMac" + playerPrefix;
		} else if ((Application.platform == RuntimePlatform.WindowsEditor) || (Application.platform == RuntimePlatform.WindowsPlayer)) {
			moveButtonHoriz = "HorizontalPC" + playerPrefix;
			moveButtonVert = "VerticalPC" + playerPrefix;
		}

		if (playerPrefix == "P1") {
			camera = GameObject.Find ("CameraParentP1").GetComponent<CameraController>();
			animatorSlime = GameObject.Find("Player_blue_slime").GetComponent<Animator> ();
		} else {
			camera = GameObject.Find ("CameraParentP2").GetComponent<CameraController>();
			animatorSlime = GameObject.Find("Player_yellow_slime").GetComponent<Animator> ();
		}

		foreach (Transform child in transform) {
			if (child.name == "Player_animated") {
				animatorBody = child.GetChild(0).GetComponent<Animator> ();
			}
		}

	}
开发者ID:canadianbif,项目名称:Symbiosis,代码行数:29,代码来源:PlayerMovement.cs


示例9: PhotoCaptureWorkflow

 public PhotoCaptureWorkflow(ICameraEngineEvents callback, CameraController cameraController, int[] reviewImagePixels, Stream thumbnailStream, Stream imageStream)
     : base(callback, cameraController)
 {
     this.reviewImagePixels = reviewImagePixels;
     this.thumbnailStream = thumbnailStream;
     this.imageStream = imageStream;
 }
开发者ID:dmourainatel,项目名称:Windows-Phone-Projects,代码行数:7,代码来源:PhotoCaptureWorkflow.cs


示例10: Start

 void Start()
 {
     cameraController = FindObjectOfType<CameraController>();
     snakeStarter = FindObjectOfType<RotateForward>();
     cameraLerper = FindObjectOfType<LerpToCameraPoint>();
     StartCoroutine(rotateGlobe());
 }
开发者ID:yuvadius,项目名称:need4bit,代码行数:7,代码来源:GameStarter.cs


示例11: Start

 void Start()
 {
     rb = GetComponent<Rigidbody> ();
     homePosition = gameObject.transform.position;
     cameraController = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<CameraController> ();
     Reset ();
 }
开发者ID:dmur,项目名称:unity-playground,代码行数:7,代码来源:BallController.cs


示例12: Start

 void Start()
 {
     rigid = GetComponent<Rigidbody>();
     playerInformation = GetComponent<PlayerInformation>();
     cameraController = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraController>();
     StartCoroutine(PointToMouse());
 }
开发者ID:MelonStudios,项目名称:bacongamejam2016,代码行数:7,代码来源:PlayerController.cs


示例13: Start

    void Start()
    {
        cameraController = Camera.main.GetComponent<CameraController>();

        try {
            using (StreamReader sr = new StreamReader(Application.dataPath + "/Levels/" + "01.txt")) {
                string line;
                int gridY = gridHeight-1;

                while ((line = sr.ReadLine()) != null) {
                    // if line.Lenght != gridWidth-1 and other conditions
                    char[] chars = new char[gridWidth];
                    using (StringReader sgr = new StringReader(line)) {
                        sgr.Read(chars, 0, gridWidth);
                        int gridX = 0;
                        foreach (char c in chars) {
                            CreateInstance(c, gridX, gridY);
                            gridX++;
                        }
                    }
                    gridY--;
                }
            }
        } catch (Exception e) {
            Debug.LogException(e);
        }
    }
开发者ID:vkuzma,项目名称:loderunner,代码行数:27,代码来源:GameController.cs


示例14: Awake

 // Use this for initialization
 void Awake()
 {
     cameraController = GameObject.FindGameObjectWithTag("CameraController").GetComponent<CameraController>();
     thisCam = gameObject.GetComponentInParent<Camera>();
     myRotation = transform.rotation;
     myPosition = transform.position;
 }
开发者ID:miojow,项目名称:AwaysWatching,代码行数:8,代码来源:CameraZone.cs


示例15: Start

    // Use this for initialization
    void Start()
    {
        Collider[] colliders = Physics.OverlapSphere(transform.position, m_ExplosionRadius);

        foreach(Collider otherCollider in colliders)
        {
            ExplodingElement explodingElement = otherCollider.gameObject.GetComponent<ExplodingElement>();

            if(explodingElement != null)
            {
                explodingElement.Explode(transform.position, m_ExplosionRadius, m_ExplosionForce);
            }

            BaseHealth<int> health = otherCollider.gameObject.GetComponent<BaseHealth<int>>();
            if (health != null)
            {
                health.Damage(m_Damage);
            }
        }

        m_Camera = Camera.main.GetComponent<CameraController>();
        if (m_Camera != null)
        {
            m_Camera.Shake(m_CameraShake);
        }
    }
开发者ID:Meetic666,项目名称:OJam-2015,代码行数:27,代码来源:Explosion.cs


示例16: Start

	void Start ()
	{
		stageEnd_left = -30.0f;
		stageEnd_right = 30.0f;
		wait_for_start = true;
		firstTime = true;
		paused = false;
		GameObject mainCameraObj = GameObject.Find ("Camera");
		GameObject healthBars = GameObject.Find ("HealthBars");
		GameObject player1Obj = GameObject.Find ("Player1");
		GameObject player2Obj = GameObject.Find ("Player2");
		GameObject debugTextObj = GameObject.Find ("DebugText");
		GameObject winTextObj = GameObject.Find ("WinText");
		GameObject MIObj = GameObject.Find ("Info");

		MI_gd = MIObj.GetComponent<MenuInfo> ();
		mainCamera = mainCameraObj.GetComponent<CameraController> ();
		healthbarcontroller = healthBars.GetComponent<HealthBarController> ();
		player1 = player1Obj.GetComponent<PlayerController> ();
		player2 = player2Obj.GetComponent<PlayerController> ();
		debugText = debugTextObj.GetComponent<DebugTextController> ();
		winText = winTextObj.GetComponent<Text> ();
		Quit = KeyCode.Escape;
		start_game = KeyCode.G;
		TogglePause = KeyCode.BackQuote;
		ToggleDebugText = KeyCode.Quote;
		winText.text = "";
		winText.color = Color.white;


	}
开发者ID:rhyschris,项目名称:CS194Project,代码行数:31,代码来源:GameDelegate.cs


示例17: Start

	// Use this for initialization
	void Start ()
    {
        CameraControllerComponent = GetComponent<CameraController>();
        BackgroundSprite = BackgroundPrefab.GetComponent<SpriteRenderer>();

        Backgrounds = new List<GameObject>();

        for (int i = 1; i <= InitialBackgrounds; i++)
        {
            float floor = Mathf.FloorToInt(InitialBackgrounds / 2);
            float ceil = floor + 1;

            Vector3 Pos;
            if (i <= floor)
            {
                Pos = new Vector3(transform.position.x - (BackgroundSprite.bounds.size.x * (ceil - i)), BackgroundHeight);
            }
            else if (i > ceil)
            {
                Pos = new Vector3(transform.position.x + (BackgroundSprite.bounds.size.x * (i - ceil)), BackgroundHeight);
            }
            else
            {
                Pos = new Vector3(transform.position.x, BackgroundHeight);
            }

            Backgrounds.Add(Instantiate(BackgroundPrefab, Pos, transform.rotation) as GameObject);
        }
	}
开发者ID:Guibrush,项目名称:O.V.O.S.,代码行数:30,代码来源:BackgroundController.cs


示例18: Start

 // Use this for initialization
 void Start()
 {
     cameraRef = Camera.main.GetComponent<CameraController>();
     firstPersonHUD = GetComponentsInChildren<Canvas>();
     radar3D = GameObject.FindGameObjectWithTag("Radar3D").GetComponent<Renderer>();
     blips = GameObject.FindGameObjectsWithTag("Blip");
     laserSight = GameObject.FindGameObjectWithTag("Laser Sight").GetComponent<LineRenderer>();
 }
开发者ID:njunius,项目名称:Inure,代码行数:9,代码来源:FirstPersonUIToggle.cs


示例19: Init

 public void Init(CameraController cameraController)
 {
     this.cameraController = cameraController;
     characterController = GetComponent<CharacterController>();
     animator = transform.GetChild(0).GetComponent<Animator>();
     leftHand = transform.Find("granny1/armature/base/base.001/clavicule.L/arm.L/hand.L/Bone");
     rightHand = transform.Find("granny1/armature/base/base.001/clavicule.R/arm.R/hand.R/Bone.001");
 }
开发者ID:robinfaury,项目名称:Genevieve,代码行数:8,代码来源:Genevieve.cs


示例20: Start

	// Use this for initialization
	void Start () {
	
		player = FindObjectOfType<Player1Controller> ();
		anim = FindObjectOfType<Animator> ();
		cam = FindObjectOfType<CameraController> ();
		playerCollider = playerObj.GetComponent<Collider2D> ();
		gun = FindObjectOfType<GunManager> ();
	}
开发者ID:GooeyJooey,项目名称:PewPewRUN,代码行数:9,代码来源:LevelManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CameraManager类代码示例发布时间:2022-05-24
下一篇:
C# CameraCaptureTask类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap