Преглед изворни кода

Merge branch 'master' of http://git.thirdlevel.gmbh:80/GameDevOS/LD39

Sergey Krutikov пре 9 година
родитељ
комит
b8f7416e20

+ 78 - 0
game/Assets/3DArt/Materials/ParticlesEnemyWeapon.mat

@@ -0,0 +1,78 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 6
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 0}
+  m_Name: ParticlesEnemyWeapon
+  m_Shader: {fileID: 203, guid: 0000000000000000f000000000000000, type: 0}
+  m_ShaderKeywords: 
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Floats:
+    - _BumpScale: 1
+    - _Cutoff: 0.5
+    - _DetailNormalMapScale: 1
+    - _DstBlend: 0
+    - _GlossMapScale: 1
+    - _Glossiness: 0.5
+    - _GlossyReflections: 1
+    - _InvFade: 1
+    - _Metallic: 0
+    - _Mode: 0
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _UVSec: 0
+    - _ZWrite: 1
+    m_Colors:
+    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+    - _TintColor: {r: 1, g: 0.93103445, b: 0, a: 0.162}

+ 9 - 0
game/Assets/3DArt/Materials/ParticlesEnemyWeapon.mat.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 06c41fb062e1f2e4a9927369b3c2bd92
+timeCreated: 1501440574
+licenseType: Free
+NativeFormatImporter:
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

Разлика између датотеке није приказан због своје велике величине
+ 3872 - 346
game/Assets/Prefabs/Enemy.prefab


+ 21 - 21
game/Assets/Scenes/Main.unity

@@ -172,7 +172,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -419,7 +419,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -470,7 +470,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -521,7 +521,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -683,7 +683,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -734,7 +734,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -864,7 +864,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -911,7 +911,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -962,7 +962,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -1134,7 +1134,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -1269,7 +1269,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -1320,7 +1320,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -1413,7 +1413,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -1607,7 +1607,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -1658,7 +1658,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -1771,7 +1771,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -1828,7 +1828,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -1879,7 +1879,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -1993,7 +1993,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z
@@ -2054,7 +2054,7 @@ Transform:
   m_PrefabInternal: {fileID: 0}
   m_GameObject: {fileID: 1967258211}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 1.5, y: 4.386077, z: -2}
+  m_LocalPosition: {x: 1.5, y: 0, z: -2}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children:
   - {fileID: 580045342}
@@ -2104,7 +2104,7 @@ Prefab:
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.y
-      value: -4.386077
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 4394077682102786, guid: 6a04fac6f7a8dea419c1a2e19e3bb8c8, type: 2}
       propertyPath: m_LocalPosition.z

+ 11 - 0
game/Assets/Scripts/Enemy/WeaponEnemy.cs

@@ -7,12 +7,21 @@ public class WeaponEnemy : MonoBehaviour
     public float powerSuckDelay = 0.3f;
     private IEnumerator drainCoroutine;
 
+    ParticleSystem particles;
+
+    void Awake()
+    {
+        particles = GetComponent<ParticleSystem>();
+    }
+
     void OnTriggerEnter(Collider other)
     {
         if (other.tag == "Player")
         {
             drainCoroutine = DrainPower(other.GetComponent<Player>());
             StartCoroutine(drainCoroutine);
+            particles.Play();
+            particles.Emit(15);
         }
     }
 
@@ -22,6 +31,8 @@ public class WeaponEnemy : MonoBehaviour
         {
             if (drainCoroutine != null)
                 StopCoroutine(drainCoroutine);
+
+            particles.Stop();
         }
     }