SZAND\msx_2 1 éve
szülő
commit
699a3e9e50

+ 140 - 1
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -216,6 +216,7 @@ RectTransform:
   m_Children:
   - {fileID: 205997963}
   - {fileID: 5024842401036440121}
+  - {fileID: 5910399377071651245}
   m_Father: {fileID: 3571941038519084349}
   m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -241,7 +242,7 @@ Canvas:
   m_OverrideSorting: 0
   m_OverridePixelPerfect: 0
   m_SortingBucketNormalizedSize: 0
-  m_AdditionalShaderChannelsFlag: 0
+  m_AdditionalShaderChannelsFlag: 25
   m_SortingLayerID: 1516060329
   m_SortingOrder: 0
   m_TargetDisplay: 0
@@ -893,6 +894,7 @@ MonoBehaviour:
   canNotChangeHurt: 0
   soulPrefab: {fileID: 0}
   soulStartSpeed: 1
+  easyToGetHit: 0.2
   changePrefabs:
   - {fileID: 8639832132491289359, guid: b924426f768fd34418c3332de33d391a, type: 3}
   - {fileID: 2437299196472462361, guid: 00861cbb6651ced4a85013d35a07b3e6, type: 3}
@@ -979,6 +981,8 @@ MonoBehaviour:
   canJump: 1
   canfly: 0
   LBisHold: 0
+  corpse: {fileID: 2968886010519197762}
+  needCorpses: 14000000140000001400000014000000
   isUltimate: 0
   isMpRepel: 1
   maxFlyHeight: 0
@@ -1106,6 +1110,141 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   trigGroundList: []
+--- !u!1 &4023365682108446142
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 5910399377071651245}
+  - component: {fileID: 3362343375615074002}
+  - component: {fileID: 2968886010519197762}
+  m_Layer: 6
+  m_Name: corpse
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &5910399377071651245
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4023365682108446142}
+  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: 1969773273}
+  m_RootOrder: 2
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 0.6, y: 250}
+  m_SizeDelta: {x: 229.2, y: 50}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &3362343375615074002
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4023365682108446142}
+  m_CullTransparentMesh: 1
+--- !u!114 &2968886010519197762
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4023365682108446142}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_text: "\u5C38\u4F53\uFF1A0"
+  m_isRightToLeft: 0
+  m_fontAsset: {fileID: 11400000, guid: 39a7404a24ab897418249c0d649949a8, type: 2}
+  m_sharedMaterial: {fileID: -1504297583073342176, guid: 39a7404a24ab897418249c0d649949a8, type: 2}
+  m_fontSharedMaterials: []
+  m_fontMaterial: {fileID: 0}
+  m_fontMaterials: []
+  m_fontColor32:
+    serializedVersion: 2
+    rgba: 4294967295
+  m_fontColor: {r: 1, g: 1, b: 1, a: 1}
+  m_enableVertexGradient: 0
+  m_colorMode: 3
+  m_fontColorGradient:
+    topLeft: {r: 1, g: 1, b: 1, a: 1}
+    topRight: {r: 1, g: 1, b: 1, a: 1}
+    bottomLeft: {r: 1, g: 1, b: 1, a: 1}
+    bottomRight: {r: 1, g: 1, b: 1, a: 1}
+  m_fontColorGradientPreset: {fileID: 0}
+  m_spriteAsset: {fileID: 0}
+  m_tintAllSprites: 0
+  m_StyleSheet: {fileID: 0}
+  m_TextStyleHashCode: -1183493901
+  m_overrideHtmlColors: 0
+  m_faceColor:
+    serializedVersion: 2
+    rgba: 4294967295
+  m_fontSize: 40
+  m_fontSizeBase: 40
+  m_fontWeight: 400
+  m_enableAutoSizing: 0
+  m_fontSizeMin: 18
+  m_fontSizeMax: 72
+  m_fontStyle: 0
+  m_HorizontalAlignment: 2
+  m_VerticalAlignment: 512
+  m_textAlignment: 65535
+  m_characterSpacing: 0
+  m_wordSpacing: 0
+  m_lineSpacing: 0
+  m_lineSpacingMax: 0
+  m_paragraphSpacing: 0
+  m_charWidthMaxAdj: 0
+  m_enableWordWrapping: 1
+  m_wordWrappingRatios: 0.4
+  m_overflowMode: 0
+  m_linkedTextComponent: {fileID: 0}
+  parentLinkedComponent: {fileID: 0}
+  m_enableKerning: 1
+  m_enableExtraPadding: 0
+  checkPaddingRequired: 0
+  m_isRichText: 1
+  m_parseCtrlCharacters: 1
+  m_isOrthographic: 1
+  m_isCullingEnabled: 0
+  m_horizontalMapping: 0
+  m_verticalMapping: 0
+  m_uvLineOffset: 0
+  m_geometrySortingOrder: 0
+  m_IsTextObjectScaleStatic: 0
+  m_VertexBufferAutoSizeReduction: 0
+  m_useMaxVisibleDescender: 1
+  m_pageToDisplay: 1
+  m_margin: {x: 0, y: 0, z: 0, w: 0}
+  m_isUsingLegacyAnimationComponent: 0
+  m_isVolumetricText: 0
+  m_hasFontAssetChanged: 0
+  m_baseMaterial: {fileID: 0}
+  m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
 --- !u!1 &4574901846507359337
 GameObject:
   m_ObjectHideFlags: 0

+ 3 - 0
ActionTowerDefense/Assets/Scripts/Demonic.cs

@@ -6,6 +6,7 @@ using UnityEngine;
 
 public class Demonic : MoveCharacter
 {
+    public PlayerController player;      //ÕÙ»½Ê¦
     public int id;
     public float costMp = 10;
     public float totalSummonTime = 0.5f;
@@ -419,6 +420,8 @@ public class Demonic : MoveCharacter
                 if (dieKeepTime <= 0)
                 {
                     print("Die:" + gameObject.name);
+                    player.corpses += 1;
+                    player.ShowCorpse();
                     gameObject.SetActive(false);
                     break;
                 }

+ 26 - 8
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -12,6 +12,7 @@ using Base.Common;
 using cfg;
 using static UnityEngine.EventSystems.EventTrigger;
 using UnityEngine.InputSystem;
+using TMPro;
 
 [Serializable]
 public struct AttackInfo
@@ -415,16 +416,26 @@ public class PlayerController : MoveCharacter
         }
     }
 
+    public TextMeshProUGUI corpse;
+    public int[] needCorpses;
+
+    public void ShowCorpse()
+    {
+        corpse.text = "尸体:" + corpses.ToString();
+    }
+
     public bool isUltimate;     //英灵释放大招
     void OnSummonSpirit()
     {
         if (!isFloat && canMove)
         {
-            if (!isTransfiguration)
+            if (!isTransfiguration && corpses >= needCorpses[0])
             {
                 isSpiritSummon = true;
+                corpses -= needCorpses[0];
+                ShowCorpse();
             }
-            else if(currentSpirit == 0)
+            if(isTransfiguration && currentSpirit == 0)
             {
                 //释放技能,此处暂时先写解除变身
                 isUltimate = true;
@@ -436,11 +447,13 @@ public class PlayerController : MoveCharacter
     {
         if (!isFloat && canMove)
         {
-            if (!isTransfiguration)
+            if (!isTransfiguration && corpses >= needCorpses[1])
             {
                 isSpiritSummon1 = true;
+                corpses -= needCorpses[1];
+                ShowCorpse();
             }
-            else if(currentSpirit == 1)
+            if(isTransfiguration && currentSpirit == 1)
             {
                 //释放技能,此处暂时先写解除变身
                 isUltimate = true;
@@ -459,11 +472,13 @@ public class PlayerController : MoveCharacter
     {
         if (!isFloat && canMove)
         {
-            if (!isTransfiguration)
+            if (!isTransfiguration && corpses >= needCorpses[2])
             {
                 isSpiritSummon2 = true;
+                corpses -= needCorpses[2];
+                ShowCorpse();
             }
-            else if(currentSpirit == 2)
+            if(isTransfiguration && currentSpirit == 2)
             {
                 //释放技能,此处暂时先写解除变身
                 isUltimate = true;
@@ -475,11 +490,13 @@ public class PlayerController : MoveCharacter
     {
         if (!isFloat && canMove)
         {
-            if (!isTransfiguration)
+            if (!isTransfiguration && corpses >= needCorpses[3])
             {
                 isSpiritSummon3 = true;
+                corpses -= needCorpses[3];
+                ShowCorpse();
             }
-            else if(currentSpirit == 3)
+            if(isTransfiguration && currentSpirit == 3)
             {
                 //释放技能,此处暂时先写解除变身
                 isUltimate = true;
@@ -1673,6 +1690,7 @@ public class PlayerController : MoveCharacter
                 }
             }
         }
+        demonic.player = this;
         demonic.Init();
         demonic.SetSortingOrder(demonic.sortingOrder + demonicId[id]);
         demonicId[id]++;