public override void OnInspectorGUI() { CameraFlightFollow cam = (CameraFlightFollow)target; EditorGUILayout.Separator(); cam.control = (PlayerFlightControl)EditorGUILayout.ObjectField(new GUIContent("Flight Controller", "Drag the container object that has the Player Flight Controller here."), cam.control, typeof(PlayerFlightControl), true); cam.target = (Transform)EditorGUILayout.ObjectField(new GUIContent("Look Target", "The transform that the camera will focus on. Generally, this will be an empty game object in front of the ship a few units on the Z axis."), cam.target, typeof(Transform), true); EditorGUILayout.Separator(); GUILayout.Label(new GUIContent("Parameters", "")); cam.follow_distance = EditorGUILayout.FloatField(new GUIContent("Follow Distance", "Controls how far behind the targeter the camera will follow."), cam.follow_distance); cam.camera_elevation = EditorGUILayout.FloatField(new GUIContent("Camera Height", "Controls how high the camera will sit above the target's y coordinate."), cam.camera_elevation); cam.follow_tightness = EditorGUILayout.FloatField(new GUIContent("Follow Tightness", "Higher values will result in a snappier camera, lower values will have a camera that takes a while to catch up to the ship's movements."), cam.follow_tightness); cam.rotation_tightness = EditorGUILayout.FloatField(new GUIContent("Rotation Tightness", "Higher values will result in snappier camera rotations, lower values will have a camera that takes a while to catch up to the ship's rotations."), cam.rotation_tightness); cam.shake_on_afterburn = EditorGUILayout.BeginToggleGroup(new GUIContent("Shake on Afterburner", "The camera will shake when afterburners are engaged."), cam.shake_on_afterburn); cam.afterburner_Shake_Amount = EditorGUILayout.FloatField(new GUIContent("Shake Amount", "Amount the camera will shake when afterburners are active."), cam.afterburner_Shake_Amount); EditorGUILayout.EndToggleGroup(); cam.yawMultiplier = EditorGUILayout.FloatField(new GUIContent("Yaw Multiplier", "Affects the amount of the camera's yaw when the player turns left or right. This will usually be very small number (0.005)"), cam.yawMultiplier); if (GUI.changed) { EditorUtility.SetDirty(target); } }
void SetupPlayer(Player player) { CameraFlightFollow cameraFlight = Instantiate(playerCameraPrefab, transform, true); PlayerFlightControl flight = player.GetComponent <PlayerFlightControl>(); player.CameraFlight = cameraFlight; player.hitScanner = cameraFlight.GetComponent <HitScanner>(); player.hitScanner.player = player; cameraFlight.SetPlayerFlightControl(flight); }
public static CameraFlightFollow instance; //The instance of this class. Should only be one. void Awake() { instance = this; //Invoke("SetCamera",6); StartCoroutine(PrepareCam()); }
void Start() { groundCameraScript = GetComponent <SimpleCameraController>(); cpointer = GetComponent <CustomPointer>(); airCameraScript = GetComponent <CameraFlightFollow>(); }
public static CameraFlightFollow instance; //The instance of this class. Should only be one. void Awake() { instance = this; }
public static CustomPointer instance; //The instance of this class (Should only be one) // Use this for initialization void Awake() { pointerPosition = new Vector2(Screen.width / 2, Screen.height / 2); //Set pointer position to center of screen instance = this; camera = GetComponent <CameraFlightFollow>(); }