private void _keyReleased(FlyCamera flyCam) { if (Input.GetKeyUp(KeyCode.W)) { _flyCameraAction(flyCam, FlyCameraAction.Forward, 0); } if (Input.GetKeyUp(KeyCode.S)) { _flyCameraAction(flyCam, FlyCameraAction.Backword, 0); } if (Input.GetKeyUp(KeyCode.A)) { _flyCameraAction(flyCam, FlyCameraAction.Leftword, 0); } if (Input.GetKeyUp(KeyCode.D)) { _flyCameraAction(flyCam, FlyCameraAction.Rightword, 0); } if (Input.GetKeyUp(KeyCode.Q)) { _flyCameraAction(flyCam, FlyCameraAction.Lower, 0); } if (Input.GetKeyUp(KeyCode.E)) { _flyCameraAction(flyCam, FlyCameraAction.Rise, 0); } }
private void _keyPressed(FlyCamera flyCam) { if (Input.GetKeyDown(KeyCode.W)) { _flyCameraAction(flyCam, FlyCameraAction.Forward, 1); } if (Input.GetKeyDown(KeyCode.S)) { _flyCameraAction(flyCam, FlyCameraAction.Backword, 1); } if (Input.GetKeyDown(KeyCode.A)) { _flyCameraAction(flyCam, FlyCameraAction.Leftword, 1); } if (Input.GetKeyDown(KeyCode.D)) { _flyCameraAction(flyCam, FlyCameraAction.Rightword, 1); } if (Input.GetKeyDown(KeyCode.Q)) { _flyCameraAction(flyCam, FlyCameraAction.Lower, 1); } if (Input.GetKeyDown(KeyCode.E)) { _flyCameraAction(flyCam, FlyCameraAction.Rise, 1); } }
private void Awake() { flyCamera = Camera.main.GetComponent <FlyCamera> (); flyCamera.enabled = false; orbitCamera = Camera.main.GetComponent <OrbitCamera> (); orbitCamera.enabled = true; }
public override void OnInspectorGUI() { base.OnInspectorGUI(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Camera animation utility", EditorStyles.boldLabel); speed = EditorGUILayout.FloatField("Speed", speed); FlyCamera targetCam = (FlyCamera)target; if (GUILayout.Button("First position")) { firstPos = targetCam.transform.position; } if (GUILayout.Button("Second position")) { secondPos = targetCam.transform.position; } if (GUILayout.Button("Play")) { EditorCoroutineUtility.StartCoroutine(AnimationCoroutine(targetCam.transform), this); } }
void Start() { addTestLevels(); _camera = Camera.main.GetComponent <FlyCamera>(); LoadNextLevel(); }
public CameraController(Camera camera, float distance) { this.camera = camera; this.distance = distance; flyCamera = new FlyCamera(camera, distance); SetDefaultCameraPosition(); EditFarPlane(); }
private void Start() { walkController = GetComponent <RigidbodyFirstPersonController>(); headbobController = GetComponentInChildren <HeadBob>(); flyController = GetComponent <FlyCamera>(); playerRigidbody = GetComponent <Rigidbody>(); //FreezePlayer(); SetPlayerMode(false); }
private void Start() { flyCamera = GetComponent <FlyCamera>(); robotManager = GetComponentInChildren <RSManager>(); robotManager.isRed = isRed; if (isLaborer) { robotManager.Invoke("Die", 0.2f); } }
static void _wheelScrooled(FlyCamera flyCam) { float amount = Input.GetAxis("Mouse ScrollWheel"); if (amount > 0) { _flyCameraAction(flyCam, FlyCameraAction.ZoomIn, (float)amount); } else if (amount < 0) { _flyCameraAction(flyCam, FlyCameraAction.ZoomOut, -(float)amount); } }
// Use this for initialization void Start() { goWall = GameObject.Find("phxx3f3/1Walls"); SetTransparent(); goFlyController = GameObject.Find("FlyController"); goClassroomVp = GameObject.Find("ViewPoints/Classroom"); goCornerVp = GameObject.Find("ViewPoints/Corner"); goSquareVp = GameObject.Find("ViewPoints/Square"); cmpFlyCamera = goFlyController.GetComponent<FlyCamera>(); //start point : class room goFlyController.transform.position = goClassroomVp.transform.position; cmpFlyCamera.rotationX = goClassroomVp.transform.localScale.x; cmpFlyCamera.rotationY = goClassroomVp.transform.localScale.y; }
static void _mouseMoved(FlyCamera flyCam, int x, int y) { if (Input.GetKeyDown(KeyCode.Mouse1)) { flyCam._rightMouseDown = true; flyCam._oldMouseX = x; flyCam._oldMouseY = y; } if (Input.GetKeyUp(KeyCode.Mouse1)) { flyCam._rightMouseDown = false; } float aspect = 1;//flyCam._camera.aspect; if (flyCam._rightMouseDown && (flyCam._oldMouseX != x || flyCam._oldMouseY != y)) { int offsetX = x - flyCam._oldMouseX; int offsetY = y - flyCam._oldMouseY; if (offsetX > 0) { _flyCameraAction(flyCam, FlyCameraAction.Right, offsetX / 10.0f); } else { _flyCameraAction(flyCam, FlyCameraAction.Left, -offsetX / 10.0f); } if (offsetY > 0) { _flyCameraAction(flyCam, FlyCameraAction.Down, offsetY / 10.0f / aspect); } else { _flyCameraAction(flyCam, FlyCameraAction.Up, -offsetY / 10.0f / aspect); } } flyCam._oldMouseX = x; flyCam._oldMouseY = y; }
// switch the camera to flying object and activate it void switchCam() { Cam main_cam = cam.GetComponent <Cam> (); FlyCamera f_cam = flycam.GetComponent <FlyCamera> (); if (main_cam.shark_obj.selected) { f_cam.obj_num = 1; } else if (main_cam.barn_obj.selected) { f_cam.obj_num = 2; } else if (main_cam.barn_obj.transform.FindChild("cow").gameObject.GetComponent <Cow> ().selected) { f_cam.obj_num = 3; } else { return; } flycam.gameObject.SetActive(true); cam.gameObject.SetActive(false); }
void Start() { flyCamera = GetComponentInChildren <FlyCamera>(); }
// Use this for initialization void Start() { cam = FindObjectOfType <FlyCamera>(); create = FindObjectOfType <Create>(); }
void Start() { robotManager = GetComponentInParent <RSController>(); flyCamera = GetComponentInChildren <FlyCamera>(); isSplitScreen = InitialSpawnManager.instance.isSplitScreen; }
void Start() { Instance = this; Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; }
// Use this for initialization void Start() { flyCam = GetComponent <FlyCamera>(); }
void Start() { script = follower.GetComponent <FlyCamera>(); }
static void _flyCameraAction(FlyCamera flyCam, FlyCameraAction action, float value) { flyCam._actionStatus[(int)action] = value; }
// Use this for initialization void Start() { options = GetComponent <OptionsManager>(); cam = FindObjectOfType <FlyCamera>(); @throw = FindObjectOfType <Throw>(); }
/// <summary> /// Setup the example. /// </summary> public override void Setup() { _scene = new Scene(); _rand = new Random(); _contentManager = new ContentManager(XnaRenderer.Instance.Services, GLabController.Instance.HomeDirectory + "\\Data\\FractalTerrain"); _psf = new PlatonicSolidFactory(XnaRenderer.Instance); _matrixStack = new MatrixStack(); filename = InputHelper.LoadFileDialog("Load LIN-File"); if (filename == "") { return; } _lindenmayerSystem = GLabReader.ReadLindenmayerSystemFromFile(filename); if (filename.Contains("1_")) { _pos = new Vector3(0, 0, Math.Abs(_lindenmayerSystem.CoordinateSystem.MaxX) + Math.Abs(_lindenmayerSystem.CoordinateSystem.MinX)); } if (filename.Contains("2_")) { _pos = new Vector3(0, 0, 3); } if (filename.Contains("3_")) { _pos = new Vector3(3, 5, 3); } flow = new FrmFlowControl(); // Breite und Länge initialisieren _vecStart = new Vector3(0, 0, 0); Vector3 pos = _pos; // new Vector3(0, 0, 5); Vector3 lookAt = Vector3.Zero; Vector3 up = Vector3.UnitY; //_polarCamera = new PolarCamera(); //_polarCamera.SetLookAt(pos, lookAt, up); //_polarCamera.ActivateControl(); //_polarCamView = new RenderView(512, 512, _scene, _polarCamera, // "Polar Camera"); //Logger.Instance.LogInfo( // "Controls (Polar Camera): <W>, <A>, <S>, <D>, <Q>, <E> and mouse movement (while left or right clicking)."); _flyCamera = new FlyCamera(); _flyCamera.ActivateControl(); _flyCamera.SetLookAt(pos, lookAt, up); _flyCamera.Movement = 0.2f; _flyCamView = new RenderView(256, 256, _scene, _flyCamera, "Fly Camera"); Logger.Instance.LogInfo( "Controls (Fly Camera): <W>, <A>, <S>, <D>, <Q>, <E> and mouse movement (while left clicking). Use <R> to reset the camera to the initial position."); //XnaRenderer.Instance.Views.Add(_polarCamView); XnaRenderer.Instance.Views.Add(_flyCamView); Start(); _scene.RenderCoordinateAxes = false; flow.StepCount = 1; currentAxiom = _lindenmayerSystem.Axiom; int iStep = 11; while (true) { iStep++; nextGeneration(_scene, 0, iStep, currentAxiom); flow.Wait(); Logger.Instance.LogInfo("" + iStep); } }
private void Start() { flyCamera = GetComponent <FlyCamera>(); robotManager = GetComponentInChildren <RSManager>(); robotManager.isRed = isRed; }
private void Awake() { Instance = this; }