本文整理汇总了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>();
}
示例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 ();
}
示例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>();
}
示例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());
}
示例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;
}
示例6: Start
// Use this for initialization
void Start()
{
player = FindObjectOfType<PlayerController> ();
gravityStore = player.GetComponent<Rigidbody2D> ().gravityScale;
camera = FindObjectOfType<CameraController> ();
healthManager = FindObjectOfType<HealthManager> ();
}
示例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);
}
示例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> ();
}
}
}
示例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;
}
示例10: Start
void Start()
{
cameraController = FindObjectOfType<CameraController>();
snakeStarter = FindObjectOfType<RotateForward>();
cameraLerper = FindObjectOfType<LerpToCameraPoint>();
StartCoroutine(rotateGlobe());
}
示例11: Start
void Start()
{
rb = GetComponent<Rigidbody> ();
homePosition = gameObject.transform.position;
cameraController = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<CameraController> ();
Reset ();
}
示例12: Start
void Start()
{
rigid = GetComponent<Rigidbody>();
playerInformation = GetComponent<PlayerInformation>();
cameraController = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraController>();
StartCoroutine(PointToMouse());
}
示例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);
}
}
示例14: Awake
// Use this for initialization
void Awake()
{
cameraController = GameObject.FindGameObjectWithTag("CameraController").GetComponent<CameraController>();
thisCam = gameObject.GetComponentInParent<Camera>();
myRotation = transform.rotation;
myPosition = transform.position;
}
示例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);
}
}