void Start() { cameraRotate = this; player = transform.parent.gameObject; cam = gameObject; rotY = transform.eulerAngles.y; tmpRotY = rotY; widthResolution = Screen.width; }
// Update is called once per frame void Update() { Rigidbody rigb = this.GetComponent <Rigidbody>(); CameraRotate camRot = FindObjectOfType <CameraRotate>(); if (Input.GetKey(KeyCode.A)) { if (camRot.Orientation == TowerOrientation.FRONT) { rigb.MovePosition(transform.position + new Vector3(-speed, 0.0f, 0.0f) * Time.deltaTime); } else if (camRot.Orientation == TowerOrientation.LEFT) { rigb.MovePosition(transform.position + new Vector3(0, 0, speed) * Time.deltaTime); } else if (camRot.Orientation == TowerOrientation.RIGHT) { rigb.MovePosition(transform.position + new Vector3(0, 0, -speed) * Time.deltaTime); } else if (camRot.Orientation == TowerOrientation.BACK) { rigb.MovePosition(transform.position + new Vector3(speed, 0.0f, 0.0f) * Time.deltaTime); } } if (Input.GetKey(KeyCode.D)) { if (camRot.Orientation == TowerOrientation.FRONT) { rigb.MovePosition(transform.position + new Vector3(speed, 0.0f, 0.0f) * Time.deltaTime); } else if (camRot.Orientation == TowerOrientation.LEFT) { rigb.MovePosition(transform.position + new Vector3(0, 0, -speed) * Time.deltaTime); } else if (camRot.Orientation == TowerOrientation.RIGHT) { rigb.MovePosition(transform.position + new Vector3(0, 0, speed) * Time.deltaTime); } else if (camRot.Orientation == TowerOrientation.BACK) { rigb.MovePosition(transform.position + new Vector3(-speed, 0.0f, 0.0f) * Time.deltaTime); } } if (Input.GetKeyDown(KeyCode.Space)) { if (!isJump) { isJump = true; rigb.AddForce(new Vector3(0, 300, 0)); } } if (rigb.velocity == Vector3.zero) { isJump = false; } }
// Use this for initialization void Start() { mainMenuUI = GameObject.FindGameObjectWithTag("MainMenuUI").GetComponent <MainMenuUI>(); camRot = GameObject.FindGameObjectWithTag("CameraRotation").GetComponent <CameraRotate>(); // endGame = GameObject.FindGameObjectWithTag("EndGame").GetComponent<EndGame>(); originPosition = new Vector2(transform.position.x, transform.position.y); camRot.enabled = false; playerRotStartTime = Time.time; playerRotJourneyLength = Quaternion.Angle(playerRotStartMarker.rotation, playerRotEndMarker.rotation); colourCorrectionCurve = GetComponentInChildren <ColorCorrectionCurves>(); }
void Awake() { // grab the rotator, unused as of week 1 theRotator = GetComponent <CameraRotate> (); rotatedOffset = offset; }
void Awake() { Instance = this; }
private void Awake() { instance = this; }
void Awake() { _instance = this; }
// Start is called before the first frame update void Start() { mc = Camera.main.GetComponent <Camera>(); cr = Camera.main.GetComponent <CameraRotate>(); }
void Start() { Cursor.visible = true; cameraFollowDevice = FindObjectOfType<LerpToCameraPoint>(); cameraDevice = FindObjectOfType<CameraRotate>(); cameraHeightDevice = FindObjectOfType<CameraHeight>(); cameraSkewDevice = FindObjectOfType<CameraSkew>(); prev1 = lerpSpeed; prev2 = maxCameraLayback; prev3 = maxLaybackTurnSpeed; prev4 = turnAccelarationZero; prev5 = turnAccelarationMax; prev6 = cameraHeightAtGlobeLevel; prev7 = cameraHeightAtMaxLevel; prev8 = skewAngleAtGlobeLevel; prev9 = skewAngleAtMaxLevel; cameraHeightDevice.set_height_at_globe_level(cameraHeightAtGlobeLevel); cameraHeightDevice.set_height_at_max_level(cameraHeightAtMaxLevel); cameraFollowDevice.set_lerp_speed(lerpSpeed); cameraDevice.set_max_camera_layback(maxCameraLayback); cameraDevice.set_max_layback_turn_speed(maxLaybackTurnSpeed); cameraDevice.set_turn_accelaration_zero(turnAccelarationZero); cameraDevice.set_turn_accelaration_max(turnAccelarationMax); cameraSkewDevice.set_skew_angle_at_global_level(skewAngleAtGlobeLevel); cameraSkewDevice.set_skew_angle_at_max_level(skewAngleAtMaxLevel); }
void Start() { parentRotation = transform.parent.GetComponent <CameraRotate>(); originalParentForward = parentRotation.transform.forward; }
void Start() { readyRotation = GetComponent <CameraRotate>(); originalForward = transform.forward; }
// Use this for initialization void Start() { cam = GetComponent <CameraRotate>(); }