├── .gitignore ├── Assets ├── Tutorial Part 1, 2, and 3 - basics.meta ├── Tutorial Part 1, 2, and 3 - basics │ ├── Bullet no rigidbody.prefab │ ├── Bullet no rigidbody.prefab.meta │ ├── Bullet.prefab │ ├── Bullet.prefab.meta │ ├── BulletData.cs │ ├── BulletData.cs.meta │ ├── BulletPhysics.cs │ ├── BulletPhysics.cs.meta │ ├── FireBullets.cs │ ├── FireBullets.cs.meta │ ├── GunController.cs │ ├── GunController.cs.meta │ ├── IntegrationMethods.cs │ ├── IntegrationMethods.cs.meta │ ├── KillBullet.cs │ ├── KillBullet.cs.meta │ ├── MoveBullet.cs │ ├── MoveBullet.cs.meta │ ├── basic ballistics.unity │ └── basic ballistics.unity.meta ├── Tutorial Part 4 - sniper rifle.meta ├── Tutorial Part 4 - sniper rifle │ ├── BodyController.cs │ ├── BodyController.cs.meta │ ├── Bullet sniper.prefab │ ├── Bullet sniper.prefab.meta │ ├── CheckBulletHit.cs │ ├── CheckBulletHit.cs.meta │ ├── SniperController.cs │ ├── SniperController.cs.meta │ ├── scope1.png │ ├── scope1.png.meta │ ├── sniper.unity │ └── sniper.unity.meta ├── Tutorial Part 5 - self-aiming (todo).meta ├── _Materials.meta └── _Materials │ ├── Cannon.mat │ ├── Cannon.mat.meta │ ├── Ground.mat │ ├── Ground.mat.meta │ ├── Target texture.mat │ ├── Target texture.mat.meta │ ├── Trajectory.mat │ ├── Trajectory.mat.meta │ ├── target-texture.jpg │ └── target-texture.jpg.meta ├── LICENSE ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset └── VFXManager.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Asset meta data should only be ignored when the corresponding asset is also ignored 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 048a696d292c38c448814fea69be1be5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/Bullet no rigidbody.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &4274701299776518559 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 4274701299776518554} 12 | - component: {fileID: 4274701299776518555} 13 | - component: {fileID: 4274701299776518556} 14 | - component: {fileID: 114926313403434866} 15 | - component: {fileID: 114640963174897864} 16 | - component: {fileID: 114959311319701556} 17 | m_Layer: 0 18 | m_Name: Bullet no rigidbody 19 | m_TagString: Untagged 20 | m_Icon: {fileID: 0} 21 | m_NavMeshLayer: 0 22 | m_StaticEditorFlags: 0 23 | m_IsActive: 1 24 | --- !u!4 &4274701299776518554 25 | Transform: 26 | m_ObjectHideFlags: 0 27 | m_CorrespondingSourceObject: {fileID: 0} 28 | m_PrefabInstance: {fileID: 0} 29 | m_PrefabAsset: {fileID: 0} 30 | m_GameObject: {fileID: 4274701299776518559} 31 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 32 | m_LocalPosition: {x: -17.149446, y: -6.014309, z: -7.846713} 33 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 34 | m_Children: [] 35 | m_Father: {fileID: 0} 36 | m_RootOrder: 0 37 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 38 | --- !u!33 &4274701299776518555 39 | MeshFilter: 40 | m_ObjectHideFlags: 0 41 | m_CorrespondingSourceObject: {fileID: 0} 42 | m_PrefabInstance: {fileID: 0} 43 | m_PrefabAsset: {fileID: 0} 44 | m_GameObject: {fileID: 4274701299776518559} 45 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 46 | --- !u!23 &4274701299776518556 47 | MeshRenderer: 48 | m_ObjectHideFlags: 0 49 | m_CorrespondingSourceObject: {fileID: 0} 50 | m_PrefabInstance: {fileID: 0} 51 | m_PrefabAsset: {fileID: 0} 52 | m_GameObject: {fileID: 4274701299776518559} 53 | m_Enabled: 1 54 | m_CastShadows: 1 55 | m_ReceiveShadows: 1 56 | m_DynamicOccludee: 1 57 | m_MotionVectors: 1 58 | m_LightProbeUsage: 1 59 | m_ReflectionProbeUsage: 1 60 | m_RenderingLayerMask: 1 61 | m_RendererPriority: 0 62 | m_Materials: 63 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 64 | m_StaticBatchInfo: 65 | firstSubMesh: 0 66 | subMeshCount: 0 67 | m_StaticBatchRoot: {fileID: 0} 68 | m_ProbeAnchor: {fileID: 0} 69 | m_LightProbeVolumeOverride: {fileID: 0} 70 | m_ScaleInLightmap: 1 71 | m_PreserveUVs: 0 72 | m_IgnoreNormalsForChartDetection: 0 73 | m_ImportantGI: 0 74 | m_StitchLightmapSeams: 0 75 | m_SelectedEditorRenderState: 3 76 | m_MinimumChartSize: 4 77 | m_AutoUVMaxDistance: 0.5 78 | m_AutoUVMaxAngle: 89 79 | m_LightmapParameters: {fileID: 0} 80 | m_SortingLayerID: 0 81 | m_SortingLayer: 0 82 | m_SortingOrder: 0 83 | --- !u!114 &114926313403434866 84 | MonoBehaviour: 85 | m_ObjectHideFlags: 0 86 | m_CorrespondingSourceObject: {fileID: 0} 87 | m_PrefabInstance: {fileID: 0} 88 | m_PrefabAsset: {fileID: 0} 89 | m_GameObject: {fileID: 4274701299776518559} 90 | m_Enabled: 1 91 | m_EditorHideFlags: 0 92 | m_Script: {fileID: 11500000, guid: 7d3140644198f7a408a2abf5d391df1a, type: 3} 93 | m_Name: 94 | m_EditorClassIdentifier: 95 | --- !u!114 &114640963174897864 96 | MonoBehaviour: 97 | m_ObjectHideFlags: 0 98 | m_CorrespondingSourceObject: {fileID: 0} 99 | m_PrefabInstance: {fileID: 0} 100 | m_PrefabAsset: {fileID: 0} 101 | m_GameObject: {fileID: 4274701299776518559} 102 | m_Enabled: 1 103 | m_EditorHideFlags: 0 104 | m_Script: {fileID: 11500000, guid: 704689e427c56cb46887d901c14ddaf3, type: 3} 105 | m_Name: 106 | m_EditorClassIdentifier: 107 | --- !u!114 &114959311319701556 108 | MonoBehaviour: 109 | m_ObjectHideFlags: 0 110 | m_CorrespondingSourceObject: {fileID: 0} 111 | m_PrefabInstance: {fileID: 0} 112 | m_PrefabAsset: {fileID: 0} 113 | m_GameObject: {fileID: 4274701299776518559} 114 | m_Enabled: 1 115 | m_EditorHideFlags: 0 116 | m_Script: {fileID: 11500000, guid: 970cff6ad736f744eac729ff3b4fe529, type: 3} 117 | m_Name: 118 | m_EditorClassIdentifier: 119 | muzzleVelocity: 10 120 | m: 0.2 121 | r: 0.05 122 | C_d: 0.5 123 | C_l: 0.1 124 | windSpeedVector: {x: 3, y: 0, z: 0} 125 | rho: 1.225 126 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/Bullet no rigidbody.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19883b92c891c594b974faff19f732f5 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/Bullet.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &4274701299776518559 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 4274701299776518554} 12 | - component: {fileID: 4274701299776518555} 13 | - component: {fileID: 4274701299776518556} 14 | - component: {fileID: 4274701299776518557} 15 | - component: {fileID: 4274701299776518558} 16 | - component: {fileID: 114926313403434866} 17 | - component: {fileID: 114556100118264876} 18 | m_Layer: 0 19 | m_Name: Bullet 20 | m_TagString: Untagged 21 | m_Icon: {fileID: 0} 22 | m_NavMeshLayer: 0 23 | m_StaticEditorFlags: 0 24 | m_IsActive: 1 25 | --- !u!4 &4274701299776518554 26 | Transform: 27 | m_ObjectHideFlags: 0 28 | m_CorrespondingSourceObject: {fileID: 0} 29 | m_PrefabInstance: {fileID: 0} 30 | m_PrefabAsset: {fileID: 0} 31 | m_GameObject: {fileID: 4274701299776518559} 32 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 33 | m_LocalPosition: {x: -17.149446, y: -6.014309, z: -7.846713} 34 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 35 | m_Children: [] 36 | m_Father: {fileID: 0} 37 | m_RootOrder: 0 38 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 39 | --- !u!33 &4274701299776518555 40 | MeshFilter: 41 | m_ObjectHideFlags: 0 42 | m_CorrespondingSourceObject: {fileID: 0} 43 | m_PrefabInstance: {fileID: 0} 44 | m_PrefabAsset: {fileID: 0} 45 | m_GameObject: {fileID: 4274701299776518559} 46 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 47 | --- !u!23 &4274701299776518556 48 | MeshRenderer: 49 | m_ObjectHideFlags: 0 50 | m_CorrespondingSourceObject: {fileID: 0} 51 | m_PrefabInstance: {fileID: 0} 52 | m_PrefabAsset: {fileID: 0} 53 | m_GameObject: {fileID: 4274701299776518559} 54 | m_Enabled: 1 55 | m_CastShadows: 1 56 | m_ReceiveShadows: 1 57 | m_DynamicOccludee: 1 58 | m_MotionVectors: 1 59 | m_LightProbeUsage: 1 60 | m_ReflectionProbeUsage: 1 61 | m_RenderingLayerMask: 1 62 | m_RendererPriority: 0 63 | m_Materials: 64 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 65 | m_StaticBatchInfo: 66 | firstSubMesh: 0 67 | subMeshCount: 0 68 | m_StaticBatchRoot: {fileID: 0} 69 | m_ProbeAnchor: {fileID: 0} 70 | m_LightProbeVolumeOverride: {fileID: 0} 71 | m_ScaleInLightmap: 1 72 | m_PreserveUVs: 0 73 | m_IgnoreNormalsForChartDetection: 0 74 | m_ImportantGI: 0 75 | m_StitchLightmapSeams: 0 76 | m_SelectedEditorRenderState: 3 77 | m_MinimumChartSize: 4 78 | m_AutoUVMaxDistance: 0.5 79 | m_AutoUVMaxAngle: 89 80 | m_LightmapParameters: {fileID: 0} 81 | m_SortingLayerID: 0 82 | m_SortingLayer: 0 83 | m_SortingOrder: 0 84 | --- !u!135 &4274701299776518557 85 | SphereCollider: 86 | m_ObjectHideFlags: 0 87 | m_CorrespondingSourceObject: {fileID: 0} 88 | m_PrefabInstance: {fileID: 0} 89 | m_PrefabAsset: {fileID: 0} 90 | m_GameObject: {fileID: 4274701299776518559} 91 | m_Material: {fileID: 0} 92 | m_IsTrigger: 0 93 | m_Enabled: 1 94 | serializedVersion: 2 95 | m_Radius: 0.5 96 | m_Center: {x: 0, y: 0, z: 0} 97 | --- !u!54 &4274701299776518558 98 | Rigidbody: 99 | m_ObjectHideFlags: 0 100 | m_CorrespondingSourceObject: {fileID: 0} 101 | m_PrefabInstance: {fileID: 0} 102 | m_PrefabAsset: {fileID: 0} 103 | m_GameObject: {fileID: 4274701299776518559} 104 | serializedVersion: 2 105 | m_Mass: 1 106 | m_Drag: 0 107 | m_AngularDrag: 0.05 108 | m_UseGravity: 1 109 | m_IsKinematic: 0 110 | m_Interpolate: 0 111 | m_Constraints: 0 112 | m_CollisionDetection: 0 113 | --- !u!114 &114926313403434866 114 | MonoBehaviour: 115 | m_ObjectHideFlags: 0 116 | m_CorrespondingSourceObject: {fileID: 0} 117 | m_PrefabInstance: {fileID: 0} 118 | m_PrefabAsset: {fileID: 0} 119 | m_GameObject: {fileID: 4274701299776518559} 120 | m_Enabled: 1 121 | m_EditorHideFlags: 0 122 | m_Script: {fileID: 11500000, guid: 7d3140644198f7a408a2abf5d391df1a, type: 3} 123 | m_Name: 124 | m_EditorClassIdentifier: 125 | --- !u!114 &114556100118264876 126 | MonoBehaviour: 127 | m_ObjectHideFlags: 0 128 | m_CorrespondingSourceObject: {fileID: 0} 129 | m_PrefabInstance: {fileID: 0} 130 | m_PrefabAsset: {fileID: 0} 131 | m_GameObject: {fileID: 4274701299776518559} 132 | m_Enabled: 1 133 | m_EditorHideFlags: 0 134 | m_Script: {fileID: 11500000, guid: 970cff6ad736f744eac729ff3b4fe529, type: 3} 135 | m_Name: 136 | m_EditorClassIdentifier: 137 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/Bullet.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 967d93d6edb014d489c02150d5440d9b 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/BulletData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class BulletData : MonoBehaviour 6 | { 7 | //Data belonging to this bullet type 8 | //The initial speed [m/s] 9 | public float muzzleVelocity = 10f; 10 | //Mass [kg] 11 | public float m = 0.2f; 12 | //Radius [m] 13 | public float r = 0.05f; 14 | //Coefficients, which is a value you can't calculate - you have to simulate it in a wind tunnel 15 | //and they also depends on the speed, so we pick some average value 16 | //Drag coefficient (Tesla Model S has the drag coefficient 0.24) 17 | public float C_d = 0.5f; 18 | //Lift coefficient 19 | public float C_l = 0.5f; 20 | 21 | 22 | //External data (shouldn't maybe be here but is easier in this tutorial) 23 | //Wind speed [m/s] 24 | public Vector3 windSpeedVector = new Vector3(0f, 0f, 0f); 25 | //The density of the medium the bullet is travelling in, which in this case is air at 15 degrees [kg/m^3] 26 | public float rho = 1.225f; 27 | } 28 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/BulletData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 970cff6ad736f744eac729ff3b4fe529 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/BulletPhysics.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | //A collection of methods for bullet physics 6 | public static class BulletPhysics 7 | { 8 | //Calculate the bullet's drag acceleration 9 | public static Vector3 CalculateBulletDragAcc(Vector3 bulletVel, BulletData bulletData) 10 | { 11 | //If you have a wind speed in your game, you can take that into account here: 12 | //https://www.youtube.com/watch?v=lGg7wNf1w-k 13 | Vector3 bulletVelRelativeToWindVel = bulletVel - bulletData.windSpeedVector; 14 | 15 | //Step 1. Calculate the bullet's drag force [N] 16 | //https://en.wikipedia.org/wiki/Drag_equation 17 | //F_drag = 0.5 * rho * v^2 * C_d * A 18 | 19 | //The velocity of the bullet [m/s] 20 | float v = bulletVelRelativeToWindVel.magnitude; 21 | //The bullet's cross section area [m^2] 22 | float A = Mathf.PI * bulletData.r * bulletData.r; 23 | 24 | float dragForce = 0.5f * bulletData.rho * v * v * bulletData.C_d * A; 25 | 26 | 27 | //Step 2. We need to add an acceleration, not a force, in the integration method [m/s^2] 28 | //Drag acceleration F = m * a -> a = F / m 29 | float dragAcc = dragForce / bulletData.m; 30 | 31 | //SHould be in a direction opposite of the bullet's velocity vector 32 | Vector3 dragVec = dragAcc * bulletVelRelativeToWindVel.normalized * -1f; 33 | 34 | 35 | return dragVec; 36 | } 37 | 38 | 39 | 40 | //Calculate the bullet's lift acceleration 41 | public static Vector3 CalculateBulletLiftAcc(Vector3 bulletVel, BulletData bulletData, Vector3 bulletUpDir) 42 | { 43 | //If you have a wind speed in your game, you can take that into account here: 44 | //https://www.youtube.com/watch?v=lGg7wNf1w-k 45 | Vector3 bulletVelRelativeToWindVel = bulletVel - bulletData.windSpeedVector; 46 | 47 | //Step 1. Calculate the bullet's lift force [N] 48 | //https://en.wikipedia.org/wiki/Lift_(force) 49 | //F_lift = 0.5 * rho * v^2 * S * C_l 50 | 51 | //The velocity of the bullet [m/s] 52 | float v = bulletVelRelativeToWindVel.magnitude; 53 | //Planform (projected) wing area, which is assumed to be the same as the cross section area [m^2] 54 | float S = Mathf.PI * bulletData.r * bulletData.r; 55 | 56 | float liftForce = 0.5f * bulletData.rho * v * v * S * bulletData.C_l; 57 | 58 | //Step 2. We need to add an acceleration, not a force, in the integration method [m/s^2] 59 | //Drag acceleration F = m * a -> a = F / m 60 | float liftAcc = liftForce / bulletData.m; 61 | 62 | //The lift force acts in the up-direction = perpendicular to the velocity direction it travels in 63 | Vector3 liftVec = liftAcc * bulletUpDir; 64 | 65 | 66 | return liftVec; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/BulletPhysics.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7991f7eb6e64e74e830e941de43c93f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/FireBullets.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | //Fire bullets continuously from a cannon barrel 6 | public class FireBullets : MonoBehaviour 7 | { 8 | //Drags 9 | //The bullet we will fire from the cannon 10 | public GameObject bulletObj; 11 | //We will parent all bullets to this object to get a clean workspace 12 | public Transform bulletsParent; 13 | //The end of the cannon barrel where we will create the bullets 14 | //If we create them at the bottom they will cut through the barrel because we are not simulating 15 | //the bullets first travelling straight along the barrel 16 | public Transform endOfBarrelTrans; 17 | 18 | //Bullet data 19 | private BulletData bulletData; 20 | 21 | 22 | 23 | void Start() 24 | { 25 | bulletData = bulletObj.GetComponent(); 26 | 27 | StartCoroutine(FireBullet()); 28 | } 29 | 30 | 31 | 32 | //Fire bullets continuously 33 | public IEnumerator FireBullet() 34 | { 35 | while (true) 36 | { 37 | //Create a new bullet at the end of the cannon barrel 38 | GameObject newBullet = Instantiate(bulletObj) as GameObject; 39 | 40 | //Parent it to get a less messy workspace 41 | newBullet.transform.parent = bulletsParent; 42 | 43 | //The bullets start position and start direction 44 | Vector3 startPos = endOfBarrelTrans.position; 45 | Vector3 startDir = transform.forward; 46 | 47 | 48 | //If the bullet has a rigidbody 49 | //newBullet.transform.position = startPos; 50 | 51 | //The start speed vector 52 | //Vector3 startSpeedVec = bulletData.muzzleVelocity * startDir; 53 | 54 | //Add velocity to the bullet with a rigidbody 55 | //newBullet.GetComponent().velocity = startSpeedVec; 56 | 57 | 58 | //If the bullet has no rigidbody 59 | newBullet.GetComponent().SetStartValues(startPos, startDir); 60 | 61 | //Wait 2 seconds until we fire another bullet 62 | yield return new WaitForSeconds(2f); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/FireBullets.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d9d19ac188143c4ab3f87cbef3d81a9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/GunController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | //Controlls a gun that fire bullets 6 | public class GunController : MonoBehaviour 7 | { 8 | //Drags 9 | //The target we are aiming for 10 | public Transform targetTrans; 11 | //The barrel: the part of the barrel we rotate - not the barrel mesh 12 | public Transform barrelTrans; 13 | //The end of the cannon barrel where we will create the bullets 14 | //If we create them at the bottom they will cut through the barrel because we are not simulating 15 | //the bullets first travelling straight along the barrel 16 | public Transform endOfBarrelTrans; 17 | 18 | //Data belonging to the bullet we fire 19 | private BulletData bulletData; 20 | 21 | //The step size 22 | private float timeStep; 23 | 24 | //For debugging 25 | private LineRenderer lineRenderer; 26 | 27 | 28 | 29 | void Awake() 30 | { 31 | //Can use a less precise time step to speed up calculations 32 | //Or a more precise to get a more accurate result 33 | //BUT lower is not always better because of floating point precision issues!!! 34 | timeStep = Time.fixedDeltaTime * 1f; 35 | 36 | lineRenderer = GetComponent(); 37 | 38 | bulletData = barrelTrans.GetComponent().bulletObj.GetComponent(); 39 | } 40 | 41 | 42 | 43 | void Update() 44 | { 45 | AimGun(); 46 | 47 | DrawTrajectoryPath(); 48 | } 49 | 50 | 51 | 52 | //Aim the gun and the barrel towards the target 53 | void AimGun() 54 | { 55 | //If we want to calculate the barrel should have to hit the target, we will get 0, 1, or 2 angles 56 | //Angle used if we want to simulate artillery, where the bullet hits the target from above 57 | float? highAngle = 0f; 58 | //Angle used if we want to simulate a rifle, where the bullet hits the target from the front 59 | float? lowAngle = 0f; 60 | 61 | CalculateAngleToHitTarget(out highAngle, out lowAngle); 62 | 63 | //We will here simulate artillery cannon where we fire in a trajetory so the shell lands from above the target 64 | //If you want to simulate a rifle, you just use lowAngle instead 65 | 66 | //If we are within range 67 | if (highAngle != null) 68 | { 69 | float angle = (float)highAngle; 70 | 71 | //Rotate the barrel 72 | //The equation we use assumes that if we are rotating the gun up from the 73 | //pointing "forward" position, the angle increase from 0, but our gun's angles 74 | //decreases from 360 degress when we are rotating up 75 | barrelTrans.localEulerAngles = new Vector3(360f - angle, 0f, 0f); 76 | 77 | //Rotate the gun turret towards the target 78 | transform.LookAt(targetTrans); 79 | transform.eulerAngles = new Vector3(0f, transform.rotation.eulerAngles.y, 0f); 80 | } 81 | } 82 | 83 | 84 | 85 | //Which angle do we need to hit the target? 86 | //This is a Quadratic equation so we will get 0, 1 or 2 answers 87 | //These answers are in this case angles 88 | //If we get 0 angles, it means we cant solve the equation, meaning that we can't hit the target because we are out of range 89 | //https://en.wikipedia.org/wiki/Projectile_motion 90 | void CalculateAngleToHitTarget(out float? theta1, out float? theta2) 91 | { 92 | //Initial speed 93 | float v = bulletData.muzzleVelocity; 94 | 95 | Vector3 targetVec = targetTrans.position - endOfBarrelTrans.position; 96 | 97 | //Vertical distance 98 | float y = targetVec.y; 99 | 100 | //Reset y so we can get the horizontal distance x 101 | targetVec.y = 0f; 102 | 103 | //Horizontal distance 104 | float x = targetVec.magnitude; 105 | 106 | //Gravity 107 | float g = 9.81f; 108 | 109 | 110 | //Calculate the angles 111 | float vSqr = v * v; 112 | 113 | float underTheRoot = (vSqr * vSqr) - g * (g * x * x + 2 * y * vSqr); 114 | 115 | //Check if we are within range 116 | if (underTheRoot >= 0f) 117 | { 118 | float rightSide = Mathf.Sqrt(underTheRoot); 119 | 120 | float top1 = vSqr + rightSide; 121 | float top2 = vSqr - rightSide; 122 | 123 | float bottom = g * x; 124 | 125 | theta1 = Mathf.Atan2(top1, bottom) * Mathf.Rad2Deg; 126 | theta2 = Mathf.Atan2(top2, bottom) * Mathf.Rad2Deg; 127 | } 128 | else 129 | { 130 | theta1 = null; 131 | theta2 = null; 132 | } 133 | } 134 | 135 | 136 | 137 | //Display the trajectory path with a line renderer 138 | void DrawTrajectoryPath() 139 | { 140 | //Start values 141 | Vector3 currentVel = barrelTrans.forward * bulletData.muzzleVelocity; 142 | Vector3 currentPos = endOfBarrelTrans.position; 143 | 144 | Vector3 newPos = Vector3.zero; 145 | Vector3 newVel = Vector3.zero; 146 | 147 | List bulletPositions = new List(); 148 | 149 | //Build the trajectory line 150 | bulletPositions.Add(currentPos); 151 | 152 | //I prefer to use a maxIterations instead of a while loop 153 | //so we always avoid stuck in infinite loop and have to restart Unity 154 | //You might have to change this value depending on your values 155 | int maxIterations = 10000; 156 | 157 | for (int i = 0; i < maxIterations; i++) 158 | { 159 | //Calculate the bullets new position and new velocity 160 | CurrentIntegrationMethod(timeStep, currentPos, currentVel, out newPos, out newVel); 161 | 162 | //Set the new value to the current values 163 | currentPos = newPos; 164 | currentVel = newVel; 165 | 166 | //Add the new position to the list with all positions 167 | bulletPositions.Add(currentPos); 168 | 169 | //The bullet has hit the ground because we assume 0 is ground height 170 | //This assumes the bullet is fired from a position above 0 or the loop will stop immediately 171 | if (currentPos.y < 0f) 172 | { 173 | break; 174 | } 175 | 176 | //A warning message that something might be wrong 177 | if (i == maxIterations - 1) 178 | { 179 | Debug.Log("The bullet newer hit anything because we reached max iterations"); 180 | } 181 | } 182 | 183 | 184 | //Display the bullet positions with a line renderer 185 | lineRenderer.positionCount = bulletPositions.Count; 186 | 187 | lineRenderer.SetPositions(bulletPositions.ToArray()); 188 | } 189 | 190 | 191 | 192 | //Choose which integration method you want to use to simulate how the bullet fly 193 | public static void CurrentIntegrationMethod(float timeStep, Vector3 currentPos, Vector3 currentVel, out Vector3 newPos, out Vector3 newVel) 194 | { 195 | //IntegrationMethods.BackwardEuler(timeStep, currentPos, currentVel, out newPos, out newVel); 196 | 197 | //IntegrationMethods.ForwardEuler(timeStep, currentPos, currentVel, out newPos, out newVel); 198 | 199 | //IntegrationMethods.Heuns(timeStep, currentPos, currentVel, out newPos, out newVel); 200 | 201 | IntegrationMethods.HeunsNoExternalForces(timeStep, currentPos, currentVel, out newPos, out newVel); 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/GunController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 746cd6b5a1dc32b49b840e2cd7ff11e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/IntegrationMethods.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | //A collection of integration methods for ballistics physics 6 | public static class IntegrationMethods 7 | { 8 | private static Vector3 gravityVec = new Vector3(0f, -9.81f, 0f); 9 | 10 | 11 | 12 | //Integration method 1 13 | public static void BackwardEuler(float timeStep, Vector3 currentPos, Vector3 currentVel, out Vector3 newPos, out Vector3 newVel) 14 | { 15 | //Add all factors that affects the acceleration 16 | //Gravity 17 | Vector3 accFactor = gravityVec; 18 | 19 | 20 | //Calculate the new velocity and position 21 | //y_k+1 = y_k + timeStep * f(t_k+1, y_k+1) 22 | 23 | //This assumes the acceleration is the same next time step 24 | newVel = currentVel + timeStep * accFactor; 25 | 26 | newPos = currentPos + timeStep * newVel; 27 | } 28 | 29 | 30 | 31 | //Integration method 2 32 | public static void ForwardEuler(float timeStep, Vector3 currentPos, Vector3 currentVel, out Vector3 newPos, out Vector3 newVel) 33 | { 34 | //Add all factors that affects the acceleration 35 | //Gravity 36 | Vector3 accFactor = gravityVec; 37 | 38 | 39 | //Calculate the new velocity and position 40 | //y_k+1 = y_k + timeStep * f(t_k, y_k) 41 | 42 | newVel = currentVel + timeStep * accFactor; 43 | 44 | newPos = currentPos + timeStep * currentVel; 45 | } 46 | 47 | 48 | 49 | //Integration method 3 50 | //upVec is a vector perpendicular (in the upwards direction) to the direction the bullet is travelling in 51 | //is only needed if we calculate the lift force 52 | public static void Heuns(float timeStep, Vector3 currentPos, Vector3 currentVel, Vector3 upVec, BulletData bulletData, out Vector3 newPos, out Vector3 newVel) 53 | { 54 | //Add all factors that affects the acceleration 55 | //Gravity 56 | Vector3 accFactorEuler = gravityVec; 57 | //Drag 58 | accFactorEuler += BulletPhysics.CalculateBulletDragAcc(currentVel, bulletData); 59 | //Lift 60 | accFactorEuler += BulletPhysics.CalculateBulletLiftAcc(currentVel, bulletData, upVec); 61 | 62 | 63 | //Calculate the new velocity and position 64 | //y_k+1 = y_k + timeStep * 0.5 * (f(t_k, y_k) + f(t_k+1, y_k+1)) 65 | //Where f(t_k+1, y_k+1) is calculated with Forward Euler: y_k+1 = y_k + timeStep * f(t_k, y_k) 66 | 67 | //Step 1. Find new pos and new vel with Forward Euler 68 | Vector3 newVelEuler = currentVel + timeStep * accFactorEuler; 69 | 70 | //New position with Forward Euler (is not needed here) 71 | //Vector3 newPosEuler = currentPos + timeStep * currentVel; 72 | 73 | 74 | //Step 2. Heuns method's final step 75 | //If we take drag into account, then acceleration is not constant - it also depends on the velocity 76 | //So we have to calculate another acceleration factor 77 | //Gravity 78 | Vector3 accFactorHeuns = gravityVec; 79 | //Drag 80 | //This assumes that windspeed is constant between the steps, which it should be because wind doesnt change that often 81 | accFactorHeuns += BulletPhysics.CalculateBulletDragAcc(newVelEuler, bulletData); 82 | //Lift 83 | accFactorHeuns += BulletPhysics.CalculateBulletLiftAcc(newVelEuler, bulletData, upVec); 84 | 85 | newVel = currentVel + timeStep * 0.5f * (accFactorEuler + accFactorHeuns); 86 | 87 | newPos = currentPos + timeStep * 0.5f * (currentVel + newVelEuler); 88 | } 89 | 90 | 91 | 92 | //Integration method 3.1 93 | //No external bullet forces except gravity 94 | //Makes it easier to see if the external forces are working if we display this trajectory 95 | public static void HeunsNoExternalForces(float timeStep, Vector3 currentPos, Vector3 currentVel, out Vector3 newPos, out Vector3 newVel) 96 | { 97 | //Add all factors that affects the acceleration 98 | //Gravity 99 | Vector3 accFactor = gravityVec; 100 | 101 | 102 | //Calculate the new velocity and position 103 | //y_k+1 = y_k + timeStep * 0.5 * (f(t_k, y_k) + f(t_k+1, y_k+1)) 104 | //Where f(t_k+1, y_k+1) is calculated with Forward Euler: y_k+1 = y_k + timeStep * f(t_k, y_k) 105 | 106 | //Step 1. Find new pos and new vel with Forward Euler 107 | Vector3 newVelEuler = currentVel + timeStep * accFactor; 108 | 109 | //New position with Forward Euler (is not needed) 110 | //Vector3 newPosEuler = currentPos + timeStep * currentVel; 111 | 112 | //Step 2. Heuns method's final step if acceleration is constant 113 | newVel = currentVel + timeStep * 0.5f * (accFactor + accFactor); 114 | 115 | newPos = currentPos + timeStep * 0.5f * (currentVel + newVelEuler); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/IntegrationMethods.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fa80d068a427c14fb8f8caf2de00105 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/KillBullet.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | //We fire bullets continuously, so we need to remove them 6 | public class KillBullet : MonoBehaviour 7 | { 8 | void Update() 9 | { 10 | //Remove the bullet if it is below ground level 11 | if (transform.position.y < -10f) 12 | { 13 | Destroy(gameObject); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/KillBullet.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d3140644198f7a408a2abf5d391df1a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/MoveBullet.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | //Will move a bullet with greater accuracy than if we move it with Unity's built-in rigidbody 6 | public class MoveBullet : MonoBehaviour 7 | { 8 | private Vector3 currentPos; 9 | private Vector3 currentVel; 10 | 11 | private Vector3 newPos; 12 | private Vector3 newVel; 13 | 14 | private BulletData bulletData; 15 | 16 | 17 | 18 | void Awake() 19 | { 20 | bulletData = GetComponent(); 21 | } 22 | 23 | 24 | 25 | void FixedUpdate() 26 | { 27 | MoveBulletOneStep(); 28 | } 29 | 30 | 31 | 32 | void MoveBulletOneStep() 33 | { 34 | //Use an integration method to calculate the new position of the bullet 35 | float timeStep = Time.fixedDeltaTime; 36 | 37 | IntegrationMethods.Heuns(timeStep, currentPos, currentVel, transform.up, bulletData, out newPos, out newVel); 38 | 39 | //Debug.DrawRay(transform.position, transform.up * 5f); 40 | 41 | //Set the new values to the old values for next update 42 | currentPos = newPos; 43 | currentVel = newVel; 44 | 45 | //Add the new position to the bullet 46 | transform.position = currentPos; 47 | 48 | //Change so the bullet points in the velocity direction 49 | transform.forward = currentVel.normalized; 50 | } 51 | 52 | 53 | 54 | //Set start values when we create the bullet 55 | public void SetStartValues(Vector3 startPos, Vector3 startDir) 56 | { 57 | this.currentPos = startPos; 58 | this.currentVel = bulletData.muzzleVelocity * startDir; 59 | 60 | transform.position = startPos; 61 | transform.forward = startDir; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/MoveBullet.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 704689e427c56cb46887d901c14ddaf3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/basic ballistics.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.18028334, g: 0.2257134, b: 0.30692226, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &4 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 10 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 0 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 1024 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 1 74 | m_BakeBackend: 0 75 | m_PVRSampling: 1 76 | m_PVRDirectSampleCount: 32 77 | m_PVRSampleCount: 500 78 | m_PVRBounces: 2 79 | m_PVRFilterTypeDirect: 0 80 | m_PVRFilterTypeIndirect: 0 81 | m_PVRFilterTypeAO: 0 82 | m_PVRFilteringMode: 0 83 | m_PVRCulling: 1 84 | m_PVRFilteringGaussRadiusDirect: 1 85 | m_PVRFilteringGaussRadiusIndirect: 5 86 | m_PVRFilteringGaussRadiusAO: 2 87 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 88 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 89 | m_PVRFilteringAtrousPositionSigmaAO: 1 90 | m_ShowResolutionOverlay: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 0 93 | --- !u!196 &5 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &36896463 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 36896467} 124 | - component: {fileID: 36896466} 125 | - component: {fileID: 36896465} 126 | - component: {fileID: 36896464} 127 | m_Layer: 0 128 | m_Name: Ground 129 | m_TagString: Ground 130 | m_Icon: {fileID: 0} 131 | m_NavMeshLayer: 0 132 | m_StaticEditorFlags: 0 133 | m_IsActive: 1 134 | --- !u!23 &36896464 135 | MeshRenderer: 136 | m_ObjectHideFlags: 0 137 | m_CorrespondingSourceObject: {fileID: 0} 138 | m_PrefabInstance: {fileID: 0} 139 | m_PrefabAsset: {fileID: 0} 140 | m_GameObject: {fileID: 36896463} 141 | m_Enabled: 1 142 | m_CastShadows: 1 143 | m_ReceiveShadows: 1 144 | m_DynamicOccludee: 1 145 | m_MotionVectors: 1 146 | m_LightProbeUsage: 1 147 | m_ReflectionProbeUsage: 1 148 | m_RenderingLayerMask: 1 149 | m_RendererPriority: 0 150 | m_Materials: 151 | - {fileID: 2100000, guid: 3008bce2a2ae7e44390a8c8ededcb99a, type: 2} 152 | m_StaticBatchInfo: 153 | firstSubMesh: 0 154 | subMeshCount: 0 155 | m_StaticBatchRoot: {fileID: 0} 156 | m_ProbeAnchor: {fileID: 0} 157 | m_LightProbeVolumeOverride: {fileID: 0} 158 | m_ScaleInLightmap: 1 159 | m_PreserveUVs: 1 160 | m_IgnoreNormalsForChartDetection: 0 161 | m_ImportantGI: 0 162 | m_StitchLightmapSeams: 0 163 | m_SelectedEditorRenderState: 3 164 | m_MinimumChartSize: 4 165 | m_AutoUVMaxDistance: 0.5 166 | m_AutoUVMaxAngle: 89 167 | m_LightmapParameters: {fileID: 0} 168 | m_SortingLayerID: 0 169 | m_SortingLayer: 0 170 | m_SortingOrder: 0 171 | --- !u!64 &36896465 172 | MeshCollider: 173 | m_ObjectHideFlags: 0 174 | m_CorrespondingSourceObject: {fileID: 0} 175 | m_PrefabInstance: {fileID: 0} 176 | m_PrefabAsset: {fileID: 0} 177 | m_GameObject: {fileID: 36896463} 178 | m_Material: {fileID: 0} 179 | m_IsTrigger: 0 180 | m_Enabled: 1 181 | serializedVersion: 3 182 | m_Convex: 0 183 | m_CookingOptions: 14 184 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 185 | --- !u!33 &36896466 186 | MeshFilter: 187 | m_ObjectHideFlags: 0 188 | m_CorrespondingSourceObject: {fileID: 0} 189 | m_PrefabInstance: {fileID: 0} 190 | m_PrefabAsset: {fileID: 0} 191 | m_GameObject: {fileID: 36896463} 192 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 193 | --- !u!4 &36896467 194 | Transform: 195 | m_ObjectHideFlags: 0 196 | m_CorrespondingSourceObject: {fileID: 0} 197 | m_PrefabInstance: {fileID: 0} 198 | m_PrefabAsset: {fileID: 0} 199 | m_GameObject: {fileID: 36896463} 200 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 201 | m_LocalPosition: {x: 0, y: 0, z: 0} 202 | m_LocalScale: {x: 5, y: 1, z: 5} 203 | m_Children: [] 204 | m_Father: {fileID: 0} 205 | m_RootOrder: 1 206 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 207 | --- !u!1 &432405032 208 | GameObject: 209 | m_ObjectHideFlags: 0 210 | m_CorrespondingSourceObject: {fileID: 0} 211 | m_PrefabInstance: {fileID: 0} 212 | m_PrefabAsset: {fileID: 0} 213 | serializedVersion: 6 214 | m_Component: 215 | - component: {fileID: 432405033} 216 | - component: {fileID: 432405036} 217 | - component: {fileID: 432405034} 218 | m_Layer: 0 219 | m_Name: Body 220 | m_TagString: Untagged 221 | m_Icon: {fileID: 0} 222 | m_NavMeshLayer: 0 223 | m_StaticEditorFlags: 0 224 | m_IsActive: 1 225 | --- !u!4 &432405033 226 | Transform: 227 | m_ObjectHideFlags: 0 228 | m_CorrespondingSourceObject: {fileID: 0} 229 | m_PrefabInstance: {fileID: 0} 230 | m_PrefabAsset: {fileID: 0} 231 | m_GameObject: {fileID: 432405032} 232 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 233 | m_LocalPosition: {x: 0, y: 0.25, z: 0} 234 | m_LocalScale: {x: 1, y: 0.5, z: 1} 235 | m_Children: [] 236 | m_Father: {fileID: 1725943168} 237 | m_RootOrder: 1 238 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 239 | --- !u!23 &432405034 240 | MeshRenderer: 241 | m_ObjectHideFlags: 0 242 | m_CorrespondingSourceObject: {fileID: 0} 243 | m_PrefabInstance: {fileID: 0} 244 | m_PrefabAsset: {fileID: 0} 245 | m_GameObject: {fileID: 432405032} 246 | m_Enabled: 1 247 | m_CastShadows: 1 248 | m_ReceiveShadows: 1 249 | m_DynamicOccludee: 1 250 | m_MotionVectors: 1 251 | m_LightProbeUsage: 1 252 | m_ReflectionProbeUsage: 1 253 | m_RenderingLayerMask: 1 254 | m_RendererPriority: 0 255 | m_Materials: 256 | - {fileID: 2100000, guid: 9c1570c98211f604d8f48e18d081d6eb, type: 2} 257 | m_StaticBatchInfo: 258 | firstSubMesh: 0 259 | subMeshCount: 0 260 | m_StaticBatchRoot: {fileID: 0} 261 | m_ProbeAnchor: {fileID: 0} 262 | m_LightProbeVolumeOverride: {fileID: 0} 263 | m_ScaleInLightmap: 1 264 | m_PreserveUVs: 1 265 | m_IgnoreNormalsForChartDetection: 0 266 | m_ImportantGI: 0 267 | m_StitchLightmapSeams: 0 268 | m_SelectedEditorRenderState: 3 269 | m_MinimumChartSize: 4 270 | m_AutoUVMaxDistance: 0.5 271 | m_AutoUVMaxAngle: 89 272 | m_LightmapParameters: {fileID: 0} 273 | m_SortingLayerID: 0 274 | m_SortingLayer: 0 275 | m_SortingOrder: 0 276 | --- !u!33 &432405036 277 | MeshFilter: 278 | m_ObjectHideFlags: 0 279 | m_CorrespondingSourceObject: {fileID: 0} 280 | m_PrefabInstance: {fileID: 0} 281 | m_PrefabAsset: {fileID: 0} 282 | m_GameObject: {fileID: 432405032} 283 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 284 | --- !u!1 &558956472 285 | GameObject: 286 | m_ObjectHideFlags: 0 287 | m_CorrespondingSourceObject: {fileID: 0} 288 | m_PrefabInstance: {fileID: 0} 289 | m_PrefabAsset: {fileID: 0} 290 | serializedVersion: 6 291 | m_Component: 292 | - component: {fileID: 558956474} 293 | - component: {fileID: 558956473} 294 | m_Layer: 0 295 | m_Name: Sun 296 | m_TagString: Untagged 297 | m_Icon: {fileID: 0} 298 | m_NavMeshLayer: 0 299 | m_StaticEditorFlags: 0 300 | m_IsActive: 1 301 | --- !u!108 &558956473 302 | Light: 303 | m_ObjectHideFlags: 0 304 | m_CorrespondingSourceObject: {fileID: 0} 305 | m_PrefabInstance: {fileID: 0} 306 | m_PrefabAsset: {fileID: 0} 307 | m_GameObject: {fileID: 558956472} 308 | m_Enabled: 1 309 | serializedVersion: 8 310 | m_Type: 1 311 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 312 | m_Intensity: 1 313 | m_Range: 10 314 | m_SpotAngle: 30 315 | m_CookieSize: 10 316 | m_Shadows: 317 | m_Type: 2 318 | m_Resolution: -1 319 | m_CustomResolution: -1 320 | m_Strength: 1 321 | m_Bias: 0.2 322 | m_NormalBias: 0.4 323 | m_NearPlane: 0.2 324 | m_Cookie: {fileID: 0} 325 | m_DrawHalo: 0 326 | m_Flare: {fileID: 0} 327 | m_RenderMode: 0 328 | m_CullingMask: 329 | serializedVersion: 2 330 | m_Bits: 4294967295 331 | m_Lightmapping: 4 332 | m_LightShadowCasterMode: 0 333 | m_AreaSize: {x: 1, y: 1} 334 | m_BounceIntensity: 1 335 | m_ColorTemperature: 6570 336 | m_UseColorTemperature: 0 337 | m_ShadowRadius: 0 338 | m_ShadowAngle: 0 339 | --- !u!4 &558956474 340 | Transform: 341 | m_ObjectHideFlags: 0 342 | m_CorrespondingSourceObject: {fileID: 0} 343 | m_PrefabInstance: {fileID: 0} 344 | m_PrefabAsset: {fileID: 0} 345 | m_GameObject: {fileID: 558956472} 346 | m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605} 347 | m_LocalPosition: {x: 0, y: 100, z: 0} 348 | m_LocalScale: {x: 1, y: 1, z: 1} 349 | m_Children: [] 350 | m_Father: {fileID: 1250883776} 351 | m_RootOrder: 1 352 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 353 | --- !u!1 &664141750 354 | GameObject: 355 | m_ObjectHideFlags: 0 356 | m_CorrespondingSourceObject: {fileID: 0} 357 | m_PrefabInstance: {fileID: 0} 358 | m_PrefabAsset: {fileID: 0} 359 | serializedVersion: 6 360 | m_Component: 361 | - component: {fileID: 664141751} 362 | m_Layer: 0 363 | m_Name: Barrel end 364 | m_TagString: Untagged 365 | m_Icon: {fileID: 0} 366 | m_NavMeshLayer: 0 367 | m_StaticEditorFlags: 0 368 | m_IsActive: 1 369 | --- !u!4 &664141751 370 | Transform: 371 | m_ObjectHideFlags: 0 372 | m_CorrespondingSourceObject: {fileID: 0} 373 | m_PrefabInstance: {fileID: 0} 374 | m_PrefabAsset: {fileID: 0} 375 | m_GameObject: {fileID: 664141750} 376 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 377 | m_LocalPosition: {x: 0, y: 1, z: 0} 378 | m_LocalScale: {x: 1, y: 1, z: 1} 379 | m_Children: [] 380 | m_Father: {fileID: 2024181969} 381 | m_RootOrder: 0 382 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 383 | --- !u!1 &710001051 384 | GameObject: 385 | m_ObjectHideFlags: 0 386 | m_CorrespondingSourceObject: {fileID: 0} 387 | m_PrefabInstance: {fileID: 0} 388 | m_PrefabAsset: {fileID: 0} 389 | serializedVersion: 6 390 | m_Component: 391 | - component: {fileID: 710001055} 392 | - component: {fileID: 710001054} 393 | - component: {fileID: 710001052} 394 | m_Layer: 0 395 | m_Name: Target box 396 | m_TagString: Target 397 | m_Icon: {fileID: 0} 398 | m_NavMeshLayer: 0 399 | m_StaticEditorFlags: 0 400 | m_IsActive: 1 401 | --- !u!23 &710001052 402 | MeshRenderer: 403 | m_ObjectHideFlags: 0 404 | m_CorrespondingSourceObject: {fileID: 0} 405 | m_PrefabInstance: {fileID: 0} 406 | m_PrefabAsset: {fileID: 0} 407 | m_GameObject: {fileID: 710001051} 408 | m_Enabled: 1 409 | m_CastShadows: 1 410 | m_ReceiveShadows: 1 411 | m_DynamicOccludee: 1 412 | m_MotionVectors: 1 413 | m_LightProbeUsage: 1 414 | m_ReflectionProbeUsage: 1 415 | m_RenderingLayerMask: 1 416 | m_RendererPriority: 0 417 | m_Materials: 418 | - {fileID: 2100000, guid: a4ef0f60a4a1b884a97cadd66f1263ba, type: 2} 419 | m_StaticBatchInfo: 420 | firstSubMesh: 0 421 | subMeshCount: 0 422 | m_StaticBatchRoot: {fileID: 0} 423 | m_ProbeAnchor: {fileID: 0} 424 | m_LightProbeVolumeOverride: {fileID: 0} 425 | m_ScaleInLightmap: 1 426 | m_PreserveUVs: 1 427 | m_IgnoreNormalsForChartDetection: 0 428 | m_ImportantGI: 0 429 | m_StitchLightmapSeams: 0 430 | m_SelectedEditorRenderState: 3 431 | m_MinimumChartSize: 4 432 | m_AutoUVMaxDistance: 0.5 433 | m_AutoUVMaxAngle: 89 434 | m_LightmapParameters: {fileID: 0} 435 | m_SortingLayerID: 0 436 | m_SortingLayer: 0 437 | m_SortingOrder: 0 438 | --- !u!33 &710001054 439 | MeshFilter: 440 | m_ObjectHideFlags: 0 441 | m_CorrespondingSourceObject: {fileID: 0} 442 | m_PrefabInstance: {fileID: 0} 443 | m_PrefabAsset: {fileID: 0} 444 | m_GameObject: {fileID: 710001051} 445 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 446 | --- !u!4 &710001055 447 | Transform: 448 | m_ObjectHideFlags: 0 449 | m_CorrespondingSourceObject: {fileID: 0} 450 | m_PrefabInstance: {fileID: 0} 451 | m_PrefabAsset: {fileID: 0} 452 | m_GameObject: {fileID: 710001051} 453 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 454 | m_LocalPosition: {x: 0, y: 0, z: 7.79} 455 | m_LocalScale: {x: 1, y: 1, z: 1} 456 | m_Children: [] 457 | m_Father: {fileID: 0} 458 | m_RootOrder: 2 459 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 460 | --- !u!1 &1113622327 461 | GameObject: 462 | m_ObjectHideFlags: 0 463 | m_CorrespondingSourceObject: {fileID: 0} 464 | m_PrefabInstance: {fileID: 0} 465 | m_PrefabAsset: {fileID: 0} 466 | serializedVersion: 6 467 | m_Component: 468 | - component: {fileID: 1113622328} 469 | m_Layer: 0 470 | m_Name: Bullets parent 471 | m_TagString: Untagged 472 | m_Icon: {fileID: 0} 473 | m_NavMeshLayer: 0 474 | m_StaticEditorFlags: 0 475 | m_IsActive: 1 476 | --- !u!4 &1113622328 477 | Transform: 478 | m_ObjectHideFlags: 0 479 | m_CorrespondingSourceObject: {fileID: 0} 480 | m_PrefabInstance: {fileID: 0} 481 | m_PrefabAsset: {fileID: 0} 482 | m_GameObject: {fileID: 1113622327} 483 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 484 | m_LocalPosition: {x: 0, y: 0, z: 0} 485 | m_LocalScale: {x: 1, y: 1, z: 1} 486 | m_Children: [] 487 | m_Father: {fileID: 0} 488 | m_RootOrder: 4 489 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 490 | --- !u!1 &1210090726 491 | GameObject: 492 | m_ObjectHideFlags: 0 493 | m_CorrespondingSourceObject: {fileID: 0} 494 | m_PrefabInstance: {fileID: 0} 495 | m_PrefabAsset: {fileID: 0} 496 | serializedVersion: 6 497 | m_Component: 498 | - component: {fileID: 1210090727} 499 | - component: {fileID: 1210090728} 500 | m_Layer: 0 501 | m_Name: Barrel connector 502 | m_TagString: Untagged 503 | m_Icon: {fileID: 0} 504 | m_NavMeshLayer: 0 505 | m_StaticEditorFlags: 0 506 | m_IsActive: 1 507 | --- !u!4 &1210090727 508 | Transform: 509 | m_ObjectHideFlags: 0 510 | m_CorrespondingSourceObject: {fileID: 0} 511 | m_PrefabInstance: {fileID: 0} 512 | m_PrefabAsset: {fileID: 0} 513 | m_GameObject: {fileID: 1210090726} 514 | m_LocalRotation: {x: 0.52383685, y: 0, z: 0, w: -0.8518186} 515 | m_LocalPosition: {x: 0, y: 0.5, z: 0} 516 | m_LocalScale: {x: 1, y: 1, z: 1} 517 | m_Children: 518 | - {fileID: 2024181969} 519 | m_Father: {fileID: 1725943168} 520 | m_RootOrder: 0 521 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 522 | --- !u!114 &1210090728 523 | MonoBehaviour: 524 | m_ObjectHideFlags: 0 525 | m_CorrespondingSourceObject: {fileID: 0} 526 | m_PrefabInstance: {fileID: 0} 527 | m_PrefabAsset: {fileID: 0} 528 | m_GameObject: {fileID: 1210090726} 529 | m_Enabled: 1 530 | m_EditorHideFlags: 0 531 | m_Script: {fileID: 11500000, guid: 5d9d19ac188143c4ab3f87cbef3d81a9, type: 3} 532 | m_Name: 533 | m_EditorClassIdentifier: 534 | bulletObj: {fileID: 4274701299776518559, guid: 19883b92c891c594b974faff19f732f5, 535 | type: 3} 536 | bulletsParent: {fileID: 1113622328} 537 | endOfBarrelTrans: {fileID: 664141751} 538 | --- !u!1 &1250883775 539 | GameObject: 540 | m_ObjectHideFlags: 0 541 | m_CorrespondingSourceObject: {fileID: 0} 542 | m_PrefabInstance: {fileID: 0} 543 | m_PrefabAsset: {fileID: 0} 544 | serializedVersion: 6 545 | m_Component: 546 | - component: {fileID: 1250883776} 547 | m_Layer: 0 548 | m_Name: _GameController 549 | m_TagString: Untagged 550 | m_Icon: {fileID: 0} 551 | m_NavMeshLayer: 0 552 | m_StaticEditorFlags: 0 553 | m_IsActive: 1 554 | --- !u!4 &1250883776 555 | Transform: 556 | m_ObjectHideFlags: 0 557 | m_CorrespondingSourceObject: {fileID: 0} 558 | m_PrefabInstance: {fileID: 0} 559 | m_PrefabAsset: {fileID: 0} 560 | m_GameObject: {fileID: 1250883775} 561 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 562 | m_LocalPosition: {x: 0, y: 0, z: 0} 563 | m_LocalScale: {x: 1, y: 1, z: 1} 564 | m_Children: 565 | - {fileID: 1569719176} 566 | - {fileID: 558956474} 567 | m_Father: {fileID: 0} 568 | m_RootOrder: 0 569 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 570 | --- !u!1 &1569719171 571 | GameObject: 572 | m_ObjectHideFlags: 0 573 | m_CorrespondingSourceObject: {fileID: 0} 574 | m_PrefabInstance: {fileID: 0} 575 | m_PrefabAsset: {fileID: 0} 576 | serializedVersion: 6 577 | m_Component: 578 | - component: {fileID: 1569719176} 579 | - component: {fileID: 1569719175} 580 | - component: {fileID: 1569719174} 581 | - component: {fileID: 1569719173} 582 | - component: {fileID: 1569719172} 583 | m_Layer: 0 584 | m_Name: Main Camera 585 | m_TagString: MainCamera 586 | m_Icon: {fileID: 0} 587 | m_NavMeshLayer: 0 588 | m_StaticEditorFlags: 0 589 | m_IsActive: 1 590 | --- !u!81 &1569719172 591 | AudioListener: 592 | m_ObjectHideFlags: 0 593 | m_CorrespondingSourceObject: {fileID: 0} 594 | m_PrefabInstance: {fileID: 0} 595 | m_PrefabAsset: {fileID: 0} 596 | m_GameObject: {fileID: 1569719171} 597 | m_Enabled: 1 598 | --- !u!124 &1569719173 599 | Behaviour: 600 | m_ObjectHideFlags: 0 601 | m_CorrespondingSourceObject: {fileID: 0} 602 | m_PrefabInstance: {fileID: 0} 603 | m_PrefabAsset: {fileID: 0} 604 | m_GameObject: {fileID: 1569719171} 605 | m_Enabled: 1 606 | --- !u!92 &1569719174 607 | Behaviour: 608 | m_ObjectHideFlags: 0 609 | m_CorrespondingSourceObject: {fileID: 0} 610 | m_PrefabInstance: {fileID: 0} 611 | m_PrefabAsset: {fileID: 0} 612 | m_GameObject: {fileID: 1569719171} 613 | m_Enabled: 1 614 | --- !u!20 &1569719175 615 | Camera: 616 | m_ObjectHideFlags: 0 617 | m_CorrespondingSourceObject: {fileID: 0} 618 | m_PrefabInstance: {fileID: 0} 619 | m_PrefabAsset: {fileID: 0} 620 | m_GameObject: {fileID: 1569719171} 621 | m_Enabled: 1 622 | serializedVersion: 2 623 | m_ClearFlags: 1 624 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} 625 | m_projectionMatrixMode: 1 626 | m_SensorSize: {x: 36, y: 24} 627 | m_LensShift: {x: 0, y: 0} 628 | m_GateFitMode: 2 629 | m_FocalLength: 50 630 | m_NormalizedViewPortRect: 631 | serializedVersion: 2 632 | x: 0 633 | y: 0 634 | width: 1 635 | height: 1 636 | near clip plane: 0.3 637 | far clip plane: 1000 638 | field of view: 60 639 | orthographic: 0 640 | orthographic size: 5 641 | m_Depth: -1 642 | m_CullingMask: 643 | serializedVersion: 2 644 | m_Bits: 4294967295 645 | m_RenderingPath: -1 646 | m_TargetTexture: {fileID: 0} 647 | m_TargetDisplay: 0 648 | m_TargetEye: 3 649 | m_HDR: 0 650 | m_AllowMSAA: 1 651 | m_AllowDynamicResolution: 0 652 | m_ForceIntoRT: 0 653 | m_OcclusionCulling: 1 654 | m_StereoConvergence: 10 655 | m_StereoSeparation: 0.022 656 | --- !u!4 &1569719176 657 | Transform: 658 | m_ObjectHideFlags: 0 659 | m_CorrespondingSourceObject: {fileID: 0} 660 | m_PrefabInstance: {fileID: 0} 661 | m_PrefabAsset: {fileID: 0} 662 | m_GameObject: {fileID: 1569719171} 663 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 664 | m_LocalPosition: {x: 0, y: 1, z: -10} 665 | m_LocalScale: {x: 1, y: 1, z: 1} 666 | m_Children: [] 667 | m_Father: {fileID: 1250883776} 668 | m_RootOrder: 0 669 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 670 | --- !u!1 &1725943167 671 | GameObject: 672 | m_ObjectHideFlags: 0 673 | m_CorrespondingSourceObject: {fileID: 0} 674 | m_PrefabInstance: {fileID: 0} 675 | m_PrefabAsset: {fileID: 0} 676 | serializedVersion: 6 677 | m_Component: 678 | - component: {fileID: 1725943168} 679 | - component: {fileID: 1725943170} 680 | - component: {fileID: 1725943169} 681 | m_Layer: 0 682 | m_Name: Gun 683 | m_TagString: Untagged 684 | m_Icon: {fileID: 0} 685 | m_NavMeshLayer: 0 686 | m_StaticEditorFlags: 0 687 | m_IsActive: 1 688 | --- !u!4 &1725943168 689 | Transform: 690 | m_ObjectHideFlags: 0 691 | m_CorrespondingSourceObject: {fileID: 0} 692 | m_PrefabInstance: {fileID: 0} 693 | m_PrefabAsset: {fileID: 0} 694 | m_GameObject: {fileID: 1725943167} 695 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 696 | m_LocalPosition: {x: 0, y: 0, z: 0} 697 | m_LocalScale: {x: 1, y: 1, z: 1} 698 | m_Children: 699 | - {fileID: 1210090727} 700 | - {fileID: 432405033} 701 | m_Father: {fileID: 0} 702 | m_RootOrder: 3 703 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 704 | --- !u!114 &1725943169 705 | MonoBehaviour: 706 | m_ObjectHideFlags: 0 707 | m_CorrespondingSourceObject: {fileID: 0} 708 | m_PrefabInstance: {fileID: 0} 709 | m_PrefabAsset: {fileID: 0} 710 | m_GameObject: {fileID: 1725943167} 711 | m_Enabled: 1 712 | m_EditorHideFlags: 0 713 | m_Script: {fileID: 11500000, guid: 746cd6b5a1dc32b49b840e2cd7ff11e2, type: 3} 714 | m_Name: 715 | m_EditorClassIdentifier: 716 | targetTrans: {fileID: 710001055} 717 | barrelTrans: {fileID: 1210090727} 718 | endOfBarrelTrans: {fileID: 664141751} 719 | --- !u!120 &1725943170 720 | LineRenderer: 721 | m_ObjectHideFlags: 0 722 | m_CorrespondingSourceObject: {fileID: 0} 723 | m_PrefabInstance: {fileID: 0} 724 | m_PrefabAsset: {fileID: 0} 725 | m_GameObject: {fileID: 1725943167} 726 | m_Enabled: 1 727 | m_CastShadows: 1 728 | m_ReceiveShadows: 1 729 | m_DynamicOccludee: 1 730 | m_MotionVectors: 0 731 | m_LightProbeUsage: 1 732 | m_ReflectionProbeUsage: 1 733 | m_RenderingLayerMask: 1 734 | m_RendererPriority: 0 735 | m_Materials: 736 | - {fileID: 2100000, guid: d18980edc27be8845950b679291f827a, type: 2} 737 | m_StaticBatchInfo: 738 | firstSubMesh: 0 739 | subMeshCount: 0 740 | m_StaticBatchRoot: {fileID: 0} 741 | m_ProbeAnchor: {fileID: 0} 742 | m_LightProbeVolumeOverride: {fileID: 0} 743 | m_ScaleInLightmap: 1 744 | m_PreserveUVs: 0 745 | m_IgnoreNormalsForChartDetection: 0 746 | m_ImportantGI: 0 747 | m_StitchLightmapSeams: 0 748 | m_SelectedEditorRenderState: 3 749 | m_MinimumChartSize: 4 750 | m_AutoUVMaxDistance: 0.5 751 | m_AutoUVMaxAngle: 89 752 | m_LightmapParameters: {fileID: 0} 753 | m_SortingLayerID: 0 754 | m_SortingLayer: 0 755 | m_SortingOrder: 0 756 | m_Positions: 757 | - {x: 0, y: 0, z: 0} 758 | - {x: 0, y: 0, z: 1} 759 | m_Parameters: 760 | serializedVersion: 3 761 | widthMultiplier: 1 762 | widthCurve: 763 | serializedVersion: 2 764 | m_Curve: 765 | - serializedVersion: 3 766 | time: 0 767 | value: 0.1 768 | inSlope: 0 769 | outSlope: 0 770 | tangentMode: 0 771 | weightedMode: 0 772 | inWeight: 0.33333334 773 | outWeight: 0.33333334 774 | - serializedVersion: 3 775 | time: 1 776 | value: 0.1 777 | inSlope: 0 778 | outSlope: 0 779 | tangentMode: 0 780 | weightedMode: 0 781 | inWeight: 0.33333334 782 | outWeight: 0.33333334 783 | m_PreInfinity: 2 784 | m_PostInfinity: 2 785 | m_RotationOrder: 4 786 | colorGradient: 787 | serializedVersion: 2 788 | key0: {r: 1, g: 1, b: 1, a: 1} 789 | key1: {r: 1, g: 1, b: 1, a: 1} 790 | key2: {r: 0, g: 0, b: 0, a: 0} 791 | key3: {r: 0, g: 0, b: 0, a: 0} 792 | key4: {r: 0, g: 0, b: 0, a: 0} 793 | key5: {r: 0, g: 0, b: 0, a: 0} 794 | key6: {r: 0, g: 0, b: 0, a: 0} 795 | key7: {r: 0, g: 0, b: 0, a: 0} 796 | ctime0: 0 797 | ctime1: 65535 798 | ctime2: 0 799 | ctime3: 0 800 | ctime4: 0 801 | ctime5: 0 802 | ctime6: 0 803 | ctime7: 0 804 | atime0: 0 805 | atime1: 65535 806 | atime2: 0 807 | atime3: 0 808 | atime4: 0 809 | atime5: 0 810 | atime6: 0 811 | atime7: 0 812 | m_Mode: 0 813 | m_NumColorKeys: 2 814 | m_NumAlphaKeys: 2 815 | numCornerVertices: 0 816 | numCapVertices: 0 817 | alignment: 0 818 | textureMode: 0 819 | shadowBias: 0 820 | generateLightingData: 0 821 | m_UseWorldSpace: 1 822 | m_Loop: 0 823 | --- !u!1 &2024181965 824 | GameObject: 825 | m_ObjectHideFlags: 0 826 | m_CorrespondingSourceObject: {fileID: 0} 827 | m_PrefabInstance: {fileID: 0} 828 | m_PrefabAsset: {fileID: 0} 829 | serializedVersion: 6 830 | m_Component: 831 | - component: {fileID: 2024181969} 832 | - component: {fileID: 2024181968} 833 | - component: {fileID: 2024181966} 834 | m_Layer: 0 835 | m_Name: Barrel 836 | m_TagString: Untagged 837 | m_Icon: {fileID: 0} 838 | m_NavMeshLayer: 0 839 | m_StaticEditorFlags: 0 840 | m_IsActive: 1 841 | --- !u!23 &2024181966 842 | MeshRenderer: 843 | m_ObjectHideFlags: 0 844 | m_CorrespondingSourceObject: {fileID: 0} 845 | m_PrefabInstance: {fileID: 0} 846 | m_PrefabAsset: {fileID: 0} 847 | m_GameObject: {fileID: 2024181965} 848 | m_Enabled: 1 849 | m_CastShadows: 1 850 | m_ReceiveShadows: 1 851 | m_DynamicOccludee: 1 852 | m_MotionVectors: 1 853 | m_LightProbeUsage: 1 854 | m_ReflectionProbeUsage: 1 855 | m_RenderingLayerMask: 1 856 | m_RendererPriority: 0 857 | m_Materials: 858 | - {fileID: 2100000, guid: 9c1570c98211f604d8f48e18d081d6eb, type: 2} 859 | m_StaticBatchInfo: 860 | firstSubMesh: 0 861 | subMeshCount: 0 862 | m_StaticBatchRoot: {fileID: 0} 863 | m_ProbeAnchor: {fileID: 0} 864 | m_LightProbeVolumeOverride: {fileID: 0} 865 | m_ScaleInLightmap: 1 866 | m_PreserveUVs: 1 867 | m_IgnoreNormalsForChartDetection: 0 868 | m_ImportantGI: 0 869 | m_StitchLightmapSeams: 0 870 | m_SelectedEditorRenderState: 3 871 | m_MinimumChartSize: 4 872 | m_AutoUVMaxDistance: 0.5 873 | m_AutoUVMaxAngle: 89 874 | m_LightmapParameters: {fileID: 0} 875 | m_SortingLayerID: 0 876 | m_SortingLayer: 0 877 | m_SortingOrder: 0 878 | --- !u!33 &2024181968 879 | MeshFilter: 880 | m_ObjectHideFlags: 0 881 | m_CorrespondingSourceObject: {fileID: 0} 882 | m_PrefabInstance: {fileID: 0} 883 | m_PrefabAsset: {fileID: 0} 884 | m_GameObject: {fileID: 2024181965} 885 | m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} 886 | --- !u!4 &2024181969 887 | Transform: 888 | m_ObjectHideFlags: 0 889 | m_CorrespondingSourceObject: {fileID: 0} 890 | m_PrefabInstance: {fileID: 0} 891 | m_PrefabAsset: {fileID: 0} 892 | m_GameObject: {fileID: 2024181965} 893 | m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067} 894 | m_LocalPosition: {x: 0, y: -0, z: 1.03} 895 | m_LocalScale: {x: 0.3, y: 1, z: 0.3} 896 | m_Children: 897 | - {fileID: 664141751} 898 | m_Father: {fileID: 1210090727} 899 | m_RootOrder: 0 900 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 901 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 1, 2, and 3 - basics/basic ballistics.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 424cd3ca4624c634fba41e3840dc87d1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e8a9473c1374ab4180c468f8d09f413 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/BodyController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | //Will just move the sniper character (who cant walk just turn around and aim up/down) 6 | public class BodyController : MonoBehaviour 7 | { 8 | //The camera should be a child to this gameobject 9 | //Should not be at the top of the capsule because it may clip through if hitting something above 10 | public Transform cameraTrans; 11 | 12 | //To control up/down rotation of camera 13 | private float xCameraRotation; 14 | 15 | //Parameters 16 | //If we zoom in with the sniper rifle we should move slower to make it easier to aim 17 | private float mouseSensitivity = 100f; 18 | 19 | private float mouseSensitivitySlow = 10f; 20 | 21 | public bool useSlowSensitivity = false; 22 | 23 | 24 | 25 | void Start() 26 | { 27 | 28 | } 29 | 30 | 31 | 32 | void Update() 33 | { 34 | LookLeftRightUpDown(); 35 | } 36 | 37 | 38 | 39 | //Move camera with mouse 40 | private void LookLeftRightUpDown() 41 | { 42 | float sensitivity = useSlowSensitivity ? mouseSensitivitySlow : mouseSensitivity; 43 | 44 | //Left-right 45 | float mouseX = Input.GetAxis("Mouse X") * sensitivity * Time.deltaTime; 46 | //Up-down 47 | float mouseY = Input.GetAxis("Mouse Y") * sensitivity * Time.deltaTime; 48 | 49 | xCameraRotation -= mouseY; 50 | 51 | //If we look directly upwards we dont want to continue looking because it would break our neck 52 | xCameraRotation = Mathf.Clamp(xCameraRotation, -90f, 90f); 53 | 54 | cameraTrans.localRotation = Quaternion.Euler(xCameraRotation, 0f, 0f); 55 | 56 | //Rotate left-right by moving the body and not the camera 57 | transform.Rotate(Vector3.up * mouseX); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/BodyController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 445a193a9489a314fafafc22e0537c82 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/Bullet sniper.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &4274701299776518559 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 4274701299776518554} 12 | - component: {fileID: 4274701299776518555} 13 | - component: {fileID: 4274701299776518556} 14 | - component: {fileID: 114926313403434866} 15 | - component: {fileID: 114640963174897864} 16 | - component: {fileID: 114875217666227832} 17 | - component: {fileID: 114275212102551320} 18 | m_Layer: 0 19 | m_Name: Bullet sniper 20 | m_TagString: Untagged 21 | m_Icon: {fileID: 0} 22 | m_NavMeshLayer: 0 23 | m_StaticEditorFlags: 0 24 | m_IsActive: 1 25 | --- !u!4 &4274701299776518554 26 | Transform: 27 | m_ObjectHideFlags: 0 28 | m_CorrespondingSourceObject: {fileID: 0} 29 | m_PrefabInstance: {fileID: 0} 30 | m_PrefabAsset: {fileID: 0} 31 | m_GameObject: {fileID: 4274701299776518559} 32 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 33 | m_LocalPosition: {x: -17.149446, y: -6.014309, z: -7.846713} 34 | m_LocalScale: {x: 0.05, y: 0.05, z: 0.05} 35 | m_Children: [] 36 | m_Father: {fileID: 0} 37 | m_RootOrder: 0 38 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 39 | --- !u!33 &4274701299776518555 40 | MeshFilter: 41 | m_ObjectHideFlags: 0 42 | m_CorrespondingSourceObject: {fileID: 0} 43 | m_PrefabInstance: {fileID: 0} 44 | m_PrefabAsset: {fileID: 0} 45 | m_GameObject: {fileID: 4274701299776518559} 46 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 47 | --- !u!23 &4274701299776518556 48 | MeshRenderer: 49 | m_ObjectHideFlags: 0 50 | m_CorrespondingSourceObject: {fileID: 0} 51 | m_PrefabInstance: {fileID: 0} 52 | m_PrefabAsset: {fileID: 0} 53 | m_GameObject: {fileID: 4274701299776518559} 54 | m_Enabled: 1 55 | m_CastShadows: 1 56 | m_ReceiveShadows: 1 57 | m_DynamicOccludee: 1 58 | m_MotionVectors: 1 59 | m_LightProbeUsage: 1 60 | m_ReflectionProbeUsage: 1 61 | m_RenderingLayerMask: 1 62 | m_RendererPriority: 0 63 | m_Materials: 64 | - {fileID: 2100000, guid: d18980edc27be8845950b679291f827a, type: 2} 65 | m_StaticBatchInfo: 66 | firstSubMesh: 0 67 | subMeshCount: 0 68 | m_StaticBatchRoot: {fileID: 0} 69 | m_ProbeAnchor: {fileID: 0} 70 | m_LightProbeVolumeOverride: {fileID: 0} 71 | m_ScaleInLightmap: 1 72 | m_PreserveUVs: 0 73 | m_IgnoreNormalsForChartDetection: 0 74 | m_ImportantGI: 0 75 | m_StitchLightmapSeams: 0 76 | m_SelectedEditorRenderState: 3 77 | m_MinimumChartSize: 4 78 | m_AutoUVMaxDistance: 0.5 79 | m_AutoUVMaxAngle: 89 80 | m_LightmapParameters: {fileID: 0} 81 | m_SortingLayerID: 0 82 | m_SortingLayer: 0 83 | m_SortingOrder: 0 84 | --- !u!114 &114926313403434866 85 | MonoBehaviour: 86 | m_ObjectHideFlags: 0 87 | m_CorrespondingSourceObject: {fileID: 0} 88 | m_PrefabInstance: {fileID: 0} 89 | m_PrefabAsset: {fileID: 0} 90 | m_GameObject: {fileID: 4274701299776518559} 91 | m_Enabled: 1 92 | m_EditorHideFlags: 0 93 | m_Script: {fileID: 11500000, guid: 7d3140644198f7a408a2abf5d391df1a, type: 3} 94 | m_Name: 95 | m_EditorClassIdentifier: 96 | --- !u!114 &114640963174897864 97 | MonoBehaviour: 98 | m_ObjectHideFlags: 0 99 | m_CorrespondingSourceObject: {fileID: 0} 100 | m_PrefabInstance: {fileID: 0} 101 | m_PrefabAsset: {fileID: 0} 102 | m_GameObject: {fileID: 4274701299776518559} 103 | m_Enabled: 1 104 | m_EditorHideFlags: 0 105 | m_Script: {fileID: 11500000, guid: 704689e427c56cb46887d901c14ddaf3, type: 3} 106 | m_Name: 107 | m_EditorClassIdentifier: 108 | --- !u!114 &114875217666227832 109 | MonoBehaviour: 110 | m_ObjectHideFlags: 0 111 | m_CorrespondingSourceObject: {fileID: 0} 112 | m_PrefabInstance: {fileID: 0} 113 | m_PrefabAsset: {fileID: 0} 114 | m_GameObject: {fileID: 4274701299776518559} 115 | m_Enabled: 1 116 | m_EditorHideFlags: 0 117 | m_Script: {fileID: 11500000, guid: e7b41df99becfc14aad324db6488c0c3, type: 3} 118 | m_Name: 119 | m_EditorClassIdentifier: 120 | --- !u!114 &114275212102551320 121 | MonoBehaviour: 122 | m_ObjectHideFlags: 0 123 | m_CorrespondingSourceObject: {fileID: 0} 124 | m_PrefabInstance: {fileID: 0} 125 | m_PrefabAsset: {fileID: 0} 126 | m_GameObject: {fileID: 4274701299776518559} 127 | m_Enabled: 1 128 | m_EditorHideFlags: 0 129 | m_Script: {fileID: 11500000, guid: 970cff6ad736f744eac729ff3b4fe529, type: 3} 130 | m_Name: 131 | m_EditorClassIdentifier: 132 | muzzleVelocity: 200 133 | m: 0.2 134 | r: 0.05 135 | C_d: 0.5 136 | C_l: 0.01 137 | windSpeedVector: {x: 2, y: 0, z: 0} 138 | rho: 1.225 139 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/Bullet sniper.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32108f726a548c046bd76ca8ddf31c90 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/CheckBulletHit.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | //Will check if the bullet hit anything since last update 6 | public class CheckBulletHit : MonoBehaviour 7 | { 8 | private Vector3 lastPos; 9 | 10 | 11 | 12 | void FixedUpdate() 13 | { 14 | CheckHit(); 15 | 16 | lastPos = transform.position; 17 | } 18 | 19 | 20 | 21 | //Did we hit a target 22 | void CheckHit() 23 | { 24 | Vector3 currentPos = transform.position; 25 | 26 | Vector3 fireDirection = (currentPos - lastPos).normalized; 27 | 28 | float fireDistance = (currentPos - lastPos).magnitude; 29 | 30 | RaycastHit hit; 31 | 32 | if (Physics.Raycast(currentPos, fireDirection, out hit, fireDistance)) 33 | { 34 | if (hit.collider.CompareTag("Target")) 35 | { 36 | Debug.Log("Hit target!"); 37 | 38 | //Move the bullet to where we hit 39 | transform.position = hit.point; 40 | 41 | //Deactivate the script that moves the bullet, so we can see where it hit 42 | GetComponent().enabled = false; 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/CheckBulletHit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7b41df99becfc14aad324db6488c0c3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/SniperController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | public class SniperController : MonoBehaviour 7 | { 8 | //The bullet we will fire 9 | public GameObject sniperBullet; 10 | //The parent to the bullets to get a clean workspace 11 | public Transform bulletParentTrans; 12 | //The sniper scope image 13 | public Image sniperScopeImage; 14 | 15 | //Camera stuff 16 | private Camera mainCamera; 17 | //Need the initial camera FOV so we can zoom 18 | private float initialFOV; 19 | //Different zoom levels we can have zoom 20 | private int currentZoom = 1; 21 | 22 | //To change sensitivity when zoomed 23 | private BodyController bodyController; 24 | 25 | //Used so we can only fire one bullet when pressing a key 26 | private bool canFire = true; 27 | 28 | 29 | 30 | private void Start() 31 | { 32 | bodyController = GetComponent(); 33 | 34 | mainCamera = bodyController.cameraTrans.GetComponent(); 35 | 36 | initialFOV = mainCamera.fieldOfView; 37 | 38 | sniperScopeImage.enabled = false; 39 | } 40 | 41 | 42 | 43 | private void Update() 44 | { 45 | ZoomSight(); 46 | 47 | FireBullet(); 48 | } 49 | 50 | 51 | 52 | //The sniper rifle can zoom between 3 and 12 times 53 | private void ZoomSight() 54 | { 55 | //Zoom with mouse wheel 56 | if (Input.GetAxis("Mouse ScrollWheel") > 0) 57 | { 58 | currentZoom += 1; 59 | 60 | ChangeCameraZoomSettings(); 61 | } 62 | else if (Input.GetAxis("Mouse ScrollWheel") < 0) 63 | { 64 | currentZoom -= 1; 65 | 66 | ChangeCameraZoomSettings(); 67 | } 68 | } 69 | 70 | 71 | 72 | //Change whatever needs to be changed when we zoom in/out 73 | private void ChangeCameraZoomSettings() 74 | { 75 | //Clamp zoom 76 | //Keep it between 1 and 11, then add 1 when zoom because zoom is between 3 and 12 times 77 | currentZoom = Mathf.Clamp(currentZoom, 1, 11); 78 | 79 | 80 | //Remove the scope sight if we are not zooming 81 | if (currentZoom == 1) 82 | { 83 | sniperScopeImage.enabled = false; 84 | 85 | //Change sensitivity 86 | bodyController.useSlowSensitivity = false; 87 | 88 | //If the zoom is 6x, then the FOV is FOV / 6 (according to unscientific research on Internet) 89 | mainCamera.fieldOfView = initialFOV / (float)currentZoom; 90 | } 91 | else 92 | { 93 | sniperScopeImage.enabled = true; 94 | 95 | //Change sensitivity 96 | bodyController.useSlowSensitivity = true; 97 | 98 | mainCamera.fieldOfView = initialFOV / ((float)currentZoom + 1f); 99 | } 100 | } 101 | 102 | 103 | 104 | //Fire a single bullet 105 | private void FireBullet() 106 | { 107 | //Sometimes when we move the mouse is really high in the webplayer, so the mouse cursor ends up outside 108 | //of the webplayer so we cant fire, despite locking the cursor, so add alternative fire button 109 | if ((Input.GetKeyDown(KeyCode.F)) && canFire) 110 | { 111 | //Create a new bullet 112 | GameObject newBullet = Instantiate(sniperBullet) as GameObject; 113 | 114 | //Parent it to get a clean workspace 115 | newBullet.transform.parent = bulletParentTrans; 116 | 117 | //Give it speed and position 118 | Vector3 startPos = mainCamera.transform.position; 119 | 120 | Vector3 startDir = mainCamera.transform.forward; 121 | 122 | newBullet.GetComponent().SetStartValues(startPos, startDir); 123 | 124 | canFire = false; 125 | } 126 | 127 | //Has to release the trigger to fire again 128 | if (Input.GetKeyUp(KeyCode.F)) 129 | { 130 | canFire = true; 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/SniperController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa78bb36d8605da4db3ff8bd2e79f778 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/scope1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Ballistics-Tutorial/e6df72b489d49de3e7bf0697da1dadaaa4b946a6/Assets/Tutorial Part 4 - sniper rifle/scope1.png -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/scope1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cce019eb929df448af01edbb933ae80 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 0 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 1 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 8 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 68a09b9bdcfaa104aa7265c6d5f365d6 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/sniper.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.18028334, g: 0.2257134, b: 0.30692226, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 10 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 256 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 2 74 | m_BakeBackend: 1 75 | m_PVRSampling: 1 76 | m_PVRDirectSampleCount: 32 77 | m_PVRSampleCount: 500 78 | m_PVRBounces: 2 79 | m_PVRFilterTypeDirect: 0 80 | m_PVRFilterTypeIndirect: 0 81 | m_PVRFilterTypeAO: 0 82 | m_PVRFilteringMode: 1 83 | m_PVRCulling: 1 84 | m_PVRFilteringGaussRadiusDirect: 1 85 | m_PVRFilteringGaussRadiusIndirect: 5 86 | m_PVRFilteringGaussRadiusAO: 2 87 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 88 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 89 | m_PVRFilteringAtrousPositionSigmaAO: 1 90 | m_ShowResolutionOverlay: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &35310864 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 35310865} 124 | - component: {fileID: 35310868} 125 | - component: {fileID: 35310867} 126 | - component: {fileID: 35310866} 127 | m_Layer: 0 128 | m_Name: Target 129 | m_TagString: Target 130 | m_Icon: {fileID: 0} 131 | m_NavMeshLayer: 0 132 | m_StaticEditorFlags: 0 133 | m_IsActive: 1 134 | --- !u!4 &35310865 135 | Transform: 136 | m_ObjectHideFlags: 0 137 | m_CorrespondingSourceObject: {fileID: 0} 138 | m_PrefabInstance: {fileID: 0} 139 | m_PrefabAsset: {fileID: 0} 140 | m_GameObject: {fileID: 35310864} 141 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 142 | m_LocalPosition: {x: 0, y: 1, z: 20} 143 | m_LocalScale: {x: 1, y: 1, z: 0.01} 144 | m_Children: [] 145 | m_Father: {fileID: 1945277283} 146 | m_RootOrder: 2 147 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 148 | --- !u!65 &35310866 149 | BoxCollider: 150 | m_ObjectHideFlags: 0 151 | m_CorrespondingSourceObject: {fileID: 0} 152 | m_PrefabInstance: {fileID: 0} 153 | m_PrefabAsset: {fileID: 0} 154 | m_GameObject: {fileID: 35310864} 155 | m_Material: {fileID: 0} 156 | m_IsTrigger: 0 157 | m_Enabled: 1 158 | serializedVersion: 2 159 | m_Size: {x: 1, y: 1, z: 1} 160 | m_Center: {x: 0, y: 0, z: 0} 161 | --- !u!23 &35310867 162 | MeshRenderer: 163 | m_ObjectHideFlags: 0 164 | m_CorrespondingSourceObject: {fileID: 0} 165 | m_PrefabInstance: {fileID: 0} 166 | m_PrefabAsset: {fileID: 0} 167 | m_GameObject: {fileID: 35310864} 168 | m_Enabled: 1 169 | m_CastShadows: 1 170 | m_ReceiveShadows: 1 171 | m_DynamicOccludee: 1 172 | m_MotionVectors: 1 173 | m_LightProbeUsage: 1 174 | m_ReflectionProbeUsage: 1 175 | m_RenderingLayerMask: 1 176 | m_RendererPriority: 0 177 | m_Materials: 178 | - {fileID: 2100000, guid: a4ef0f60a4a1b884a97cadd66f1263ba, type: 2} 179 | m_StaticBatchInfo: 180 | firstSubMesh: 0 181 | subMeshCount: 0 182 | m_StaticBatchRoot: {fileID: 0} 183 | m_ProbeAnchor: {fileID: 0} 184 | m_LightProbeVolumeOverride: {fileID: 0} 185 | m_ScaleInLightmap: 1 186 | m_PreserveUVs: 0 187 | m_IgnoreNormalsForChartDetection: 0 188 | m_ImportantGI: 0 189 | m_StitchLightmapSeams: 0 190 | m_SelectedEditorRenderState: 3 191 | m_MinimumChartSize: 4 192 | m_AutoUVMaxDistance: 0.5 193 | m_AutoUVMaxAngle: 89 194 | m_LightmapParameters: {fileID: 0} 195 | m_SortingLayerID: 0 196 | m_SortingLayer: 0 197 | m_SortingOrder: 0 198 | --- !u!33 &35310868 199 | MeshFilter: 200 | m_ObjectHideFlags: 0 201 | m_CorrespondingSourceObject: {fileID: 0} 202 | m_PrefabInstance: {fileID: 0} 203 | m_PrefabAsset: {fileID: 0} 204 | m_GameObject: {fileID: 35310864} 205 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 206 | --- !u!1 &92818598 207 | GameObject: 208 | m_ObjectHideFlags: 0 209 | m_CorrespondingSourceObject: {fileID: 0} 210 | m_PrefabInstance: {fileID: 0} 211 | m_PrefabAsset: {fileID: 0} 212 | serializedVersion: 6 213 | m_Component: 214 | - component: {fileID: 92818600} 215 | - component: {fileID: 92818599} 216 | m_Layer: 0 217 | m_Name: Directional Light 218 | m_TagString: Untagged 219 | m_Icon: {fileID: 0} 220 | m_NavMeshLayer: 0 221 | m_StaticEditorFlags: 0 222 | m_IsActive: 1 223 | --- !u!108 &92818599 224 | Light: 225 | m_ObjectHideFlags: 0 226 | m_CorrespondingSourceObject: {fileID: 0} 227 | m_PrefabInstance: {fileID: 0} 228 | m_PrefabAsset: {fileID: 0} 229 | m_GameObject: {fileID: 92818598} 230 | m_Enabled: 1 231 | serializedVersion: 8 232 | m_Type: 1 233 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 234 | m_Intensity: 1 235 | m_Range: 10 236 | m_SpotAngle: 30 237 | m_CookieSize: 10 238 | m_Shadows: 239 | m_Type: 2 240 | m_Resolution: -1 241 | m_CustomResolution: -1 242 | m_Strength: 1 243 | m_Bias: 0.05 244 | m_NormalBias: 0.4 245 | m_NearPlane: 0.2 246 | m_Cookie: {fileID: 0} 247 | m_DrawHalo: 0 248 | m_Flare: {fileID: 0} 249 | m_RenderMode: 0 250 | m_CullingMask: 251 | serializedVersion: 2 252 | m_Bits: 4294967295 253 | m_Lightmapping: 4 254 | m_LightShadowCasterMode: 0 255 | m_AreaSize: {x: 1, y: 1} 256 | m_BounceIntensity: 1 257 | m_ColorTemperature: 6570 258 | m_UseColorTemperature: 0 259 | m_ShadowRadius: 0 260 | m_ShadowAngle: 0 261 | --- !u!4 &92818600 262 | Transform: 263 | m_ObjectHideFlags: 0 264 | m_CorrespondingSourceObject: {fileID: 0} 265 | m_PrefabInstance: {fileID: 0} 266 | m_PrefabAsset: {fileID: 0} 267 | m_GameObject: {fileID: 92818598} 268 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 269 | m_LocalPosition: {x: 0, y: 500, z: 0} 270 | m_LocalScale: {x: 1, y: 1, z: 1} 271 | m_Children: [] 272 | m_Father: {fileID: 1945277283} 273 | m_RootOrder: 0 274 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 275 | --- !u!1 &180823200 276 | GameObject: 277 | m_ObjectHideFlags: 0 278 | m_CorrespondingSourceObject: {fileID: 0} 279 | m_PrefabInstance: {fileID: 0} 280 | m_PrefabAsset: {fileID: 0} 281 | serializedVersion: 6 282 | m_Component: 283 | - component: {fileID: 180823201} 284 | - component: {fileID: 180823203} 285 | - component: {fileID: 180823202} 286 | m_Layer: 5 287 | m_Name: Image 288 | m_TagString: Untagged 289 | m_Icon: {fileID: 0} 290 | m_NavMeshLayer: 0 291 | m_StaticEditorFlags: 0 292 | m_IsActive: 1 293 | --- !u!224 &180823201 294 | RectTransform: 295 | m_ObjectHideFlags: 0 296 | m_CorrespondingSourceObject: {fileID: 0} 297 | m_PrefabInstance: {fileID: 0} 298 | m_PrefabAsset: {fileID: 0} 299 | m_GameObject: {fileID: 180823200} 300 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 301 | m_LocalPosition: {x: 0, y: 0, z: 0} 302 | m_LocalScale: {x: 1, y: 1, z: 1} 303 | m_Children: [] 304 | m_Father: {fileID: 1709326068} 305 | m_RootOrder: 0 306 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 307 | m_AnchorMin: {x: 0.5, y: 0} 308 | m_AnchorMax: {x: 0.5, y: 1} 309 | m_AnchoredPosition: {x: 0, y: 0} 310 | m_SizeDelta: {x: 400, y: -40} 311 | m_Pivot: {x: 0.5, y: 0.5} 312 | --- !u!114 &180823202 313 | MonoBehaviour: 314 | m_ObjectHideFlags: 0 315 | m_CorrespondingSourceObject: {fileID: 0} 316 | m_PrefabInstance: {fileID: 0} 317 | m_PrefabAsset: {fileID: 0} 318 | m_GameObject: {fileID: 180823200} 319 | m_Enabled: 1 320 | m_EditorHideFlags: 0 321 | m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} 322 | m_Name: 323 | m_EditorClassIdentifier: 324 | m_Material: {fileID: 0} 325 | m_Color: {r: 1, g: 1, b: 1, a: 1} 326 | m_RaycastTarget: 1 327 | m_OnCullStateChanged: 328 | m_PersistentCalls: 329 | m_Calls: [] 330 | m_Sprite: {fileID: 21300000, guid: 8cce019eb929df448af01edbb933ae80, type: 3} 331 | m_Type: 0 332 | m_PreserveAspect: 1 333 | m_FillCenter: 1 334 | m_FillMethod: 4 335 | m_FillAmount: 1 336 | m_FillClockwise: 1 337 | m_FillOrigin: 0 338 | m_UseSpriteMesh: 0 339 | --- !u!222 &180823203 340 | CanvasRenderer: 341 | m_ObjectHideFlags: 0 342 | m_CorrespondingSourceObject: {fileID: 0} 343 | m_PrefabInstance: {fileID: 0} 344 | m_PrefabAsset: {fileID: 0} 345 | m_GameObject: {fileID: 180823200} 346 | m_CullTransparentMesh: 0 347 | --- !u!1 &188266314 348 | GameObject: 349 | m_ObjectHideFlags: 0 350 | m_CorrespondingSourceObject: {fileID: 0} 351 | m_PrefabInstance: {fileID: 0} 352 | m_PrefabAsset: {fileID: 0} 353 | serializedVersion: 6 354 | m_Component: 355 | - component: {fileID: 188266317} 356 | - component: {fileID: 188266316} 357 | - component: {fileID: 188266315} 358 | m_Layer: 0 359 | m_Name: Main Camera 360 | m_TagString: MainCamera 361 | m_Icon: {fileID: 0} 362 | m_NavMeshLayer: 0 363 | m_StaticEditorFlags: 0 364 | m_IsActive: 1 365 | --- !u!81 &188266315 366 | AudioListener: 367 | m_ObjectHideFlags: 0 368 | m_CorrespondingSourceObject: {fileID: 0} 369 | m_PrefabInstance: {fileID: 0} 370 | m_PrefabAsset: {fileID: 0} 371 | m_GameObject: {fileID: 188266314} 372 | m_Enabled: 1 373 | --- !u!20 &188266316 374 | Camera: 375 | m_ObjectHideFlags: 0 376 | m_CorrespondingSourceObject: {fileID: 0} 377 | m_PrefabInstance: {fileID: 0} 378 | m_PrefabAsset: {fileID: 0} 379 | m_GameObject: {fileID: 188266314} 380 | m_Enabled: 1 381 | serializedVersion: 2 382 | m_ClearFlags: 1 383 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 384 | m_projectionMatrixMode: 1 385 | m_SensorSize: {x: 36, y: 24} 386 | m_LensShift: {x: 0, y: 0} 387 | m_GateFitMode: 2 388 | m_FocalLength: 50 389 | m_NormalizedViewPortRect: 390 | serializedVersion: 2 391 | x: 0 392 | y: 0 393 | width: 1 394 | height: 1 395 | near clip plane: 0.3 396 | far clip plane: 1000 397 | field of view: 60 398 | orthographic: 0 399 | orthographic size: 5 400 | m_Depth: -1 401 | m_CullingMask: 402 | serializedVersion: 2 403 | m_Bits: 4294967295 404 | m_RenderingPath: -1 405 | m_TargetTexture: {fileID: 0} 406 | m_TargetDisplay: 0 407 | m_TargetEye: 3 408 | m_HDR: 1 409 | m_AllowMSAA: 1 410 | m_AllowDynamicResolution: 0 411 | m_ForceIntoRT: 0 412 | m_OcclusionCulling: 1 413 | m_StereoConvergence: 10 414 | m_StereoSeparation: 0.022 415 | --- !u!4 &188266317 416 | Transform: 417 | m_ObjectHideFlags: 0 418 | m_CorrespondingSourceObject: {fileID: 0} 419 | m_PrefabInstance: {fileID: 0} 420 | m_PrefabAsset: {fileID: 0} 421 | m_GameObject: {fileID: 188266314} 422 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 423 | m_LocalPosition: {x: 0, y: 0.6, z: 0} 424 | m_LocalScale: {x: 1, y: 1, z: 1} 425 | m_Children: [] 426 | m_Father: {fileID: 1907789734} 427 | m_RootOrder: 0 428 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 429 | --- !u!1 &771921391 430 | GameObject: 431 | m_ObjectHideFlags: 0 432 | m_CorrespondingSourceObject: {fileID: 0} 433 | m_PrefabInstance: {fileID: 0} 434 | m_PrefabAsset: {fileID: 0} 435 | serializedVersion: 6 436 | m_Component: 437 | - component: {fileID: 771921392} 438 | m_Layer: 0 439 | m_Name: Bullet parent 440 | m_TagString: Untagged 441 | m_Icon: {fileID: 0} 442 | m_NavMeshLayer: 0 443 | m_StaticEditorFlags: 0 444 | m_IsActive: 1 445 | --- !u!4 &771921392 446 | Transform: 447 | m_ObjectHideFlags: 0 448 | m_CorrespondingSourceObject: {fileID: 0} 449 | m_PrefabInstance: {fileID: 0} 450 | m_PrefabAsset: {fileID: 0} 451 | m_GameObject: {fileID: 771921391} 452 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 453 | m_LocalPosition: {x: 0, y: 0, z: 0} 454 | m_LocalScale: {x: 1, y: 1, z: 1} 455 | m_Children: [] 456 | m_Father: {fileID: 0} 457 | m_RootOrder: 2 458 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 459 | --- !u!1 &829058950 460 | GameObject: 461 | m_ObjectHideFlags: 0 462 | m_CorrespondingSourceObject: {fileID: 0} 463 | m_PrefabInstance: {fileID: 0} 464 | m_PrefabAsset: {fileID: 0} 465 | serializedVersion: 6 466 | m_Component: 467 | - component: {fileID: 829058951} 468 | - component: {fileID: 829058954} 469 | - component: {fileID: 829058953} 470 | - component: {fileID: 829058952} 471 | m_Layer: 0 472 | m_Name: Ground 473 | m_TagString: Untagged 474 | m_Icon: {fileID: 0} 475 | m_NavMeshLayer: 0 476 | m_StaticEditorFlags: 0 477 | m_IsActive: 1 478 | --- !u!4 &829058951 479 | Transform: 480 | m_ObjectHideFlags: 0 481 | m_CorrespondingSourceObject: {fileID: 0} 482 | m_PrefabInstance: {fileID: 0} 483 | m_PrefabAsset: {fileID: 0} 484 | m_GameObject: {fileID: 829058950} 485 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 486 | m_LocalPosition: {x: 0, y: 0, z: 0} 487 | m_LocalScale: {x: 100, y: 1, z: 100} 488 | m_Children: [] 489 | m_Father: {fileID: 1945277283} 490 | m_RootOrder: 1 491 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 492 | --- !u!64 &829058952 493 | MeshCollider: 494 | m_ObjectHideFlags: 0 495 | m_CorrespondingSourceObject: {fileID: 0} 496 | m_PrefabInstance: {fileID: 0} 497 | m_PrefabAsset: {fileID: 0} 498 | m_GameObject: {fileID: 829058950} 499 | m_Material: {fileID: 0} 500 | m_IsTrigger: 0 501 | m_Enabled: 1 502 | serializedVersion: 3 503 | m_Convex: 0 504 | m_CookingOptions: 14 505 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 506 | --- !u!23 &829058953 507 | MeshRenderer: 508 | m_ObjectHideFlags: 0 509 | m_CorrespondingSourceObject: {fileID: 0} 510 | m_PrefabInstance: {fileID: 0} 511 | m_PrefabAsset: {fileID: 0} 512 | m_GameObject: {fileID: 829058950} 513 | m_Enabled: 1 514 | m_CastShadows: 1 515 | m_ReceiveShadows: 1 516 | m_DynamicOccludee: 1 517 | m_MotionVectors: 1 518 | m_LightProbeUsage: 1 519 | m_ReflectionProbeUsage: 1 520 | m_RenderingLayerMask: 1 521 | m_RendererPriority: 0 522 | m_Materials: 523 | - {fileID: 2100000, guid: 3008bce2a2ae7e44390a8c8ededcb99a, type: 2} 524 | m_StaticBatchInfo: 525 | firstSubMesh: 0 526 | subMeshCount: 0 527 | m_StaticBatchRoot: {fileID: 0} 528 | m_ProbeAnchor: {fileID: 0} 529 | m_LightProbeVolumeOverride: {fileID: 0} 530 | m_ScaleInLightmap: 1 531 | m_PreserveUVs: 0 532 | m_IgnoreNormalsForChartDetection: 0 533 | m_ImportantGI: 0 534 | m_StitchLightmapSeams: 0 535 | m_SelectedEditorRenderState: 3 536 | m_MinimumChartSize: 4 537 | m_AutoUVMaxDistance: 0.5 538 | m_AutoUVMaxAngle: 89 539 | m_LightmapParameters: {fileID: 0} 540 | m_SortingLayerID: 0 541 | m_SortingLayer: 0 542 | m_SortingOrder: 0 543 | --- !u!33 &829058954 544 | MeshFilter: 545 | m_ObjectHideFlags: 0 546 | m_CorrespondingSourceObject: {fileID: 0} 547 | m_PrefabInstance: {fileID: 0} 548 | m_PrefabAsset: {fileID: 0} 549 | m_GameObject: {fileID: 829058950} 550 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 551 | --- !u!1 &980509631 552 | GameObject: 553 | m_ObjectHideFlags: 0 554 | m_CorrespondingSourceObject: {fileID: 0} 555 | m_PrefabInstance: {fileID: 0} 556 | m_PrefabAsset: {fileID: 0} 557 | serializedVersion: 6 558 | m_Component: 559 | - component: {fileID: 980509634} 560 | - component: {fileID: 980509633} 561 | - component: {fileID: 980509632} 562 | m_Layer: 0 563 | m_Name: EventSystem 564 | m_TagString: Untagged 565 | m_Icon: {fileID: 0} 566 | m_NavMeshLayer: 0 567 | m_StaticEditorFlags: 0 568 | m_IsActive: 1 569 | --- !u!114 &980509632 570 | MonoBehaviour: 571 | m_ObjectHideFlags: 0 572 | m_CorrespondingSourceObject: {fileID: 0} 573 | m_PrefabInstance: {fileID: 0} 574 | m_PrefabAsset: {fileID: 0} 575 | m_GameObject: {fileID: 980509631} 576 | m_Enabled: 1 577 | m_EditorHideFlags: 0 578 | m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3} 579 | m_Name: 580 | m_EditorClassIdentifier: 581 | m_HorizontalAxis: Horizontal 582 | m_VerticalAxis: Vertical 583 | m_SubmitButton: Submit 584 | m_CancelButton: Cancel 585 | m_InputActionsPerSecond: 10 586 | m_RepeatDelay: 0.5 587 | m_ForceModuleActive: 0 588 | --- !u!114 &980509633 589 | MonoBehaviour: 590 | m_ObjectHideFlags: 0 591 | m_CorrespondingSourceObject: {fileID: 0} 592 | m_PrefabInstance: {fileID: 0} 593 | m_PrefabAsset: {fileID: 0} 594 | m_GameObject: {fileID: 980509631} 595 | m_Enabled: 1 596 | m_EditorHideFlags: 0 597 | m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3} 598 | m_Name: 599 | m_EditorClassIdentifier: 600 | m_FirstSelected: {fileID: 0} 601 | m_sendNavigationEvents: 1 602 | m_DragThreshold: 10 603 | --- !u!4 &980509634 604 | Transform: 605 | m_ObjectHideFlags: 0 606 | m_CorrespondingSourceObject: {fileID: 0} 607 | m_PrefabInstance: {fileID: 0} 608 | m_PrefabAsset: {fileID: 0} 609 | m_GameObject: {fileID: 980509631} 610 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 611 | m_LocalPosition: {x: 0, y: 0, z: 0} 612 | m_LocalScale: {x: 1, y: 1, z: 1} 613 | m_Children: [] 614 | m_Father: {fileID: 1945277283} 615 | m_RootOrder: 4 616 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 617 | --- !u!1 &1709326067 618 | GameObject: 619 | m_ObjectHideFlags: 0 620 | m_CorrespondingSourceObject: {fileID: 0} 621 | m_PrefabInstance: {fileID: 0} 622 | m_PrefabAsset: {fileID: 0} 623 | serializedVersion: 6 624 | m_Component: 625 | - component: {fileID: 1709326068} 626 | - component: {fileID: 1709326071} 627 | - component: {fileID: 1709326070} 628 | - component: {fileID: 1709326069} 629 | m_Layer: 5 630 | m_Name: Canvas 631 | m_TagString: Untagged 632 | m_Icon: {fileID: 0} 633 | m_NavMeshLayer: 0 634 | m_StaticEditorFlags: 0 635 | m_IsActive: 1 636 | --- !u!224 &1709326068 637 | RectTransform: 638 | m_ObjectHideFlags: 0 639 | m_CorrespondingSourceObject: {fileID: 0} 640 | m_PrefabInstance: {fileID: 0} 641 | m_PrefabAsset: {fileID: 0} 642 | m_GameObject: {fileID: 1709326067} 643 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 644 | m_LocalPosition: {x: 0, y: 0, z: 0} 645 | m_LocalScale: {x: 0, y: 0, z: 0} 646 | m_Children: 647 | - {fileID: 180823201} 648 | m_Father: {fileID: 1945277283} 649 | m_RootOrder: 3 650 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 651 | m_AnchorMin: {x: 0, y: 0} 652 | m_AnchorMax: {x: 0, y: 0} 653 | m_AnchoredPosition: {x: 0, y: 0} 654 | m_SizeDelta: {x: 0, y: 0} 655 | m_Pivot: {x: 0, y: 0} 656 | --- !u!114 &1709326069 657 | MonoBehaviour: 658 | m_ObjectHideFlags: 0 659 | m_CorrespondingSourceObject: {fileID: 0} 660 | m_PrefabInstance: {fileID: 0} 661 | m_PrefabAsset: {fileID: 0} 662 | m_GameObject: {fileID: 1709326067} 663 | m_Enabled: 1 664 | m_EditorHideFlags: 0 665 | m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} 666 | m_Name: 667 | m_EditorClassIdentifier: 668 | m_IgnoreReversedGraphics: 1 669 | m_BlockingObjects: 0 670 | m_BlockingMask: 671 | serializedVersion: 2 672 | m_Bits: 4294967295 673 | --- !u!114 &1709326070 674 | MonoBehaviour: 675 | m_ObjectHideFlags: 0 676 | m_CorrespondingSourceObject: {fileID: 0} 677 | m_PrefabInstance: {fileID: 0} 678 | m_PrefabAsset: {fileID: 0} 679 | m_GameObject: {fileID: 1709326067} 680 | m_Enabled: 1 681 | m_EditorHideFlags: 0 682 | m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} 683 | m_Name: 684 | m_EditorClassIdentifier: 685 | m_UiScaleMode: 0 686 | m_ReferencePixelsPerUnit: 100 687 | m_ScaleFactor: 1 688 | m_ReferenceResolution: {x: 800, y: 600} 689 | m_ScreenMatchMode: 0 690 | m_MatchWidthOrHeight: 0 691 | m_PhysicalUnit: 3 692 | m_FallbackScreenDPI: 96 693 | m_DefaultSpriteDPI: 96 694 | m_DynamicPixelsPerUnit: 1 695 | --- !u!223 &1709326071 696 | Canvas: 697 | m_ObjectHideFlags: 0 698 | m_CorrespondingSourceObject: {fileID: 0} 699 | m_PrefabInstance: {fileID: 0} 700 | m_PrefabAsset: {fileID: 0} 701 | m_GameObject: {fileID: 1709326067} 702 | m_Enabled: 1 703 | serializedVersion: 3 704 | m_RenderMode: 0 705 | m_Camera: {fileID: 0} 706 | m_PlaneDistance: 100 707 | m_PixelPerfect: 0 708 | m_ReceivesEvents: 1 709 | m_OverrideSorting: 0 710 | m_OverridePixelPerfect: 0 711 | m_SortingBucketNormalizedSize: 0 712 | m_AdditionalShaderChannelsFlag: 0 713 | m_SortingLayerID: 0 714 | m_SortingOrder: 0 715 | m_TargetDisplay: 0 716 | --- !u!1 &1907789730 717 | GameObject: 718 | m_ObjectHideFlags: 0 719 | m_CorrespondingSourceObject: {fileID: 0} 720 | m_PrefabInstance: {fileID: 0} 721 | m_PrefabAsset: {fileID: 0} 722 | serializedVersion: 6 723 | m_Component: 724 | - component: {fileID: 1907789734} 725 | - component: {fileID: 1907789733} 726 | - component: {fileID: 1907789732} 727 | - component: {fileID: 1907789735} 728 | - component: {fileID: 1907789736} 729 | m_Layer: 0 730 | m_Name: Sniper character 731 | m_TagString: Untagged 732 | m_Icon: {fileID: 0} 733 | m_NavMeshLayer: 0 734 | m_StaticEditorFlags: 0 735 | m_IsActive: 1 736 | --- !u!23 &1907789732 737 | MeshRenderer: 738 | m_ObjectHideFlags: 0 739 | m_CorrespondingSourceObject: {fileID: 0} 740 | m_PrefabInstance: {fileID: 0} 741 | m_PrefabAsset: {fileID: 0} 742 | m_GameObject: {fileID: 1907789730} 743 | m_Enabled: 1 744 | m_CastShadows: 1 745 | m_ReceiveShadows: 1 746 | m_DynamicOccludee: 1 747 | m_MotionVectors: 1 748 | m_LightProbeUsage: 1 749 | m_ReflectionProbeUsage: 1 750 | m_RenderingLayerMask: 1 751 | m_RendererPriority: 0 752 | m_Materials: 753 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 754 | m_StaticBatchInfo: 755 | firstSubMesh: 0 756 | subMeshCount: 0 757 | m_StaticBatchRoot: {fileID: 0} 758 | m_ProbeAnchor: {fileID: 0} 759 | m_LightProbeVolumeOverride: {fileID: 0} 760 | m_ScaleInLightmap: 1 761 | m_PreserveUVs: 0 762 | m_IgnoreNormalsForChartDetection: 0 763 | m_ImportantGI: 0 764 | m_StitchLightmapSeams: 0 765 | m_SelectedEditorRenderState: 3 766 | m_MinimumChartSize: 4 767 | m_AutoUVMaxDistance: 0.5 768 | m_AutoUVMaxAngle: 89 769 | m_LightmapParameters: {fileID: 0} 770 | m_SortingLayerID: 0 771 | m_SortingLayer: 0 772 | m_SortingOrder: 0 773 | --- !u!33 &1907789733 774 | MeshFilter: 775 | m_ObjectHideFlags: 0 776 | m_CorrespondingSourceObject: {fileID: 0} 777 | m_PrefabInstance: {fileID: 0} 778 | m_PrefabAsset: {fileID: 0} 779 | m_GameObject: {fileID: 1907789730} 780 | m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} 781 | --- !u!4 &1907789734 782 | Transform: 783 | m_ObjectHideFlags: 0 784 | m_CorrespondingSourceObject: {fileID: 0} 785 | m_PrefabInstance: {fileID: 0} 786 | m_PrefabAsset: {fileID: 0} 787 | m_GameObject: {fileID: 1907789730} 788 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 789 | m_LocalPosition: {x: 0, y: 1, z: 0} 790 | m_LocalScale: {x: 1, y: 1, z: 1} 791 | m_Children: 792 | - {fileID: 188266317} 793 | m_Father: {fileID: 0} 794 | m_RootOrder: 1 795 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 796 | --- !u!114 &1907789735 797 | MonoBehaviour: 798 | m_ObjectHideFlags: 0 799 | m_CorrespondingSourceObject: {fileID: 0} 800 | m_PrefabInstance: {fileID: 0} 801 | m_PrefabAsset: {fileID: 0} 802 | m_GameObject: {fileID: 1907789730} 803 | m_Enabled: 1 804 | m_EditorHideFlags: 0 805 | m_Script: {fileID: 11500000, guid: 445a193a9489a314fafafc22e0537c82, type: 3} 806 | m_Name: 807 | m_EditorClassIdentifier: 808 | cameraTrans: {fileID: 188266317} 809 | useSlowSensitivity: 0 810 | --- !u!114 &1907789736 811 | MonoBehaviour: 812 | m_ObjectHideFlags: 0 813 | m_CorrespondingSourceObject: {fileID: 0} 814 | m_PrefabInstance: {fileID: 0} 815 | m_PrefabAsset: {fileID: 0} 816 | m_GameObject: {fileID: 1907789730} 817 | m_Enabled: 1 818 | m_EditorHideFlags: 0 819 | m_Script: {fileID: 11500000, guid: fa78bb36d8605da4db3ff8bd2e79f778, type: 3} 820 | m_Name: 821 | m_EditorClassIdentifier: 822 | sniperBullet: {fileID: 4274701299776518559, guid: 32108f726a548c046bd76ca8ddf31c90, 823 | type: 3} 824 | bulletParentTrans: {fileID: 771921392} 825 | sniperScopeImage: {fileID: 180823202} 826 | --- !u!1 &1945277282 827 | GameObject: 828 | m_ObjectHideFlags: 0 829 | m_CorrespondingSourceObject: {fileID: 0} 830 | m_PrefabInstance: {fileID: 0} 831 | m_PrefabAsset: {fileID: 0} 832 | serializedVersion: 6 833 | m_Component: 834 | - component: {fileID: 1945277283} 835 | m_Layer: 0 836 | m_Name: Environment 837 | m_TagString: Untagged 838 | m_Icon: {fileID: 0} 839 | m_NavMeshLayer: 0 840 | m_StaticEditorFlags: 0 841 | m_IsActive: 1 842 | --- !u!4 &1945277283 843 | Transform: 844 | m_ObjectHideFlags: 0 845 | m_CorrespondingSourceObject: {fileID: 0} 846 | m_PrefabInstance: {fileID: 0} 847 | m_PrefabAsset: {fileID: 0} 848 | m_GameObject: {fileID: 1945277282} 849 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 850 | m_LocalPosition: {x: 0, y: 0, z: 0} 851 | m_LocalScale: {x: 1, y: 1, z: 1} 852 | m_Children: 853 | - {fileID: 92818600} 854 | - {fileID: 829058951} 855 | - {fileID: 35310865} 856 | - {fileID: 1709326068} 857 | - {fileID: 980509634} 858 | m_Father: {fileID: 0} 859 | m_RootOrder: 0 860 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 861 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 4 - sniper rifle/sniper.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28109bdbf6eed4c46828b1f61b57d7d4 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Tutorial Part 5 - self-aiming (todo).meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f70d4ae673156546bc242bac67fbf43 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c59d5d5d3bdb7664c920434a999d7323 3 | folderAsset: yes 4 | timeCreated: 1442419015 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/_Materials/Cannon.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Cannon 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _EMISSION 13 | m_LightmapFlags: 1 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0.42387542, g: 0.41176468, b: 0.41176468, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/_Materials/Cannon.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c1570c98211f604d8f48e18d081d6eb 3 | timeCreated: 1442478402 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Materials/Ground.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Ground 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _EMISSION 13 | m_LightmapFlags: 1 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0.6762409, g: 0.75735295, b: 0.4900519, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/_Materials/Ground.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3008bce2a2ae7e44390a8c8ededcb99a 3 | timeCreated: 1442419028 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Materials/Target texture.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Target texture 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _EMISSION 13 | m_LightmapFlags: 1 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 2800000, guid: a574d55006cf022448fa19e152c03864, type: 3} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/_Materials/Target texture.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a4ef0f60a4a1b884a97cadd66f1263ba 3 | timeCreated: 1443166915 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Materials/Trajectory.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Trajectory 11 | m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 5 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _Glossiness: 0.5 64 | - _Metallic: 0 65 | - _Mode: 0 66 | - _OcclusionStrength: 1 67 | - _Parallax: 0.02 68 | - _SrcBlend: 1 69 | - _UVSec: 0 70 | - _ZWrite: 1 71 | m_Colors: 72 | - _Color: {r: 0.5, g: 0.5110294, b: 0.5110294, a: 1} 73 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 74 | -------------------------------------------------------------------------------- /Assets/_Materials/Trajectory.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d18980edc27be8845950b679291f827a 3 | timeCreated: 1442478382 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/_Materials/target-texture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Ballistics-Tutorial/e6df72b489d49de3e7bf0697da1dadaaa4b946a6/Assets/_Materials/target-texture.jpg -------------------------------------------------------------------------------- /Assets/_Materials/target-texture.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a574d55006cf022448fa19e152c03864 3 | timeCreated: 1443166897 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 5 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: -1 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Erik Nordeus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "3.2.2", 5 | "com.unity.collab-proxy": "1.2.15", 6 | "com.unity.package-manager-ui": "2.0.8", 7 | "com.unity.purchasing": "2.0.3", 8 | "com.unity.textmeshpro": "1.4.1", 9 | "com.unity.modules.ai": "1.0.0", 10 | "com.unity.modules.animation": "1.0.0", 11 | "com.unity.modules.assetbundle": "1.0.0", 12 | "com.unity.modules.audio": "1.0.0", 13 | "com.unity.modules.cloth": "1.0.0", 14 | "com.unity.modules.director": "1.0.0", 15 | "com.unity.modules.imageconversion": "1.0.0", 16 | "com.unity.modules.imgui": "1.0.0", 17 | "com.unity.modules.jsonserialize": "1.0.0", 18 | "com.unity.modules.particlesystem": "1.0.0", 19 | "com.unity.modules.physics": "1.0.0", 20 | "com.unity.modules.physics2d": "1.0.0", 21 | "com.unity.modules.screencapture": "1.0.0", 22 | "com.unity.modules.terrain": "1.0.0", 23 | "com.unity.modules.terrainphysics": "1.0.0", 24 | "com.unity.modules.tilemap": "1.0.0", 25 | "com.unity.modules.ui": "1.0.0", 26 | "com.unity.modules.uielements": "1.0.0", 27 | "com.unity.modules.umbra": "1.0.0", 28 | "com.unity.modules.unityanalytics": "1.0.0", 29 | "com.unity.modules.unitywebrequest": "1.0.0", 30 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 31 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 32 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 33 | "com.unity.modules.unitywebrequestwww": "1.0.0", 34 | "com.unity.modules.vehicles": "1.0.0", 35 | "com.unity.modules.video": "1.0.0", 36 | "com.unity.modules.vr": "1.0.0", 37 | "com.unity.modules.wind": "1.0.0", 38 | "com.unity.modules.xr": "1.0.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 10 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ReuseCollisionCallbacks: 0 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Tutorial/tutorialSniper.unity 10 | guid: 00000000000000000000000000000000 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 1 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 2 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 0 16 | m_EtcTextureFastCompressor: 2 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 5 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Habrador/Unity-Ballistics-Tutorial/e6df72b489d49de3e7bf0697da1dadaaa4b946a6/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 0 46 | m_AutoSyncTransforms: 1 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 18 7 | productGUID: 7943a49f5a9e6c54ca6761d48cc33834 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: Erik Industries 16 | productName: Ballistics 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 540 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 1 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | displayResolutionDialog: 1 56 | iosUseCustomAppBackgroundBehavior: 0 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidStartInFullscreen: 1 67 | androidRenderOutsideSafeArea: 0 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 1 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | resizableWindow: 0 83 | useMacAppStoreValidation: 0 84 | macAppStoreCategory: public.app-category.games 85 | gpuSkinning: 0 86 | graphicsJobs: 0 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 0 93 | allowFullscreenSwitch: 1 94 | graphicsJobMode: 0 95 | fullscreenMode: 1 96 | xboxSpeechDB: 0 97 | xboxEnableHeadOrientation: 0 98 | xboxEnableGuest: 0 99 | xboxEnablePIXSampling: 0 100 | metalFramebufferOnly: 0 101 | xboxOneResolution: 0 102 | xboxOneSResolution: 0 103 | xboxOneXResolution: 3 104 | xboxOneMonoLoggingLevel: 0 105 | xboxOneLoggingLevel: 1 106 | xboxOneDisableEsram: 0 107 | xboxOnePresentImmediateThreshold: 0 108 | switchQueueCommandMemory: 1048576 109 | switchQueueControlMemory: 16384 110 | switchQueueComputeMemory: 262144 111 | switchNVNShaderPoolsGranularity: 33554432 112 | switchNVNDefaultPoolsGranularity: 16777216 113 | switchNVNOtherPoolsGranularity: 16777216 114 | vulkanEnableSetSRGBWrite: 0 115 | m_SupportedAspectRatios: 116 | 4:3: 1 117 | 5:4: 1 118 | 16:10: 1 119 | 16:9: 1 120 | Others: 1 121 | bundleVersion: 1.0 122 | preloadedAssets: [] 123 | metroInputSource: 0 124 | wsaTransparentSwapchain: 0 125 | m_HolographicPauseOnTrackingLoss: 1 126 | xboxOneDisableKinectGpuReservation: 0 127 | xboxOneEnable7thCore: 0 128 | isWsaHolographicRemotingEnabled: 0 129 | vrSettings: 130 | cardboard: 131 | depthFormat: 0 132 | enableTransitionView: 0 133 | daydream: 134 | depthFormat: 0 135 | useSustainedPerformanceMode: 0 136 | enableVideoLayer: 0 137 | useProtectedVideoMemory: 0 138 | minimumSupportedHeadTracking: 0 139 | maximumSupportedHeadTracking: 1 140 | hololens: 141 | depthFormat: 1 142 | depthBufferSharingEnabled: 1 143 | oculus: 144 | sharedDepthBuffer: 1 145 | dashSupport: 1 146 | lowOverheadMode: 0 147 | protectedContext: 0 148 | v2Signing: 0 149 | enable360StereoCapture: 0 150 | protectGraphicsMemory: 0 151 | enableFrameTimingStats: 0 152 | useHDRDisplay: 0 153 | m_ColorGamuts: 00000000 154 | targetPixelDensity: 30 155 | resolutionScalingMode: 0 156 | androidSupportedAspectRatio: 1 157 | androidMaxAspectRatio: 2.1 158 | applicationIdentifier: 159 | Android: com.Company.ProductName 160 | Standalone: unity.Erik Industries.Ballistics 161 | Tizen: com.Company.ProductName 162 | iOS: com.Company.ProductName 163 | tvOS: com.Company.ProductName 164 | buildNumber: 165 | iOS: 0 166 | AndroidBundleVersionCode: 1 167 | AndroidMinSdkVersion: 16 168 | AndroidTargetSdkVersion: 0 169 | AndroidPreferredInstallLocation: 1 170 | aotOptions: 171 | stripEngineCode: 1 172 | iPhoneStrippingLevel: 0 173 | iPhoneScriptCallOptimization: 0 174 | ForceInternetPermission: 0 175 | ForceSDCardPermission: 0 176 | CreateWallpaper: 0 177 | APKExpansionFiles: 0 178 | keepLoadedShadersAlive: 0 179 | StripUnusedMeshComponents: 0 180 | VertexChannelCompressionMask: 214 181 | iPhoneSdkVersion: 988 182 | iOSTargetOSVersionString: 9.0 183 | tvOSSdkVersion: 0 184 | tvOSRequireExtendedGameController: 0 185 | tvOSTargetOSVersionString: 9.0 186 | uIPrerenderedIcon: 0 187 | uIRequiresPersistentWiFi: 0 188 | uIRequiresFullScreen: 1 189 | uIStatusBarHidden: 1 190 | uIExitOnSuspend: 0 191 | uIStatusBarStyle: 0 192 | iPhoneSplashScreen: {fileID: 0} 193 | iPhoneHighResSplashScreen: {fileID: 0} 194 | iPhoneTallHighResSplashScreen: {fileID: 0} 195 | iPhone47inSplashScreen: {fileID: 0} 196 | iPhone55inPortraitSplashScreen: {fileID: 0} 197 | iPhone55inLandscapeSplashScreen: {fileID: 0} 198 | iPhone58inPortraitSplashScreen: {fileID: 0} 199 | iPhone58inLandscapeSplashScreen: {fileID: 0} 200 | iPadPortraitSplashScreen: {fileID: 0} 201 | iPadHighResPortraitSplashScreen: {fileID: 0} 202 | iPadLandscapeSplashScreen: {fileID: 0} 203 | iPadHighResLandscapeSplashScreen: {fileID: 0} 204 | appleTVSplashScreen: {fileID: 0} 205 | appleTVSplashScreen2x: {fileID: 0} 206 | tvOSSmallIconLayers: [] 207 | tvOSSmallIconLayers2x: [] 208 | tvOSLargeIconLayers: [] 209 | tvOSLargeIconLayers2x: [] 210 | tvOSTopShelfImageLayers: [] 211 | tvOSTopShelfImageLayers2x: [] 212 | tvOSTopShelfImageWideLayers: [] 213 | tvOSTopShelfImageWideLayers2x: [] 214 | iOSLaunchScreenType: 0 215 | iOSLaunchScreenPortrait: {fileID: 0} 216 | iOSLaunchScreenLandscape: {fileID: 0} 217 | iOSLaunchScreenBackgroundColor: 218 | serializedVersion: 2 219 | rgba: 0 220 | iOSLaunchScreenFillPct: 100 221 | iOSLaunchScreenSize: 100 222 | iOSLaunchScreenCustomXibPath: 223 | iOSLaunchScreeniPadType: 0 224 | iOSLaunchScreeniPadImage: {fileID: 0} 225 | iOSLaunchScreeniPadBackgroundColor: 226 | serializedVersion: 2 227 | rgba: 0 228 | iOSLaunchScreeniPadFillPct: 100 229 | iOSLaunchScreeniPadSize: 100 230 | iOSLaunchScreeniPadCustomXibPath: 231 | iOSUseLaunchScreenStoryboard: 0 232 | iOSLaunchScreenCustomStoryboardPath: 233 | iOSDeviceRequirements: [] 234 | iOSURLSchemes: [] 235 | iOSBackgroundModes: 0 236 | iOSMetalForceHardShadows: 0 237 | metalEditorSupport: 1 238 | metalAPIValidation: 1 239 | iOSRenderExtraFrameOnPause: 1 240 | appleDeveloperTeamID: 241 | iOSManualSigningProvisioningProfileID: 242 | tvOSManualSigningProvisioningProfileID: 243 | iOSManualSigningProvisioningProfileType: 0 244 | tvOSManualSigningProvisioningProfileType: 0 245 | appleEnableAutomaticSigning: 0 246 | iOSRequireARKit: 0 247 | iOSAutomaticallyDetectAndAddCapabilities: 1 248 | appleEnableProMotion: 0 249 | clonedFromGUID: 00000000000000000000000000000000 250 | templatePackageId: 251 | templateDefaultScene: 252 | AndroidTargetArchitectures: 5 253 | AndroidSplashScreenScale: 0 254 | androidSplashScreen: {fileID: 0} 255 | AndroidKeystoreName: 256 | AndroidKeyaliasName: 257 | AndroidBuildApkPerCpuArchitecture: 0 258 | AndroidTVCompatibility: 1 259 | AndroidIsGame: 1 260 | AndroidEnableTango: 0 261 | androidEnableBanner: 1 262 | androidUseLowAccuracyLocation: 0 263 | m_AndroidBanners: 264 | - width: 320 265 | height: 180 266 | banner: {fileID: 0} 267 | androidGamepadSupportLevel: 0 268 | resolutionDialogBanner: {fileID: 0} 269 | m_BuildTargetIcons: 270 | - m_BuildTarget: 271 | m_Icons: 272 | - serializedVersion: 2 273 | m_Icon: {fileID: 0} 274 | m_Width: 128 275 | m_Height: 128 276 | m_Kind: 0 277 | m_BuildTargetPlatformIcons: [] 278 | m_BuildTargetBatching: [] 279 | m_BuildTargetGraphicsAPIs: [] 280 | m_BuildTargetVRSettings: [] 281 | m_BuildTargetEnableVuforiaSettings: [] 282 | openGLRequireES31: 0 283 | openGLRequireES31AEP: 0 284 | m_TemplateCustomTags: {} 285 | mobileMTRendering: 286 | iPhone: 1 287 | tvOS: 1 288 | m_BuildTargetGroupLightmapEncodingQuality: 289 | - m_BuildTarget: Standalone 290 | m_EncodingQuality: 1 291 | - m_BuildTarget: XboxOne 292 | m_EncodingQuality: 1 293 | - m_BuildTarget: PS4 294 | m_EncodingQuality: 1 295 | m_BuildTargetGroupLightmapSettings: [] 296 | playModeTestRunnerEnabled: 0 297 | runPlayModeTestAsEditModeTest: 0 298 | actionOnDotNetUnhandledException: 1 299 | enableInternalProfiler: 0 300 | logObjCUncaughtExceptions: 1 301 | enableCrashReportAPI: 0 302 | cameraUsageDescription: 303 | locationUsageDescription: 304 | microphoneUsageDescription: 305 | switchNetLibKey: 306 | switchSocketMemoryPoolSize: 6144 307 | switchSocketAllocatorPoolSize: 128 308 | switchSocketConcurrencyLimit: 14 309 | switchScreenResolutionBehavior: 2 310 | switchUseCPUProfiler: 0 311 | switchApplicationID: 0x01004b9000490000 312 | switchNSODependencies: 313 | switchTitleNames_0: 314 | switchTitleNames_1: 315 | switchTitleNames_2: 316 | switchTitleNames_3: 317 | switchTitleNames_4: 318 | switchTitleNames_5: 319 | switchTitleNames_6: 320 | switchTitleNames_7: 321 | switchTitleNames_8: 322 | switchTitleNames_9: 323 | switchTitleNames_10: 324 | switchTitleNames_11: 325 | switchTitleNames_12: 326 | switchTitleNames_13: 327 | switchTitleNames_14: 328 | switchPublisherNames_0: 329 | switchPublisherNames_1: 330 | switchPublisherNames_2: 331 | switchPublisherNames_3: 332 | switchPublisherNames_4: 333 | switchPublisherNames_5: 334 | switchPublisherNames_6: 335 | switchPublisherNames_7: 336 | switchPublisherNames_8: 337 | switchPublisherNames_9: 338 | switchPublisherNames_10: 339 | switchPublisherNames_11: 340 | switchPublisherNames_12: 341 | switchPublisherNames_13: 342 | switchPublisherNames_14: 343 | switchIcons_0: {fileID: 0} 344 | switchIcons_1: {fileID: 0} 345 | switchIcons_2: {fileID: 0} 346 | switchIcons_3: {fileID: 0} 347 | switchIcons_4: {fileID: 0} 348 | switchIcons_5: {fileID: 0} 349 | switchIcons_6: {fileID: 0} 350 | switchIcons_7: {fileID: 0} 351 | switchIcons_8: {fileID: 0} 352 | switchIcons_9: {fileID: 0} 353 | switchIcons_10: {fileID: 0} 354 | switchIcons_11: {fileID: 0} 355 | switchIcons_12: {fileID: 0} 356 | switchIcons_13: {fileID: 0} 357 | switchIcons_14: {fileID: 0} 358 | switchSmallIcons_0: {fileID: 0} 359 | switchSmallIcons_1: {fileID: 0} 360 | switchSmallIcons_2: {fileID: 0} 361 | switchSmallIcons_3: {fileID: 0} 362 | switchSmallIcons_4: {fileID: 0} 363 | switchSmallIcons_5: {fileID: 0} 364 | switchSmallIcons_6: {fileID: 0} 365 | switchSmallIcons_7: {fileID: 0} 366 | switchSmallIcons_8: {fileID: 0} 367 | switchSmallIcons_9: {fileID: 0} 368 | switchSmallIcons_10: {fileID: 0} 369 | switchSmallIcons_11: {fileID: 0} 370 | switchSmallIcons_12: {fileID: 0} 371 | switchSmallIcons_13: {fileID: 0} 372 | switchSmallIcons_14: {fileID: 0} 373 | switchManualHTML: 374 | switchAccessibleURLs: 375 | switchLegalInformation: 376 | switchMainThreadStackSize: 1048576 377 | switchPresenceGroupId: 378 | switchLogoHandling: 0 379 | switchReleaseVersion: 0 380 | switchDisplayVersion: 1.0.0 381 | switchStartupUserAccount: 0 382 | switchTouchScreenUsage: 0 383 | switchSupportedLanguagesMask: 0 384 | switchLogoType: 0 385 | switchApplicationErrorCodeCategory: 386 | switchUserAccountSaveDataSize: 0 387 | switchUserAccountSaveDataJournalSize: 0 388 | switchApplicationAttribute: 0 389 | switchCardSpecSize: -1 390 | switchCardSpecClock: -1 391 | switchRatingsMask: 0 392 | switchRatingsInt_0: 0 393 | switchRatingsInt_1: 0 394 | switchRatingsInt_2: 0 395 | switchRatingsInt_3: 0 396 | switchRatingsInt_4: 0 397 | switchRatingsInt_5: 0 398 | switchRatingsInt_6: 0 399 | switchRatingsInt_7: 0 400 | switchRatingsInt_8: 0 401 | switchRatingsInt_9: 0 402 | switchRatingsInt_10: 0 403 | switchRatingsInt_11: 0 404 | switchRatingsInt_12: 0 405 | switchLocalCommunicationIds_0: 406 | switchLocalCommunicationIds_1: 407 | switchLocalCommunicationIds_2: 408 | switchLocalCommunicationIds_3: 409 | switchLocalCommunicationIds_4: 410 | switchLocalCommunicationIds_5: 411 | switchLocalCommunicationIds_6: 412 | switchLocalCommunicationIds_7: 413 | switchParentalControl: 0 414 | switchAllowsScreenshot: 1 415 | switchAllowsVideoCapturing: 1 416 | switchAllowsRuntimeAddOnContentInstall: 0 417 | switchDataLossConfirmation: 0 418 | switchUserAccountLockEnabled: 0 419 | switchSystemResourceMemory: 16777216 420 | switchSupportedNpadStyles: 3 421 | switchNativeFsCacheSize: 32 422 | switchIsHoldTypeHorizontal: 0 423 | switchSupportedNpadCount: 8 424 | switchSocketConfigEnabled: 0 425 | switchTcpInitialSendBufferSize: 32 426 | switchTcpInitialReceiveBufferSize: 64 427 | switchTcpAutoSendBufferSizeMax: 256 428 | switchTcpAutoReceiveBufferSizeMax: 256 429 | switchUdpSendBufferSize: 9 430 | switchUdpReceiveBufferSize: 42 431 | switchSocketBufferEfficiency: 4 432 | switchSocketInitializeEnabled: 1 433 | switchNetworkInterfaceManagerInitializeEnabled: 1 434 | switchPlayerConnectionEnabled: 1 435 | ps4NPAgeRating: 12 436 | ps4NPTitleSecret: 437 | ps4NPTrophyPackPath: 438 | ps4ParentalLevel: 1 439 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 440 | ps4Category: 0 441 | ps4MasterVersion: 01.00 442 | ps4AppVersion: 01.00 443 | ps4AppType: 0 444 | ps4ParamSfxPath: 445 | ps4VideoOutPixelFormat: 0 446 | ps4VideoOutInitialWidth: 1920 447 | ps4VideoOutBaseModeInitialWidth: 1920 448 | ps4VideoOutReprojectionRate: 120 449 | ps4PronunciationXMLPath: 450 | ps4PronunciationSIGPath: 451 | ps4BackgroundImagePath: 452 | ps4StartupImagePath: 453 | ps4StartupImagesFolder: 454 | ps4IconImagesFolder: 455 | ps4SaveDataImagePath: 456 | ps4SdkOverride: 457 | ps4BGMPath: 458 | ps4ShareFilePath: 459 | ps4ShareOverlayImagePath: 460 | ps4PrivacyGuardImagePath: 461 | ps4NPtitleDatPath: 462 | ps4RemotePlayKeyAssignment: -1 463 | ps4RemotePlayKeyMappingDir: 464 | ps4PlayTogetherPlayerCount: 0 465 | ps4EnterButtonAssignment: 1 466 | ps4ApplicationParam1: 0 467 | ps4ApplicationParam2: 0 468 | ps4ApplicationParam3: 0 469 | ps4ApplicationParam4: 0 470 | ps4DownloadDataSize: 0 471 | ps4GarlicHeapSize: 2048 472 | ps4ProGarlicHeapSize: 2560 473 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 474 | ps4pnSessions: 1 475 | ps4pnPresence: 1 476 | ps4pnFriends: 1 477 | ps4pnGameCustomData: 1 478 | playerPrefsSupport: 0 479 | enableApplicationExit: 0 480 | resetTempFolder: 1 481 | restrictedAudioUsageRights: 0 482 | ps4UseResolutionFallback: 0 483 | ps4ReprojectionSupport: 0 484 | ps4UseAudio3dBackend: 0 485 | ps4SocialScreenEnabled: 0 486 | ps4ScriptOptimizationLevel: 3 487 | ps4Audio3dVirtualSpeakerCount: 14 488 | ps4attribCpuUsage: 0 489 | ps4PatchPkgPath: 490 | ps4PatchLatestPkgPath: 491 | ps4PatchChangeinfoPath: 492 | ps4PatchDayOne: 0 493 | ps4attribUserManagement: 0 494 | ps4attribMoveSupport: 0 495 | ps4attrib3DSupport: 0 496 | ps4attribShareSupport: 0 497 | ps4attribExclusiveVR: 0 498 | ps4disableAutoHideSplash: 0 499 | ps4videoRecordingFeaturesUsed: 0 500 | ps4contentSearchFeaturesUsed: 0 501 | ps4attribEyeToEyeDistanceSettingVR: 0 502 | ps4IncludedModules: [] 503 | monoEnv: 504 | splashScreenBackgroundSourceLandscape: {fileID: 0} 505 | splashScreenBackgroundSourcePortrait: {fileID: 0} 506 | spritePackerPolicy: 507 | webGLMemorySize: 256 508 | webGLExceptionSupport: 1 509 | webGLNameFilesAsHashes: 0 510 | webGLDataCaching: 0 511 | webGLDebugSymbols: 0 512 | webGLEmscriptenArgs: 513 | webGLModulesDirectory: 514 | webGLTemplate: APPLICATION:Default 515 | webGLAnalyzeBuildSize: 0 516 | webGLUseEmbeddedResources: 0 517 | webGLCompressionFormat: 1 518 | webGLLinkerTarget: 1 519 | webGLThreadsSupport: 0 520 | scriptingDefineSymbols: 521 | 1: CROSS_PLATFORM_INPUT 522 | 2: CROSS_PLATFORM_INPUT 523 | 4: CROSS_PLATFORM_INPUT;MOBILE_INPUT 524 | 7: CROSS_PLATFORM_INPUT;MOBILE_INPUT 525 | 14: MOBILE_INPUT 526 | 15: CROSS_PLATFORM_INPUT;MOBILE_INPUT 527 | 16: CROSS_PLATFORM_INPUT;MOBILE_INPUT 528 | 17: MOBILE_INPUT 529 | 20: MOBILE_INPUT 530 | platformArchitecture: 531 | iOS: 2 532 | scriptingBackend: 533 | Android: 0 534 | Metro: 2 535 | Standalone: 0 536 | WP8: 2 537 | WebGL: 1 538 | WebPlayer: 0 539 | iOS: 1 540 | il2cppCompilerConfiguration: {} 541 | managedStrippingLevel: {} 542 | incrementalIl2cppBuild: 543 | iOS: 0 544 | allowUnsafeCode: 0 545 | additionalIl2CppArgs: 546 | scriptingRuntimeVersion: 1 547 | apiCompatibilityLevelPerPlatform: {} 548 | m_RenderingPath: 1 549 | m_MobileRenderingPath: 1 550 | metroPackageName: Ballistics 551 | metroPackageVersion: 552 | metroCertificatePath: 553 | metroCertificatePassword: 554 | metroCertificateSubject: 555 | metroCertificateIssuer: 556 | metroCertificateNotAfter: 0000000000000000 557 | metroApplicationDescription: Ballistics 558 | wsaImages: {} 559 | metroTileShortName: 560 | metroTileShowName: 0 561 | metroMediumTileShowName: 0 562 | metroLargeTileShowName: 0 563 | metroWideTileShowName: 0 564 | metroSupportStreamingInstall: 0 565 | metroLastRequiredScene: 0 566 | metroDefaultTileSize: 1 567 | metroTileForegroundText: 1 568 | metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1} 569 | metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1} 570 | metroSplashScreenUseBackgroundColor: 0 571 | platformCapabilities: {} 572 | metroTargetDeviceFamilies: {} 573 | metroFTAName: 574 | metroFTAFileTypes: [] 575 | metroProtocolName: 576 | metroCompilationOverrides: 1 577 | XboxOneProductId: 578 | XboxOneUpdateKey: 579 | XboxOneSandboxId: 580 | XboxOneContentId: 581 | XboxOneTitleId: 582 | XboxOneSCId: 583 | XboxOneGameOsOverridePath: 584 | XboxOnePackagingOverridePath: 585 | XboxOneAppManifestOverridePath: 586 | XboxOneVersion: 1.0.0.0 587 | XboxOnePackageEncryption: 0 588 | XboxOnePackageUpdateGranularity: 2 589 | XboxOneDescription: 590 | XboxOneLanguage: 591 | - enus 592 | XboxOneCapability: [] 593 | XboxOneGameRating: {} 594 | XboxOneIsContentPackage: 0 595 | XboxOneEnableGPUVariability: 0 596 | XboxOneSockets: {} 597 | XboxOneSplashScreen: {fileID: 0} 598 | XboxOneAllowedProductIds: [] 599 | XboxOnePersistentLocalStorageSize: 0 600 | XboxOneXTitleMemory: 8 601 | xboxOneScriptCompiler: 0 602 | XboxOneOverrideIdentityName: 603 | vrEditorSettings: 604 | daydream: 605 | daydreamIconForeground: {fileID: 0} 606 | daydreamIconBackground: {fileID: 0} 607 | cloudServicesEnabled: {} 608 | luminIcon: 609 | m_Name: 610 | m_ModelFolderPath: 611 | m_PortalFolderPath: 612 | luminCert: 613 | m_CertPath: 614 | m_PrivateKeyPath: 615 | luminIsChannelApp: 0 616 | luminVersion: 617 | m_VersionCode: 1 618 | m_VersionName: 619 | facebookSdkVersion: 7.9.1 620 | facebookAppId: 621 | facebookCookies: 1 622 | facebookLogging: 1 623 | facebookStatus: 1 624 | facebookXfbml: 0 625 | facebookFrictionlessRequests: 1 626 | apiCompatibilityLevel: 6 627 | cloudProjectId: 628 | framebufferDepthMemorylessMode: 0 629 | projectName: 630 | organizationId: 631 | cloudEnabled: 0 632 | enableNativePlatformBackendsForNewInputSystem: 0 633 | disableOldInputManagerSupport: 0 634 | legacyClampBlendShapeWeights: 1 635 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.4.14f1 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Fastest 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Fast 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Simple 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 0 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: Good 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Beautiful 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Fantastic 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | BlackBerry: 2 222 | GLES Emulation: 5 223 | PS3: 5 224 | PS4: 5 225 | PSM: 5 226 | PSP2: 5 227 | Samsung TV: 2 228 | Standalone: 5 229 | Tizen: 2 230 | WP8: 5 231 | Web: 5 232 | WebGL: 3 233 | Windows Store Apps: 5 234 | XBOX360: 5 235 | XboxOne: 5 236 | iPhone: 2 237 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: 7 | - Target 8 | - Ground 9 | layers: 10 | - Default 11 | - TransparentFX 12 | - Ignore Raycast 13 | - 14 | - Water 15 | - UI 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | - 41 | - 42 | m_SortingLayers: 43 | - name: Default 44 | uniqueID: 0 45 | locked: 0 46 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity Ballistics Tutorial 2 | 3 | Tutorial on how to make realistic bullets in Unity 4 | 5 | YouTube video showing the result: 6 | 7 | [![Bullet physics in Unity video](http://img.youtube.com/vi/eA60HDTnfnQ/0.jpg)](http://www.youtube.com/watch?v=eA60HDTnfnQ "Bullet physics in Unity video") 8 | 9 | Link to the tutorial: https://www.habrador.com/tutorials/unity-realistic-bullets/ 10 | 11 | Notice that the code is not exactly the same as in the tutorial because I've learned some things over the years. But the basic concept is the same. The main change is that I added the factor from the wind in the forces that affects the bullet instead of affecting the velocity of the bullet. This should be more physically accurate. I also added a force called lift. 12 | 13 | Follow me on Twitter for more Unity stuff: https://twitter.com/eriknordeus 14 | --------------------------------------------------------------------------------