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


C# CameraController类代码示例

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


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


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