Bläddra i källkod

try adding muzzle light

Niels Meyering 9 år sedan
förälder
incheckning
dccc57bc04

+ 10 - 5
game/Assets/Ground.mat

@@ -8,7 +8,7 @@ Material:
   m_PrefabInternal: {fileID: 0}
   m_Name: Ground
   m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
-  m_ShaderKeywords: 
+  m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
   m_LightmapFlags: 4
   m_EnableInstancingVariants: 0
   m_DoubleSidedGI: 0
@@ -39,7 +39,7 @@ Material:
         m_Scale: {x: 24, y: 24}
         m_Offset: {x: 0, y: 0}
     - _MainTex:
-        m_Texture: {fileID: 2800000, guid: d5549b43649235c4991d9c1bb5eddda0, type: 3}
+        m_Texture: {fileID: 0}
         m_Scale: {x: 24, y: 24}
         m_Offset: {x: 0, y: 0}
     - _MetallicGlossMap:
@@ -54,6 +54,10 @@ Material:
         m_Texture: {fileID: 0}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
+    - _SpecGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
     m_Floats:
     - _BumpScale: 1
     - _Cutoff: 0.5
@@ -61,16 +65,17 @@ Material:
     - _DstBlend: 0
     - _GlossMapScale: 1
     - _Glossiness: 0
-    - _GlossyReflections: 1
+    - _GlossyReflections: 0
     - _Metallic: 0
     - _Mode: 0
     - _OcclusionStrength: 1
     - _Parallax: 0.02
     - _SmoothnessTextureChannel: 0
-    - _SpecularHighlights: 1
+    - _SpecularHighlights: 0
     - _SrcBlend: 1
     - _UVSec: 0
     - _ZWrite: 1
     m_Colors:
-    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _Color: {r: 0.35294116, g: 0.34230998, b: 0.28287196, a: 1}
     - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+    - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}

+ 3 - 3
game/Assets/PostProcessingProfile.asset

@@ -97,12 +97,12 @@ MonoBehaviour:
       logMin: -8
       logMax: 4
   bloom:
-    m_Enabled: 1
+    m_Enabled: 0
     m_Settings:
       bloom:
         intensity: 5
-        threshold: 0.95
-        softKnee: 0.37
+        threshold: 0.9
+        softKnee: 0.14
         radius: 3
         antiFlicker: 0
       lensDirt:

+ 68 - 0
game/Assets/Scenes/PlayerMovement.unity

@@ -646,6 +646,69 @@ Prefab:
       propertyPath: m_RootOrder
       value: 2
       objectReference: {fileID: 0}
+    - target: {fileID: 136162553559348022, guid: e6383ffd9f8688f4a9ba9705843d54e2,
+        type: 2}
+      propertyPath: m_Enabled
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 114322613409989222, guid: e6383ffd9f8688f4a9ba9705843d54e2,
+        type: 2}
+      propertyPath: cameraSmoothingSeconds
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 4475041197474250, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
+      propertyPath: m_LocalPosition.x
+      value: 0.382
+      objectReference: {fileID: 0}
+    - target: {fileID: 4475041197474250, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
+      propertyPath: m_LocalPosition.z
+      value: 0.769
+      objectReference: {fileID: 0}
+    - target: {fileID: 4339398362766808, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 4339398362766808, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
+      propertyPath: m_LocalPosition.z
+      value: 0.222
+      objectReference: {fileID: 0}
+    - target: {fileID: 4339398362766808, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 108365963384445830, guid: e6383ffd9f8688f4a9ba9705843d54e2,
+        type: 2}
+      propertyPath: m_Range
+      value: 7
+      objectReference: {fileID: 0}
+    - target: {fileID: 108365963384445830, guid: e6383ffd9f8688f4a9ba9705843d54e2,
+        type: 2}
+      propertyPath: m_Intensity
+      value: 2
+      objectReference: {fileID: 0}
+    - target: {fileID: 108365963384445830, guid: e6383ffd9f8688f4a9ba9705843d54e2,
+        type: 2}
+      propertyPath: m_BounceIntensity
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 4002318456081080, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
+      propertyPath: m_LocalScale.y
+      value: 0.3321895
+      objectReference: {fileID: 0}
+    - target: {fileID: 4002318456081080, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
+      propertyPath: m_LocalPosition.z
+      value: 0.37
+      objectReference: {fileID: 0}
+    - target: {fileID: 114322613409989222, guid: e6383ffd9f8688f4a9ba9705843d54e2,
+        type: 2}
+      propertyPath: muzzleLight
+      value: 
+      objectReference: {fileID: 1713788283}
+    - target: {fileID: 108365963384445830, guid: e6383ffd9f8688f4a9ba9705843d54e2,
+        type: 2}
+      propertyPath: m_Shadows.m_Type
+      value: 2
+      objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 100100000, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
   m_IsPrefabParent: 0
@@ -731,6 +794,11 @@ MeshFilter:
   m_PrefabInternal: {fileID: 0}
   m_GameObject: {fileID: 1474727393}
   m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
+--- !u!108 &1713788283 stripped
+Light:
+  m_PrefabParentObject: {fileID: 108365963384445830, guid: e6383ffd9f8688f4a9ba9705843d54e2,
+    type: 2}
+  m_PrefabInternal: {fileID: 1434741441}
 --- !u!1 &1731892629
 GameObject:
   m_ObjectHideFlags: 0

+ 17 - 2
game/Assets/Scripts/Player.cs

@@ -11,6 +11,7 @@ public class Player : MonoBehaviour
     public float bulletForce = 10f;
     public Transform gunTransform;
     public Rigidbody bulletPrefab;
+    public Light muzzleLight;
 
     private Vector3 inputDirection;
     private float speed;
@@ -20,12 +21,14 @@ public class Player : MonoBehaviour
     private Vector3 cameraOffset;
     private Vector3 cameraVelocity;
     private bool shooting = false;
+    private float lightIntensity;
 
     // Use this for initialization
 	void Start ()
 	{
 	    speed = startSpeed;
 	    cameraOffset = Camera.main.transform.position - transform.position;
+	    lightIntensity = muzzleLight.intensity;
 	}
 	
 	// Update is called once per frame
@@ -41,8 +44,20 @@ public class Player : MonoBehaviour
 	    Camera.main.transform.position = Vector3.SmoothDamp(Camera.main.transform.localPosition, TargetCameraPosition(), ref cameraVelocity, cameraSmoothingSeconds);
 
 	    if (shooting)
+        {
+            if (Time.frameCount % 2 == 0)
+            {
+                muzzleLight.intensity = 0;
+            }
+            else
+            {
+                muzzleLight.intensity = Random.Range(.5f,2f) * lightIntensity;
+            }
+            Shoot();
+	    }
+	    else
 	    {
-	        Shoot();
+	        muzzleLight.intensity = 0;
 	    }
 	}
 
@@ -51,7 +66,7 @@ public class Player : MonoBehaviour
         var rb = Instantiate<Rigidbody>(bulletPrefab);
         rb.transform.position = gunTransform.position;
         rb.transform.forward = gunTransform.forward;
-        rb.AddForce(bulletForce * (transform.forward + Vector3.up * bulletUpBias), ForceMode.Impulse);
+        rb.AddForce(bulletForce * (transform.forward + Vector3.up * bulletUpBias), ForceMode.VelocityChange);
         Destroy(rb.gameObject, 2f);
     }
 

+ 4 - 4
game/ProjectSettings/InputManager.asset

@@ -13,9 +13,9 @@ InputManager:
     positiveButton: right
     altNegativeButton: a
     altPositiveButton: d
-    gravity: 3
+    gravity: 10000
     dead: 0.001
-    sensitivity: 3
+    sensitivity: 10000
     snap: 1
     invert: 0
     type: 0
@@ -29,9 +29,9 @@ InputManager:
     positiveButton: up
     altNegativeButton: s
     altPositiveButton: w
-    gravity: 3
+    gravity: 10000
     dead: 0.001
-    sensitivity: 3
+    sensitivity: 10000
     snap: 1
     invert: 0
     type: 0