Forráskód Böngészése

enemy weapon improvement

DasGewehr 9 éve
szülő
commit
0040b10272

+ 2 - 2
game/Assets/Prefabs/Enemy.prefab

@@ -487,7 +487,7 @@ Transform:
   m_PrefabInternal: {fileID: 100100000}
   m_GameObject: {fileID: 1196849215294664}
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 1, z: 0}
+  m_LocalPosition: {x: 18.913963, y: -4.386077, z: -9.469598}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children:
   - {fileID: 4517153640541662}
@@ -1337,7 +1337,7 @@ CapsuleCollider:
   m_PrefabInternal: {fileID: 100100000}
   m_GameObject: {fileID: 1317559223304850}
   m_Material: {fileID: 0}
-  m_IsTrigger: 0
+  m_IsTrigger: 1
   m_Enabled: 1
   m_Radius: 0.3
   m_Height: 3

+ 16 - 2
game/Assets/Scenes/Main.unity

@@ -1367,7 +1367,7 @@ Prefab:
     m_Modifications:
     - target: {fileID: 4531056758406446, guid: 577edfe1bc6758a4d9b91d58d990d07e, type: 2}
       propertyPath: m_LocalPosition.x
-      value: -4.65
+      value: -15.1
       objectReference: {fileID: 0}
     - target: {fileID: 4531056758406446, guid: 577edfe1bc6758a4d9b91d58d990d07e, type: 2}
       propertyPath: m_LocalPosition.y
@@ -1594,7 +1594,6 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: ff26db721962cdf4a8edcdfa9a767d2a, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  profile: {fileID: 0}
 --- !u!1001 &1387540009
 Prefab:
   m_ObjectHideFlags: 0
@@ -1957,6 +1956,21 @@ Prefab:
       propertyPath: m_RootOrder
       value: 0
       objectReference: {fileID: 0}
+    - target: {fileID: 114806071709842584, guid: 673629bba9f02458cacf9d13115e1078,
+        type: 2}
+      propertyPath: NightColor.r
+      value: 0.3602941
+      objectReference: {fileID: 0}
+    - target: {fileID: 114806071709842584, guid: 673629bba9f02458cacf9d13115e1078,
+        type: 2}
+      propertyPath: NightColor.g
+      value: 0.3602941
+      objectReference: {fileID: 0}
+    - target: {fileID: 114806071709842584, guid: 673629bba9f02458cacf9d13115e1078,
+        type: 2}
+      propertyPath: NightColor.b
+      value: 1
+      objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 100100000, guid: 673629bba9f02458cacf9d13115e1078, type: 2}
   m_IsPrefabParent: 0

+ 7 - 7
game/Assets/Scripts/Enemy/WeaponEnemy.cs

@@ -4,21 +4,21 @@ using UnityEngine;
 
 public class WeaponEnemy : MonoBehaviour
 {
-    public float powerSuckDelay = 1;
+    public float powerSuckDelay = 0.3f;
     private IEnumerator drainCoroutine;
 
-    void OnCollisionEnter(Collision collision)
+    void OnTriggerEnter(Collider other)
     {
-        if (collision.collider.tag == "Player")
+        if (other.tag == "Player")
         {
-            drainCoroutine = DrainPower(collision.collider.GetComponent<Player>());
+            drainCoroutine = DrainPower(other.GetComponent<Player>());
             StartCoroutine(drainCoroutine);
         }
     }
 
-    void OnCollisionExit(Collision collision)
+    void OnTriggerExit(Collider other)
     {
-        if (collision.collider.tag == "Player")
+        if (other.tag == "Player")
         {
             if (drainCoroutine != null)
                 StopCoroutine(drainCoroutine);
@@ -31,7 +31,7 @@ public class WeaponEnemy : MonoBehaviour
         {
             yield return new WaitForSeconds(powerSuckDelay);
 
-            player.PowerLevel -= 2.5f;
+            player.PowerLevel -= 1.0f;
         }
     }