소스 검색

怪物死亡掉落金币新增字体

WGL 1 개월 전
부모
커밋
2134f00a7b

+ 168 - 20
ActionTowerDefense/Assets/Animations/ui/show.anim

@@ -60,8 +60,7 @@ AnimationClip:
       m_RotationOrder: 4
     path: 
   m_FloatCurves:
-  - serializedVersion: 2
-    curve:
+  - curve:
       serializedVersion: 2
       m_Curve:
       - serializedVersion: 3
@@ -98,7 +97,80 @@ AnimationClip:
     path: 
     classID: 224
     script: {fileID: 0}
-    flags: 0
+  - curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 1
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 2
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: m_fontColor.a
+    path: Text (TMP)
+    classID: 114
+    script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
+  - curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 1
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 2
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: m_Color.a
+    path: Text (TMP)/Image
+    classID: 114
+    script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
   m_PPtrCurves: []
   m_SampleRate: 60
   m_WrapMode: 0
@@ -114,8 +186,6 @@ AnimationClip:
       typeID: 4
       customType: 0
       isPPtrCurve: 0
-      isIntCurve: 0
-      isSerializeReferenceCurve: 0
     - serializedVersion: 2
       path: 0
       attribute: 538195251
@@ -123,15 +193,27 @@ AnimationClip:
       typeID: 224
       customType: 28
       isPPtrCurve: 0
-      isIntCurve: 0
-      isSerializeReferenceCurve: 0
+    - serializedVersion: 2
+      path: 271242783
+      attribute: 4185109675
+      script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
+      typeID: 114
+      customType: 0
+      isPPtrCurve: 0
+    - serializedVersion: 2
+      path: 2725911707
+      attribute: 304273561
+      script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
+      typeID: 114
+      customType: 0
+      isPPtrCurve: 0
     pptrCurveMapping: []
   m_AnimationClipSettings:
     serializedVersion: 2
     m_AdditiveReferencePoseClip: {fileID: 0}
     m_AdditiveReferencePoseTime: 0
     m_StartTime: 0
-    m_StopTime: 0.5833333
+    m_StopTime: 2
     m_OrientationOffsetY: 0
     m_Level: 0
     m_CycleOffset: 0
@@ -147,8 +229,7 @@ AnimationClip:
     m_HeightFromFeet: 0
     m_Mirror: 0
   m_EditorCurves:
-  - serializedVersion: 2
-    curve:
+  - curve:
       serializedVersion: 2
       m_Curve:
       - serializedVersion: 3
@@ -194,9 +275,7 @@ AnimationClip:
     path: 
     classID: 224
     script: {fileID: 0}
-    flags: 0
-  - serializedVersion: 2
-    curve:
+  - curve:
       serializedVersion: 2
       m_Curve:
       - serializedVersion: 3
@@ -242,9 +321,7 @@ AnimationClip:
     path: 
     classID: 224
     script: {fileID: 0}
-    flags: 0
-  - serializedVersion: 2
-    curve:
+  - curve:
       serializedVersion: 2
       m_Curve:
       - serializedVersion: 3
@@ -290,9 +367,7 @@ AnimationClip:
     path: 
     classID: 224
     script: {fileID: 0}
-    flags: 0
-  - serializedVersion: 2
-    curve:
+  - curve:
       serializedVersion: 2
       m_Curve:
       - serializedVersion: 3
@@ -329,7 +404,80 @@ AnimationClip:
     path: 
     classID: 224
     script: {fileID: 0}
-    flags: 0
+  - curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 1
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 2
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: m_fontColor.a
+    path: Text (TMP)
+    classID: 114
+    script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
+  - curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 1
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 2
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: m_Color.a
+    path: Text (TMP)/Image
+    classID: 114
+    script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
   m_EulerEditorCurves: []
   m_HasGenericRootTransform: 0
   m_HasMotionFloatCurves: 0

+ 4 - 151
ActionTowerDefense/Assets/Resources/Prefab/effc_coins.prefab

@@ -9791,10 +9791,7 @@ GameObject:
   serializedVersion: 6
   m_Component:
   - component: {fileID: 1723151111827507803}
-  - component: {fileID: 1723151111827507800}
-  - component: {fileID: 1723151111827507801}
-  - component: {fileID: 1723151111827507806}
-  - component: {fileID: -7697323034879839750}
+  - component: {fileID: 4842451472803732590}
   m_Layer: 11
   m_Name: effc_coins
   m_TagString: Soul
@@ -9815,11 +9812,10 @@ Transform:
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 1723151111081767147}
-  - {fileID: 7526387050721720706}
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!114 &1723151111827507800
+--- !u!114 &4842451472803732590
 MonoBehaviour:
   m_ObjectHideFlags: 0
   m_CorrespondingSourceObject: {fileID: 0}
@@ -9828,109 +9824,11 @@ MonoBehaviour:
   m_GameObject: {fileID: 1723151111827507807}
   m_Enabled: 1
   m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: b4267bb60177cb747bac5537781a9c54, type: 3}
+  m_Script: {fileID: 11500000, guid: 63e2d62f3b573954e827beb994374f15, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  rb: {fileID: 1723151111827507801}
-  collected: 0
-  lerpValue: 0.2
-  addMp: 20
-  tweenPos: {fileID: -7697323034879839750}
-  flySpeed: 20
-  upSpeed: 1
-  shootSpeed: 2
-  altitude: 25
-  isShoot: 0
-  from: {x: 0, y: 0, z: 0}
-  to: {x: 0, y: 0, z: 0}
   time: 0
-  Spirits_Invisible_NotFind: 0
-  getSoulEffect: {fileID: 417478504669294145, guid: 040c2fee7f3561d409cbadff09028f6d, type: 3}
-  isSourPurple: 0
-  type: 0
-  spiritSystem: {fileID: 0}
---- !u!54 &1723151111827507801
-Rigidbody:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1723151111827507807}
-  serializedVersion: 2
-  m_Mass: 1
-  m_Drag: 0
-  m_AngularDrag: 0.05
-  m_UseGravity: 0
-  m_IsKinematic: 0
-  m_Interpolate: 0
-  m_Constraints: 120
-  m_CollisionDetection: 0
---- !u!65 &1723151111827507806
-BoxCollider:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1723151111827507807}
-  m_Material: {fileID: 13400000, guid: 4c155add39c5f9e4e87a906b605d36f3, type: 2}
-  m_IsTrigger: 1
-  m_Enabled: 1
-  serializedVersion: 2
-  m_Size: {x: 1.36, y: 1.44, z: 20}
-  m_Center: {x: 0, y: 0.74, z: 0}
---- !u!114 &-7697323034879839750
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1723151111827507807}
-  m_Enabled: 0
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 347d7720ca2646343801fd02910b81d9, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  updateStyle: 0
-  method: 22
-  style: 0
-  animationCurve:
-    serializedVersion: 2
-    m_Curve:
-    - serializedVersion: 3
-      time: 0
-      value: 0
-      inSlope: 0
-      outSlope: 1
-      tangentMode: 0
-      weightedMode: 0
-      inWeight: 0
-      outWeight: 0
-    - serializedVersion: 3
-      time: 1
-      value: 1
-      inSlope: 1
-      outSlope: 0
-      tangentMode: 0
-      weightedMode: 0
-      inWeight: 0
-      outWeight: 0
-    m_PreInfinity: 2
-    m_PostInfinity: 2
-    m_RotationOrder: 4
-  ignoreTimeScale: 0
-  delay: 0
-  duration: 1
-  steeperCurves: 0
-  tag: 
-  tweenGroup: 0
-  onFinished:
-    m_PersistentCalls:
-      m_Calls: []
-  eventReceiver: {fileID: 0}
-  callWhenFinished: 
-  startFactor: 0
-  from: {fileID: 0}
-  to: {fileID: 0}
+  disappearTime: 1
 --- !u!1 &3466083475271790066
 GameObject:
   m_ObjectHideFlags: 0
@@ -29494,48 +29392,3 @@ ParticleSystemRenderer:
   m_MeshWeighting2: 1
   m_MeshWeighting3: 1
   m_MaskInteraction: 0
---- !u!1 &7293676873242750977
-GameObject:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 7526387050721720706}
-  - component: {fileID: 5919614424193721880}
-  m_Layer: 0
-  m_Name: Trigger
-  m_TagString: Soul
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &7526387050721720706
-Transform:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 7293676873242750977}
-  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_ConstrainProportionsScale: 0
-  m_Children: []
-  m_Father: {fileID: 1723151111827507803}
-  m_RootOrder: 1
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!65 &5919614424193721880
-BoxCollider:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 7293676873242750977}
-  m_Material: {fileID: 13400000, guid: 4c155add39c5f9e4e87a906b605d36f3, type: 2}
-  m_IsTrigger: 1
-  m_Enabled: 1
-  serializedVersion: 2
-  m_Size: {x: 1.36, y: 1.44, z: 20}
-  m_Center: {x: 0, y: 0.74, z: 0}

+ 4 - 4
ActionTowerDefense/Assets/Scenes/Game.unity

@@ -22448,8 +22448,9 @@ MonoBehaviour:
   extraMoney: 100
   deductMoneyTime: 2
   deductMoney: 1
-  enemyGoldDrop: 1
-  dropGoldFX: {fileID: 7473170563405908938, guid: 8ad3c225050205945b10657aa300afd6, type: 3}
+  enemyGoldDrop: 5
+  dropGoldFX: {fileID: 1723151111827507807, guid: 8ac2bd44510cc7840adf9877a9ecad46, type: 3}
+  dropGoldText: {fileID: 6467251191553420251, guid: 7df1aa66331659042a29ed5c238dce79, type: 3}
   damage: 0
   criticalChance: 0
   regeneration: 0
@@ -24713,8 +24714,7 @@ PrefabInstance:
       propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
       value: ShowShop
       objectReference: {fileID: 0}
-    m_RemovedComponents:
-    - {fileID: 6899736118153807368, guid: 8f38420ea6472ad41b71c9ea20aa1683, type: 3}
+    m_RemovedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: 8f38420ea6472ad41b71c9ea20aa1683, type: 3}
 --- !u!114 &6486017610891705020 stripped
 MonoBehaviour:

+ 16 - 1
ActionTowerDefense/Assets/Scripts/Characters/Enemy.cs

@@ -4,6 +4,7 @@ using Spine;
 using Spine.Unity;
 using System.Collections;
 using System.Collections.Generic;
+using TMPro;
 using Unity.VisualScripting;
 using UnityEngine;
 
@@ -231,7 +232,7 @@ public class Enemy : MoveCharacter
             return;
         }
         //hurtKeepTime -= Time.deltaTime;
-        dieKeepTime -= Time.deltaTime;
+        
         invincibleTime -= Time.deltaTime;
         pastAttackTime += Time.deltaTime;
         Vector3 leftDir = GetMoveDir();
@@ -505,6 +506,7 @@ public class Enemy : MoveCharacter
                 }
                 break;
             case CharacterState.Die:
+                dieKeepTime -= Time.deltaTime;
                 if (dieKeepTime <= 0)
                 {
                     if (killer!=null && killer.GetComponent<Demonic>())
@@ -516,6 +518,19 @@ public class Enemy : MoveCharacter
                     {
                         PoolManager.Instantiate(dieEffect, transform.position);
                     }
+                    GameManager gameManager = GameManager.instance;
+                    if (gameManager.gameType == GameType.GameEnd)
+                    {
+                        GameObject fx = PoolManager.Instantiate(gameManager.dropGoldFX);
+                        fx.transform.position = transform.position;
+                        GameObject injuryNum =  PoolManager.Instantiate(gameManager.dropGoldText);
+                        injuryNum.transform.position = new Vector3(
+                            transform.position.x + injuryNumPos_march.x + Random.Range(-injuryNumRandom_march.x / 2f, injuryNumRandom_march.x / 2f),
+                            transform.position.y + injuryNumPos_march.y + Random.Range(-injuryNumRandom_march.y / 2f, injuryNumRandom_march.y / 2f),
+                            transform.position.z);
+                        TextMeshProUGUI text = injuryNum.GetComponentInChildren<TextMeshProUGUI>();
+                        text.text = $"+{gameManager.enemyGoldDrop}";
+                    }
                     gameObject.SetActive(false);
                     break;
                 }

+ 1 - 1
ActionTowerDefense/Assets/Scripts/Characters/MoveCharacter.cs

@@ -345,7 +345,7 @@ public class MoveCharacter : Character
             else
             {
                 injuryNum = PoolManager.Instantiate(injuryNumText);
-                injuryNum.transform.position = injuryNum.transform.position = new Vector3(
+                injuryNum.transform.position = new Vector3(
                     transform.position.x + injuryNumPos_march.x + Random.Range(-injuryNumRandom_march.x / 2f, injuryNumRandom_march.x / 2f),
                     transform.position.y + injuryNumPos_march.y + Random.Range(-injuryNumRandom_march.y / 2f, injuryNumRandom_march.y / 2f),
                     transform.position.z);

+ 2 - 2
ActionTowerDefense/Assets/Scripts/GameManager.cs

@@ -40,8 +40,10 @@ public class GameManager : MonoBehaviour
     [FoldoutGroup("金币结算")][LabelText("额外金币奖励")] public int extraMoney;
     [FoldoutGroup("金币结算")][LabelText("惩罚时间间隔")] public int deductMoneyTime;
     [FoldoutGroup("金币结算")][LabelText("每次惩罚扣除金币数量")] public int deductMoney;
+    [Header("金币掉落")]
     [FoldoutGroup("金币结算")][LabelText("怪物掉落金币数量")] public int enemyGoldDrop;
     [FoldoutGroup("金币结算")][LabelText("金币掉落特效")] public GameObject dropGoldFX;
+    [FoldoutGroup("金币结算")][LabelText("金币掉落字体")] public GameObject dropGoldText;
 
     [FoldoutGroup("Rogue数值")] [LabelText("伤害")] public int damage;
     [FoldoutGroup("Rogue数值")] [LabelText("暴击率")] public int criticalChance;
@@ -146,8 +148,6 @@ public class GameManager : MonoBehaviour
                     objs[i].killer = null;
                     objs[i].ChangeState(CharacterState.Die);
                     dropGold += enemyGoldDrop;
-                    GameObject fx = PoolManager.Instantiate(dropGoldFX);
-                    fx.transform.position = objs[i].transform.position;
                 }
             }
         }