├── .gitignore ├── Assets ├── Scripts.meta ├── Scripts │ ├── Bezier.cs │ ├── Bezier.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── BezierEditor.cs │ │ ├── BezierEditor.cs.meta │ │ ├── LineEditor.cs │ │ ├── LineEditor.cs.meta │ │ ├── SplineEditor.cs │ │ └── SplineEditor.cs.meta │ ├── Line.cs │ ├── Line.cs.meta │ ├── Spline.cs │ ├── Spline.cs.meta │ ├── SplineUtils.meta │ └── SplineUtils │ │ ├── FadeOut.mat │ │ ├── FadeOut.mat.meta │ │ ├── SplineCameraFollower.cs │ │ └── SplineCameraFollower.cs.meta ├── Test_Scene.unity └── Test_Scene.unity.meta └── ProjectSettings ├── AudioManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityAnalyticsManager.asset /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | 6 | # Autogenerated VS/MD solution and project files 7 | *.csproj 8 | *.unityproj 9 | *.sln 10 | *.suo 11 | *.tmp 12 | *.user 13 | *.userprefs 14 | *.pidb 15 | *.booproj 16 | 17 | # Unity3D generated meta files 18 | *.pidb.meta 19 | 20 | # Unity3D Generated File On Crash Reports 21 | sysinfo.txt -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0c2ed413a06c49e8a5593282bec5082 3 | folderAsset: yes 4 | timeCreated: 1445394719 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Bezier.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class Bezier : MonoBehaviour { 4 | 5 | public Vector3 p0, p1, p2, p3; 6 | 7 | public void Reset() { 8 | p0 = new Vector3(1,0,0); 9 | p1 = new Vector3(2,0,0); 10 | p2 = new Vector3(3,0,0); 11 | p3 = new Vector3(4,0,0); 12 | } 13 | 14 | public Vector3 GetPoint(float t) { 15 | return transform.TransformPoint(PointOnBezier(p0,p1,p2,p3,t)); 16 | } 17 | 18 | public Vector3 GetDirection(float t) { 19 | return DerivOnBezier(p0,p1,p2,p3,t).normalized; 20 | } 21 | 22 | // Second Order (Three point / parabolic) bezier solver. 23 | // Equation: (1-t)^2*P_0 + 2*t*(1-t)*P_1 + t^2*P_2 24 | public static Vector3 PointOnBezier(Vector3 p0, Vector3 p1, Vector3 p2, float t) { 25 | return (1-t)*(1-t)*p0 + 2*t*(1-t)*p1 + t*t*p2; 26 | } 27 | 28 | // First derivative of Second Order (Three point / parabolic) bezier solver. 29 | // Equation: 2*(P_1-P_0)*(1-t) + 2*t*(P_2-P_1) 30 | public static Vector3 DerivOnBezier(Vector3 p0, Vector3 p1, Vector3 p2, float t) { 31 | return 2*(1-t)*(p1-p0) + 2*t*(p2-p1); 32 | } 33 | 34 | // Third Order (Four point) bezier solver 35 | // Equation: (1-t)^3*P_0 + 3*t*(1-t)^2*P_1 + 3*t^2*(1-t)*P_2 + t^3*P_3 36 | public static Vector3 PointOnBezier(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t) { 37 | return (1-t)*(1-t)*(1-t)*p0 + 3*t*(1-t)*(1-t)*p1 + 3*t*t*(1-t)*p2 + t*t*t*p3; 38 | } 39 | 40 | // First derivative of Third Order (Four point) bezier solver. 41 | // Equation: 3*(1-t)^2*(P_1-P_0) + 6*t*(1-t)*(P_2-P_1) + 3*t^2*(P_3-P_2) 42 | public static Vector3 DerivOnBezier(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t) { 43 | return 3*(1-t)*(1-t)*(p1-p0) + 6*t*(1-t)*(p2-p1) + 3*t*t*(p3-p2); 44 | } 45 | 46 | // Finds the value t after moving a "real" distance `dist`. This can be used to move along a curve at a constant 47 | // velocity. 48 | public static float GetTWithRealDistance(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t0, float dist) { 49 | return dist / DerivOnBezier(p0,p1,p2,p3,t0).magnitude; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Assets/Scripts/Bezier.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5c6ead6be99047c1ac5f00f7ef1f799 3 | timeCreated: 1445395080 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb95147d504aa4fb69b9d6b00bce9ea3 3 | folderAsset: yes 4 | timeCreated: 1445394719 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/BezierEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | [CustomEditor(typeof(Bezier))] 5 | public class BezierEditor : Editor { 6 | 7 | private const int curve_draw_iter = 20; 8 | 9 | private void OnSceneGUI() { 10 | Bezier b = target as Bezier; 11 | Transform tr = b.transform; 12 | Quaternion r = Tools.pivotRotation == PivotRotation.Local ? tr.rotation : Quaternion.identity; 13 | 14 | Vector3 p0 = tr.TransformPoint(b.p0); 15 | Vector3 p1 = tr.TransformPoint(b.p1); 16 | Vector3 p2 = tr.TransformPoint(b.p2); 17 | Vector3 p3 = tr.TransformPoint(b.p3); 18 | 19 | Handles.color = Color.white; 20 | 21 | float t = 0; 22 | Vector3 prev = p0; 23 | for(int x=1;x<=curve_draw_iter;x++) { 24 | t = (float)x / (float)curve_draw_iter; 25 | 26 | Vector3 next = Bezier.PointOnBezier(p0,p1,p2,p3,t); 27 | Handles.DrawLine(prev,next); 28 | prev = next; 29 | } 30 | 31 | EditorGUI.BeginChangeCheck(); 32 | p0 = Handles.DoPositionHandle(p0, r); 33 | if (EditorGUI.EndChangeCheck()) { 34 | Undo.RecordObject(b, "Move Point"); 35 | EditorUtility.SetDirty(b); 36 | b.p0 = tr.InverseTransformPoint(p0); 37 | } 38 | 39 | EditorGUI.BeginChangeCheck(); 40 | p1 = Handles.DoPositionHandle(p1, r); 41 | if (EditorGUI.EndChangeCheck()) { 42 | Undo.RecordObject(b, "Move Point"); 43 | EditorUtility.SetDirty(b); 44 | b.p1 = tr.InverseTransformPoint(p1); 45 | } 46 | 47 | EditorGUI.BeginChangeCheck(); 48 | p2 = Handles.DoPositionHandle(p2, r); 49 | if (EditorGUI.EndChangeCheck()) { 50 | Undo.RecordObject(b, "Move Point"); 51 | EditorUtility.SetDirty(b); 52 | b.p2 = tr.InverseTransformPoint(p2); 53 | } 54 | 55 | EditorGUI.BeginChangeCheck(); 56 | p3 = Handles.DoPositionHandle(p3, r); 57 | if (EditorGUI.EndChangeCheck()) { 58 | Undo.RecordObject(b, "Move Point"); 59 | EditorUtility.SetDirty(b); 60 | b.p3 = tr.InverseTransformPoint(p3); 61 | } 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/BezierEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 829d7563bf45347c59db31a94efae1ce 3 | timeCreated: 1445397293 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/LineEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | [CustomEditor(typeof(Line))] 5 | public class LineEditor : Editor { 6 | private void OnSceneGUI() { 7 | Line line = target as Line; 8 | Transform t = line.transform; 9 | Quaternion r = Tools.pivotRotation == PivotRotation.Local ? t.rotation : Quaternion.identity; 10 | 11 | Vector3 p0 = t.TransformPoint(line.p0); 12 | Vector3 p1 = t.TransformPoint(line.p1); 13 | 14 | Handles.color = Color.white; 15 | Handles.DrawLine(p0, p1); 16 | 17 | EditorGUI.BeginChangeCheck(); 18 | p0 = Handles.DoPositionHandle(p0, r); 19 | if (EditorGUI.EndChangeCheck()) { 20 | Undo.RecordObject(line, "Move Point"); 21 | EditorUtility.SetDirty(line); 22 | line.p0 = t.InverseTransformPoint(p0); 23 | } 24 | 25 | EditorGUI.BeginChangeCheck(); 26 | p1 = Handles.DoPositionHandle(p1, r); 27 | if (EditorGUI.EndChangeCheck()) { 28 | Undo.RecordObject(line, "Move Point"); 29 | EditorUtility.SetDirty(line); 30 | line.p1 = t.InverseTransformPoint(p1); 31 | } 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /Assets/Scripts/Editor/LineEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb4129ad0fac84bb6998156b25cb2910 3 | timeCreated: 1445394726 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/SplineEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | [CustomEditor(typeof(Spline))] 5 | public class SplineEditor : Editor { 6 | 7 | private const int curve_draw_iter = 20; 8 | 9 | private Spline spline; 10 | private Quaternion rot; 11 | private Transform tr; 12 | 13 | private void OnSceneGUI() { 14 | spline = target as Spline; 15 | tr = spline.transform; 16 | rot = Tools.pivotRotation == PivotRotation.Local ? tr.rotation : Quaternion.identity; 17 | 18 | Handles.color = Color.white; 19 | 20 | int num_curves = spline.GetCurveCount(); 21 | float t = 0; 22 | Vector3 prev = spline.GetControlPoint(0); 23 | for(int i=0;i= points.Length) 74 | return transform.TransformPoint(points[points.Length-1]); 75 | if(base_coord < 0) 76 | return transform.TransformPoint(points[0]); 77 | 78 | Vector3 p0 = points[base_coord]; 79 | Vector3 p1 = points[base_coord + 1]; 80 | Vector3 p2 = points[base_coord + 2]; 81 | Vector3 p3 = points[base_coord + 3]; 82 | 83 | return Bezier.PointOnBezier(p0,p1,p2,p3,t_sub); 84 | } 85 | 86 | public Vector3 GetDeriv(float t) { 87 | return transform.TransformDirection(GetDerivRaw(t)); 88 | } 89 | 90 | private Vector3 GetDerivRaw(float t) { 91 | int base_coord = (int)t * 3; 92 | if(base_coord+4 > points.Length || base_coord < 0) 93 | return Vector3.zero; 94 | float t_sub = t-(int)t; 95 | 96 | return Bezier.DerivOnBezier(points[base_coord],points[base_coord+1],points[base_coord+2],points[base_coord+3],t_sub); 97 | } 98 | 99 | public Vector3 GetDirection(float t) { 100 | return GetDeriv(t).normalized; 101 | } 102 | 103 | private Vector3 GetDirectionRaw(float t) { 104 | return GetDerivRaw(t).normalized; 105 | } 106 | 107 | // ------- SPLINE EDITING TOOLS ------- // 108 | 109 | public int GetControlPointCount() { 110 | return (points.Length-1)/3+1; 111 | } 112 | 113 | public int GetCurveCount() { 114 | return (points.Length-1)/3; 115 | } 116 | 117 | private Vector3? GetControlPointRaw(int index) { 118 | if(Loop && index == GetControlPointCount()-1) 119 | index = 0; 120 | 121 | if(index < 0 || index >= points.Length-1) 122 | return null; 123 | 124 | return points[index*3]; 125 | } 126 | 127 | public Vector3 GetControlPoint(int index) { 128 | Vector3? raw = GetControlPointRaw(index); 129 | if(raw == null) 130 | return Vector3.zero; 131 | return transform.TransformPoint((Vector3)raw); 132 | } 133 | 134 | private Vector3? GetHandleRaw(int index, bool left) { 135 | if(Loop && index == 0 && left) 136 | index = GetControlPointCount()-1; 137 | if(Loop && index == GetControlPointCount()-1 && !left) 138 | index = 0; 139 | int ind = index*3 + (left ? -1 : 1); 140 | 141 | if(ind < 0 || ind >= points.Length-1) 142 | return null; 143 | 144 | return points[ind]; 145 | } 146 | 147 | public Vector3 GetHandle(int index, bool left) { 148 | Vector3? raw = GetHandleRaw(index,left); 149 | if(raw == null) 150 | return Vector3.zero; 151 | return transform.TransformPoint((Vector3)raw); 152 | } 153 | 154 | public void SetControlPointRaw(int index, Vector3 point) { 155 | if(Loop && index == GetControlPointCount()-1) 156 | index = 0; 157 | 158 | if(index < 0 || index >= GetControlPointCount()) 159 | return; 160 | 161 | // 1. Move all of the handles over along with the control point 162 | Vector3? og = GetControlPointRaw(index); 163 | Vector3? diff = point-og; 164 | Vector3? left = GetHandleRaw(index,true); 165 | Vector3? right = GetHandleRaw(index,false); 166 | if(left != null) 167 | SetHandleRaw(index,true,(Vector3)(left+diff)); 168 | if(right != null) 169 | SetHandleRaw(index,false, (Vector3)(right +diff)); 170 | 171 | // 2. Actually set the point 172 | points[index*3] = point; 173 | if (Loop && index == 0) 174 | points[points.Length - 1] = point; 175 | } 176 | 177 | public void SetControlPoint(int index, Vector3 point) { 178 | SetControlPointRaw(index,transform.InverseTransformPoint(point)); 179 | } 180 | 181 | public void SetHandle(int index, bool left, Vector3 point) { 182 | SetHandleRaw(index,left,transform.InverseTransformPoint(point)); 183 | } 184 | 185 | private void SetHandleRaw(int index, bool left, Vector3 point, bool enforce_constraint = true) 186 | { 187 | if (Loop && index == 0 && left) 188 | index = GetControlPointCount() - 1; 189 | else if (Loop && index == GetControlPointCount() - 1 && !left) 190 | index = 0; 191 | 192 | int ind = index * 3 + (left ? -1 : 1); 193 | 194 | points[ind] = point; 195 | 196 | if(enforce_constraint) 197 | EnforceConstraint(index, left ? ConstraintEnforcementType.Left : ConstraintEnforcementType.Right); 198 | } 199 | 200 | public HandleConstraint GetConstraint(int index) { 201 | return constraints[index]; 202 | } 203 | 204 | public void SetConstraint(int index, HandleConstraint constraint) { 205 | constraints[index] = constraint; 206 | if (Loop && index == 0) 207 | constraints[constraints.Length - 1] = constraint; 208 | if (Loop && index == constraints.Length - 1) 209 | constraints[0] = constraint; 210 | 211 | EnforceConstraint(index, ConstraintEnforcementType.Average); 212 | } 213 | 214 | private void EnforceConstraint(int index, ConstraintEnforcementType type) { 215 | if(!Loop && (index == 0 || index == GetControlPointCount()-1)) 216 | return; 217 | 218 | Vector3? control = GetControlPointRaw(index); 219 | Vector3? left = GetHandleRaw(index,true); 220 | Vector3? right = GetHandleRaw(index, false); 221 | 222 | Vector3? diff_l = left-control; 223 | float mag_l = ((Vector3)diff_l).magnitude; 224 | Vector3? diff_r = right-control; 225 | float mag_r = ((Vector3)diff_r).magnitude; 226 | 227 | Vector3 dir_r = Vector3.zero; 228 | switch(type) 229 | { 230 | case ConstraintEnforcementType.Left: 231 | dir_r = (Vector3) (-diff_l / mag_l); 232 | break; 233 | case ConstraintEnforcementType.Right: 234 | dir_r = (Vector3)(diff_r / mag_r); 235 | break; 236 | case ConstraintEnforcementType.Average: 237 | dir_r = Vector3.Slerp((Vector3)(diff_r / mag_r), (Vector3)(-diff_l / mag_l), 0.5f); 238 | break; 239 | } 240 | 241 | switch(constraints[index]) { 242 | case HandleConstraint.Aligned: 243 | SetHandleRaw(index,false, (Vector3)(control + mag_r*dir_r),false); 244 | SetHandleRaw(index,true,(Vector3)(control - mag_l*dir_r), false); 245 | break; 246 | case HandleConstraint.Mirrored: 247 | float mag_avg = (mag_l+mag_r)/2f; 248 | SetHandleRaw(index, false, (Vector3)(control + mag_avg*dir_r), false); 249 | SetHandleRaw(index, true, (Vector3)(control - mag_avg*dir_r), false); 250 | break; 251 | } 252 | } 253 | 254 | // ------- CURVE ADDITION / DELETION OPERATIONS ------- // 255 | 256 | public void AddCurve() { 257 | if(Loop) 258 | return; 259 | 260 | Array.Resize(ref points, points.Length+3); 261 | Array.Resize(ref constraints, constraints.Length+1); 262 | 263 | points[points.Length-1] = points[points.Length-4] + Vector3.right*3; 264 | points[points.Length-2] = points[points.Length-4] + Vector3.right*2; 265 | points[points.Length-3] = points[points.Length-4] + Vector3.right; 266 | 267 | EnforceConstraint(GetControlPointCount()-1, ConstraintEnforcementType.Average); 268 | } 269 | 270 | public void AddCurveBeginning() { 271 | if(Loop) 272 | return; 273 | 274 | Vector3 point = points[0]; 275 | Vector3 deriv = GetDerivRaw(0); 276 | 277 | Array.Resize(ref points, points.Length+3); 278 | Array.Resize(ref constraints, constraints.Length+1); 279 | ShiftArray(ref points, 3, 0); 280 | ShiftArray(ref constraints, 1, 0); 281 | 282 | points[0] = point - 3*deriv; 283 | points[1] = point - 2*deriv; 284 | points[2] = point-deriv; 285 | 286 | constraints[0] = HandleConstraint.Free; 287 | 288 | EnforceConstraint(0, ConstraintEnforcementType.Average); 289 | } 290 | 291 | public void RemoveCurve(int elt) { 292 | if(elt*3 > points.Length) 293 | return; 294 | 295 | if(elt*3 != points.Length) { 296 | ShiftArray(ref points, -3, elt*3-1); 297 | ShiftArray(ref constraints, -1, elt); 298 | } 299 | 300 | Array.Resize(ref points, points.Length-3); 301 | Array.Resize(ref constraints, constraints.Length-1); 302 | } 303 | 304 | // Subdivides a curve to the left - that is, adds a curve in between the left curve of the `elt` curve and the `elt` curve 305 | // elt is 0 indexed 306 | public void SubdivideCurve(int elt) { 307 | if(Loop && elt == 0) 308 | elt = GetControlPointCount()-1; 309 | if(elt*3 > points.Length && elt != 0) 310 | return; 311 | 312 | Vector3 point = GetPointRaw((float)elt-0.5f); 313 | Vector3 deriv = GetDirectionRaw((float)elt-0.5f); 314 | 315 | Array.Resize(ref points, points.Length+3); 316 | ShiftArray(ref points, 3, elt*3-1); 317 | 318 | Array.Resize(ref constraints, constraints.Length+1); 319 | ShiftArray(ref constraints, 1, elt); 320 | 321 | points[elt*3] = point; 322 | points[elt*3+1] = point+deriv; 323 | points[elt*3-1] = point-deriv; 324 | constraints[elt] = HandleConstraint.Aligned; 325 | } 326 | 327 | private void ShiftArray(ref T[] arr, int shift, int first) { 328 | bool r = shift > 0; 329 | shift = Mathf.Abs(shift); 330 | if(r) { 331 | for(int x=arr.Length-1;x >= first && x >= shift;x--) 332 | arr[x] = arr[x-shift]; 333 | } else { 334 | for(int x=first;x().material; 22 | ApplyShot(); 23 | } 24 | 25 | void Update () { 26 | ApplyShot(); 27 | HandleShotState(); 28 | 29 | if (CurrentFade != FadeState.None) 30 | { 31 | Color col = FadeMaterial.GetColor("_Color"); 32 | float alpha = Mathf.Clamp01((Time.time - FadeStartTime) / FadeLength); 33 | 34 | if (CurrentFade == FadeState.FadeIn) 35 | alpha = 1 - alpha; 36 | 37 | col.a = alpha; 38 | FadeMaterial.SetColor("_Color", col); 39 | } 40 | } 41 | 42 | private void HandleShotState() 43 | { 44 | if (CurrentFade == FadeState.None) 45 | { 46 | SplineProgress += (Shots[CurrentShot].Velocity / Shots[CurrentShot].Path.GetDeriv(SplineProgress).magnitude)*Time.deltaTime; 47 | Vector3 diff = Shots[CurrentShot].Path.GetPoint(Shots[CurrentShot].Path.GetCurveCount()) 48 | - Shots[CurrentShot].Path.GetPoint(SplineProgress); 49 | 50 | if ((float)Shots[CurrentShot].Path.GetCurveCount() - SplineProgress < 0.05f) 51 | { 52 | CurrentFade = FadeState.FadeOut; 53 | FadeStartTime = Time.time; 54 | } 55 | } 56 | else if (Time.time >= FadeStartTime + FadeLength) 57 | { 58 | if (CurrentFade == FadeState.FadeIn) 59 | { 60 | FadeStartTime = -1; 61 | CurrentFade = FadeState.None; 62 | } else 63 | { 64 | CurrentShot++; 65 | CurrentShot %= Shots.Length; 66 | SplineProgress = 0; 67 | FadeStartTime = Time.time; 68 | 69 | CurrentFade = FadeState.FadeIn; 70 | } 71 | } 72 | } 73 | 74 | private void ApplyShot() { 75 | Camera.position = Shots[CurrentShot].Path.GetPoint(SplineProgress); 76 | if(Shots[CurrentShot].LookAt != null) 77 | Camera.LookAt(Shots[CurrentShot].LookAt); 78 | else 79 | Camera.rotation = Quaternion.LookRotation(Shots[CurrentShot].Path.GetDirection(SplineProgress)); 80 | } 81 | 82 | [System.Serializable] 83 | public class CameraShot { 84 | public Transform LookAt; 85 | public Spline Path; 86 | public float Velocity; 87 | } 88 | 89 | private enum FadeState 90 | { 91 | FadeOut, FadeIn, None 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Assets/Scripts/SplineUtils/SplineCameraFollower.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc626c25634594027ae5c7bfbc02f1a1 3 | timeCreated: 1445974525 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Test_Scene.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/Assets/Test_Scene.unity -------------------------------------------------------------------------------- /Assets/Test_Scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07137cd1fb7a3484eb0f4f90f82050d0 3 | timeCreated: 1445875056 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.2.1f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/UnityAdsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityAnalyticsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Flafla2/Unity-Splines/289947d8a8c7697ed13509dde51e33d5accdc468/ProjectSettings/UnityAnalyticsManager.asset --------------------------------------------------------------------------------