Sfoglia il codice sorgente

some crappy sounds xD

Erik Wittkorn 9 anni fa
parent
commit
fd4c0c3514

+ 85 - 0
game/Assets/Prefabs/Enemy.prefab

@@ -73,6 +73,7 @@ GameObject:
   - component: {fileID: 114575230278841902}
   - component: {fileID: 195082989610082518}
   - component: {fileID: 136367055930384742}
+  - component: {fileID: 82026114199403268}
   m_Layer: 0
   m_Name: Enemy
   m_TagString: Untagged
@@ -1883,6 +1884,86 @@ MeshFilter:
   m_PrefabInternal: {fileID: 100100000}
   m_GameObject: {fileID: 1266103636548028}
   m_Mesh: {fileID: 4300048, guid: e3361cd0f09938f408c722a0bc8509e7, type: 3}
+--- !u!82 &82026114199403268
+AudioSource:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1196849215294664}
+  m_Enabled: 1
+  serializedVersion: 4
+  OutputAudioMixerGroup: {fileID: 0}
+  m_audioClip: {fileID: 0}
+  m_PlayOnAwake: 0
+  m_Volume: 1
+  m_Pitch: 1
+  Loop: 0
+  Mute: 0
+  Spatialize: 0
+  SpatializePostEffects: 0
+  Priority: 128
+  DopplerLevel: 1
+  MinDistance: 1
+  MaxDistance: 500
+  Pan2D: 0
+  rolloffMode: 0
+  BypassEffects: 0
+  BypassListenerEffects: 0
+  BypassReverbZones: 0
+  rolloffCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 1
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    - serializedVersion: 2
+      time: 1
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 4
+  panLevelCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 0
+  spreadCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 4
+  reverbZoneMixCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 1
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 0
 --- !u!114 &114575230278841902
 MonoBehaviour:
   m_ObjectHideFlags: 1
@@ -1902,6 +1983,10 @@ MonoBehaviour:
   IndicatorCoverHigh: {fileID: 1601112143768466}
   IndicatorCoverFull: {fileID: 1507475458156676}
   maxHealth: 2.5
+  explosion: {fileID: 8300000, guid: 3b3e9d9eda9dda74ca7e408a4a64fc07, type: 3}
+  hitMe:
+  - {fileID: 8300000, guid: c4acb2fa87effaf4bbf03a684381ba59, type: 3}
+  - {fileID: 8300000, guid: 1efad384da755b149bd646a40facbfe6, type: 3}
   weapon: {fileID: 114593885084691842}
 --- !u!114 &114593885084691842
 MonoBehaviour:

+ 81 - 0
game/Assets/Prefabs/Player.prefab

@@ -210,6 +210,7 @@ GameObject:
   - component: {fileID: 136524866534269892}
   - component: {fileID: 114322613409989222}
   - component: {fileID: 54168428832351466}
+  - component: {fileID: 82647207684349442}
   m_Layer: 0
   m_Name: Player
   m_TagString: Player
@@ -1733,6 +1734,86 @@ BoxCollider:
   serializedVersion: 2
   m_Size: {x: 1, y: 1, z: 1}
   m_Center: {x: 0, y: 0, z: 0}
+--- !u!82 &82647207684349442
+AudioSource:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1341517319831398}
+  m_Enabled: 1
+  serializedVersion: 4
+  OutputAudioMixerGroup: {fileID: 0}
+  m_audioClip: {fileID: 8300000, guid: c254e5c1d772ba8449d1d4f36abe102d, type: 3}
+  m_PlayOnAwake: 0
+  m_Volume: 1
+  m_Pitch: 1.5
+  Loop: 0
+  Mute: 0
+  Spatialize: 0
+  SpatializePostEffects: 0
+  Priority: 128
+  DopplerLevel: 1
+  MinDistance: 1
+  MaxDistance: 500
+  Pan2D: 0
+  rolloffMode: 0
+  BypassEffects: 0
+  BypassListenerEffects: 0
+  BypassReverbZones: 0
+  rolloffCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 1
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    - serializedVersion: 2
+      time: 1
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 4
+  panLevelCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 0
+  spreadCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 4
+  reverbZoneMixCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 1
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 0
 --- !u!95 &95509758976004482
 Animator:
   serializedVersion: 3

+ 88 - 7
game/Assets/Scenes/Main.unity

@@ -883,7 +883,7 @@ RectTransform:
   m_Children:
   - {fileID: 127693554}
   m_Father: {fileID: 0}
-  m_RootOrder: 13
+  m_RootOrder: 14
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
@@ -2060,7 +2060,7 @@ Transform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 0}
-  m_RootOrder: 2
+  m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
 --- !u!1001 &580045341
 Prefab:
@@ -2422,7 +2422,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
-  m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
+  m_Color: {r: 1, g: 0, b: 0, a: 1}
   m_RaycastTarget: 1
   m_OnCullStateChanged:
     m_PersistentCalls:
@@ -2486,7 +2486,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4016758563413220, guid: 33baed11feb9da44b9aa11678990fc51, type: 2}
       propertyPath: m_RootOrder
-      value: 6
+      value: 5
       objectReference: {fileID: 0}
     - target: {fileID: 1400659369070184, guid: 33baed11feb9da44b9aa11678990fc51, type: 2}
       propertyPath: m_IsActive
@@ -3510,7 +3510,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4531056758406446, guid: 577edfe1bc6758a4d9b91d58d990d07e, type: 2}
       propertyPath: m_RootOrder
-      value: 14
+      value: 13
       objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 100100000, guid: 577edfe1bc6758a4d9b91d58d990d07e, type: 2}
@@ -3908,7 +3908,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4413073277323274, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
       propertyPath: m_RootOrder
-      value: 3
+      value: 2
       objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 100100000, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
@@ -3926,6 +3926,7 @@ GameObject:
   - component: {fileID: 1278158973}
   - component: {fileID: 1278158972}
   - component: {fileID: 1278158977}
+  - component: {fileID: 1278158978}
   m_Layer: 0
   m_Name: Main Camera
   m_TagString: MainCamera
@@ -4014,6 +4015,86 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: ff26db721962cdf4a8edcdfa9a767d2a, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+--- !u!82 &1278158978
+AudioSource:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_GameObject: {fileID: 1278158971}
+  m_Enabled: 1
+  serializedVersion: 4
+  OutputAudioMixerGroup: {fileID: 0}
+  m_audioClip: {fileID: 8300000, guid: df573aab73a2e0c48a428d7dfce1315a, type: 3}
+  m_PlayOnAwake: 1
+  m_Volume: 0.1
+  m_Pitch: 1
+  Loop: 1
+  Mute: 0
+  Spatialize: 0
+  SpatializePostEffects: 0
+  Priority: 128
+  DopplerLevel: 1
+  MinDistance: 1
+  MaxDistance: 500
+  Pan2D: 0
+  rolloffMode: 0
+  BypassEffects: 0
+  BypassListenerEffects: 0
+  BypassReverbZones: 0
+  rolloffCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 1
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    - serializedVersion: 2
+      time: 1
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 4
+  panLevelCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 0
+  spreadCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 0
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 4
+  reverbZoneMixCustomCurve:
+    serializedVersion: 2
+    m_Curve:
+    - serializedVersion: 2
+      time: 0
+      value: 1
+      inSlope: 0
+      outSlope: 0
+      tangentMode: 0
+    m_PreInfinity: 2
+    m_PostInfinity: 2
+    m_RotationOrder: 0
 --- !u!1 &1285122466
 GameObject:
   m_ObjectHideFlags: 0
@@ -6151,7 +6232,7 @@ Transform:
   - {fileID: 1906683133}
   - {fileID: 1173554098}
   m_Father: {fileID: 0}
-  m_RootOrder: 5
+  m_RootOrder: 6
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!114 &1967258213
 MonoBehaviour:

+ 21 - 8
game/Assets/Scenes/PlayerMovement.unity

@@ -38,7 +38,7 @@ RenderSettings:
   m_ReflectionIntensity: 1
   m_CustomReflection: {fileID: 0}
   m_Sun: {fileID: 0}
-  m_IndirectSpecularColor: {r: 0.18993917, g: 0.20715788, b: 0.2955747, a: 1}
+  m_IndirectSpecularColor: {r: 0.18993923, g: 0.20715818, b: 0.29557535, a: 1}
 --- !u!157 &3
 LightmapSettings:
   m_ObjectHideFlags: 0
@@ -196,7 +196,7 @@ Transform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 0}
-  m_RootOrder: 3
+  m_RootOrder: 4
   m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
 --- !u!114 &246209685
 MonoBehaviour:
@@ -209,7 +209,6 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: ff26db721962cdf4a8edcdfa9a767d2a, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  profile: {fileID: 11400000, guid: 33391131f7192d242ab5e5f2b501c232, type: 2}
 --- !u!1 &453623580
 GameObject:
   m_ObjectHideFlags: 0
@@ -331,6 +330,10 @@ Prefab:
       propertyPath: m_RootOrder
       value: 8
       objectReference: {fileID: 0}
+    - target: {fileID: 4922802678927886, guid: c991ea08034a50545a37f2df5089cf02, type: 2}
+      propertyPath: m_RootOrder
+      value: 1
+      objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 100100000, guid: c991ea08034a50545a37f2df5089cf02, type: 2}
   m_IsPrefabParent: 0
@@ -526,7 +529,7 @@ Transform:
   - {fileID: 741358569}
   - {fileID: 1768628460}
   m_Father: {fileID: 0}
-  m_RootOrder: 7
+  m_RootOrder: 8
   m_LocalEulerAnglesHint: {x: 0, y: -89.996, z: 0}
 --- !u!1 &1050478843
 GameObject:
@@ -605,7 +608,7 @@ Transform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 0}
-  m_RootOrder: 0
+  m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
 --- !u!1001 &1170803053
 Prefab:
@@ -692,6 +695,16 @@ Prefab:
       propertyPath: m_RootOrder
       value: 2
       objectReference: {fileID: 0}
+    - target: {fileID: 82647207684349442, guid: e6383ffd9f8688f4a9ba9705843d54e2,
+        type: 2}
+      propertyPath: m_Pitch
+      value: 1.5
+      objectReference: {fileID: 0}
+    - target: {fileID: 82647207684349442, guid: e6383ffd9f8688f4a9ba9705843d54e2,
+        type: 2}
+      propertyPath: m_PlayOnAwake
+      value: 0
+      objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 100100000, guid: e6383ffd9f8688f4a9ba9705843d54e2, type: 2}
   m_IsPrefabParent: 0
@@ -969,7 +982,7 @@ Transform:
   - {fileID: 1474727394}
   - {fileID: 1731892630}
   m_Father: {fileID: 0}
-  m_RootOrder: 6
+  m_RootOrder: 7
   m_LocalEulerAnglesHint: {x: 0, y: 48.505, z: 0}
 --- !u!1 &2057569166
 GameObject:
@@ -999,7 +1012,7 @@ Transform:
   - {fileID: 453623581}
   - {fileID: 673976754}
   m_Father: {fileID: 0}
-  m_RootOrder: 5
+  m_RootOrder: 6
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &2144462217
 GameObject:
@@ -1094,5 +1107,5 @@ Transform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 0}
-  m_RootOrder: 4
+  m_RootOrder: 5
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

+ 8 - 0
game/Assets/Scripts/Enemy/Enemy.cs

@@ -29,6 +29,8 @@ public class Enemy : MonoBehaviour
     public float maxHealth = 2.5f;
     private bool dead;
 
+    public AudioClip explosion;
+    public AudioClip[] hitMe;
     public WeaponEnemy weapon;
 
 
@@ -38,6 +40,8 @@ public class Enemy : MonoBehaviour
         {
             if (collision.collider.tag == "Bullet")
             {
+                Player.AudioSource.clip = hitMe[Random.Range(0, 1) > 0.5 ? 0 : 1];
+                Player.AudioSource.Play();
                 health -= 1f;
             }
         }
@@ -128,6 +132,10 @@ public class Enemy : MonoBehaviour
 
     private void Death()
     {
+        Player.AudioSource.clip = explosion;
+        Player.AudioSource.pitch = 1.0f;
+        Player.AudioSource.Play();
+
         dead = true;
         GetComponentInChildren<WeaponEnemy>().enabled = false;
 

+ 9 - 0
game/Assets/Scripts/Player.cs

@@ -20,6 +20,9 @@ public class Player : MonoBehaviour
 
     private GameObject[] _powerUp = new GameObject[3];
     private GameObject[] _powerDown = new GameObject[3];
+    public static AudioSource AudioSource;
+
+    public AudioClip shootSound;
 
     public float PowerLevel
     {
@@ -211,6 +214,8 @@ public class Player : MonoBehaviour
             _powerUp[i].SetActive(false);
             _powerDown[i].SetActive(false);
         }
+
+        AudioSource = GetComponent<AudioSource>();
     }
 
 
@@ -273,6 +278,10 @@ public class Player : MonoBehaviour
         {
             bulletCounter = 5;
         }
+        AudioSource.pitch = 1.5f;
+        AudioSource.clip = shootSound;
+        AudioSource.Play();
+        AudioSource.pitch = 1.0f;
     }
 
     private Vector3 TargetCameraPosition()

+ 5 - 0
game/Assets/Scripts/Station.cs

@@ -17,6 +17,8 @@ public class Station : MonoBehaviour
     public float maxBeamWidth;
     public float beamWidthFadeSeconds;
 
+    private AudioSource _audioSource;
+
     // Use this for initialization
 	void Start ()
 	{
@@ -31,6 +33,7 @@ public class Station : MonoBehaviour
             lineTarget.position,
         });
 	    lineRenderer.endWidth = 0;
+        _audioSource = GetComponent<AudioSource>();
 	}
 	
 	// Update is called once per frame
@@ -83,6 +86,7 @@ public class Station : MonoBehaviour
         if (Mathf.Approximately(tarvetValue, 0))
         {
             lineRenderer.enabled = false;
+            _audioSource.Stop();
         }
     }
 
@@ -100,6 +104,7 @@ public class Station : MonoBehaviour
     private IEnumerator DrainPower(Player player)
     {
         
+        _audioSource.Play();
 
         while (true)
         {

BIN
game/Assets/Sounds/Ambient.mp3


+ 23 - 0
game/Assets/Sounds/Ambient.mp3.meta

@@ -0,0 +1,23 @@
+fileFormatVersion: 2
+guid: df573aab73a2e0c48a428d7dfce1315a
+timeCreated: 1501531434
+licenseType: Free
+AudioImporter:
+  serializedVersion: 6
+  defaultSettings:
+    loadType: 0
+    sampleRateSetting: 0
+    sampleRateOverride: 44100
+    compressionFormat: 1
+    quality: 1
+    conversionMode: 0
+  platformSettingOverrides: {}
+  forceToMono: 0
+  normalize: 1
+  preloadAudioData: 1
+  loadInBackground: 0
+  ambisonic: 0
+  3D: 1
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
game/Assets/Sounds/station.mp3


+ 23 - 0
game/Assets/Sounds/station.mp3.meta

@@ -0,0 +1,23 @@
+fileFormatVersion: 2
+guid: 7bee4ddc4b0114d48bbf311e94b5a9b5
+timeCreated: 1501532923
+licenseType: Free
+AudioImporter:
+  serializedVersion: 6
+  defaultSettings:
+    loadType: 0
+    sampleRateSetting: 0
+    sampleRateOverride: 44100
+    compressionFormat: 1
+    quality: 1
+    conversionMode: 0
+  platformSettingOverrides: {}
+  forceToMono: 0
+  normalize: 1
+  preloadAudioData: 1
+  loadInBackground: 0
+  ambisonic: 0
+  3D: 1
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: