Kaynağa Gözat

Adjusted particle effect for power drop, limited life time

DasGewehr 9 yıl önce
ebeveyn
işleme
1ba52683e4

+ 41 - 11
game/Assets/Prefabs/PowerDrop.prefab

@@ -74,7 +74,7 @@ Transform:
   m_PrefabInternal: {fileID: 100100000}
   m_GameObject: {fileID: 1236734196835136}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 1.84, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children:
   - {fileID: 224453531387503256}
@@ -222,9 +222,9 @@ ParticleSystem:
   m_PrefabInternal: {fileID: 100100000}
   m_GameObject: {fileID: 1236734196835136}
   serializedVersion: 5
-  lengthInSec: 2
+  lengthInSec: 5
   simulationSpeed: 1
-  looping: 1
+  looping: 0
   prewarm: 0
   playOnAwake: 1
   useUnscaledTime: 0
@@ -274,15 +274,15 @@ ParticleSystem:
   moveWithTransform: 0
   moveWithCustomTransform: {fileID: 0}
   scalingMode: 1
-  randomSeed: 577359792
+  randomSeed: -382146708
   InitialModule:
     serializedVersion: 3
     enabled: 1
     startLifetime:
       serializedVersion: 2
-      minMaxState: 0
-      scalar: 5
-      minScalar: 5
+      minMaxState: 3
+      scalar: 2.7
+      minScalar: 2
       maxCurve:
         serializedVersion: 2
         m_Curve:
@@ -670,7 +670,7 @@ ParticleSystem:
         m_PostInfinity: 2
         m_RotationOrder: 4
     randomizeRotationDirection: 0
-    maxNumParticles: 8
+    maxNumParticles: 12
     size3D: 1
     rotation3D: 0
     gravityModifier:
@@ -834,7 +834,7 @@ ParticleSystem:
     rateOverTime:
       serializedVersion: 2
       minMaxState: 0
-      scalar: 10
+      scalar: 2
       minScalar: 10
       maxCurve:
         serializedVersion: 2
@@ -913,8 +913,38 @@ ParticleSystem:
         m_PreInfinity: 2
         m_PostInfinity: 2
         m_RotationOrder: 4
-    m_BurstCount: 0
-    m_Bursts: []
+    m_BurstCount: 6
+    m_Bursts:
+    - time: 0
+      minCount: 8
+      maxCount: 12
+      cycleCount: 1
+      repeatInterval: 0.01
+    - time: 0.5
+      minCount: 6
+      maxCount: 8
+      cycleCount: 1
+      repeatInterval: 0.01
+    - time: 1.1
+      minCount: 4
+      maxCount: 6
+      cycleCount: 1
+      repeatInterval: 0.01
+    - time: 1.8
+      minCount: 3
+      maxCount: 4
+      cycleCount: 1
+      repeatInterval: 0.01
+    - time: 2.7
+      minCount: 2
+      maxCount: 3
+      cycleCount: 1
+      repeatInterval: 0.01
+    - time: 3
+      minCount: 2
+      maxCount: 2
+      cycleCount: 1
+      repeatInterval: 0.01
   SizeModule:
     enabled: 0
     curve:

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

@@ -56,7 +56,6 @@ public class Enemy : MonoBehaviour
 
             behaviorController.Update();
 
-
             // Energy collection
             if (dayTimeManager.dayTimeLabel != lastCharging)
             {
@@ -84,7 +83,6 @@ public class Enemy : MonoBehaviour
                         break;
                 }
             }
-
         }
 	}
 

+ 13 - 4
game/Assets/Scripts/PowerDrop.cs

@@ -6,6 +6,8 @@ public class PowerDrop : MonoBehaviour
 {
     public float powerAmount = -100.0f;
 
+    private float timeTillSelfPop;
+
     [SerializeField]
     private UnityEngine.UI.Text textField;
     private bool popped = false;
@@ -24,13 +26,20 @@ public class PowerDrop : MonoBehaviour
     }
 
 	// Use this for initialization
-	void Start () {
-        textField.text = powerAmount.ToString();
+	void Start () 
+    {
+        textField.text = "+" +powerAmount.ToString();
+        timeTillSelfPop = 5.2f;
 	}
 	
 	// Update is called once per frame
-	void Update () {
-		
+	void Update () 
+    {
+        timeTillSelfPop -= Time.deltaTime;
+        if (timeTillSelfPop < 0)
+        {
+            Pop();
+        }
 	}
 
     private void Pop()