소스 검색

实装升星

lcn 3 달 전
부모
커밋
33b8845aee
3개의 변경된 파일146개의 추가작업 그리고 73개의 파일을 삭제
  1. 116 65
      Assets/Res/UI/HeroDetailPanel.prefab
  2. 14 0
      Assets/Scripts/GameLogic/Hero/HeroController.cs
  3. 16 8
      Assets/Scripts/GameUI/UI/Hero/HeroDetailPanel.cs

+ 116 - 65
Assets/Res/UI/HeroDetailPanel.prefab

@@ -1452,7 +1452,6 @@ GameObject:
   m_Component:
   - component: {fileID: 412427599050978791}
   - component: {fileID: 1307097461962102202}
-  - component: {fileID: 8658869773225085844}
   - component: {fileID: 5495134090315458649}
   m_Layer: 0
   m_HasEditorInfo: 1
@@ -1474,12 +1473,12 @@ RectTransform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
-  m_Father: {fileID: 7590355994602595722}
+  m_Father: {fileID: 7679571116687404075}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 1}
-  m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 141, y: -12}
-  m_SizeDelta: {x: 40, y: 40}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: 2.1, y: 1.9}
+  m_SizeDelta: {x: 41.9324, y: 55.9098}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &1307097461962102202
 CanvasRenderer:
@@ -1489,26 +1488,6 @@ CanvasRenderer:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 731879025552473058}
   m_CullTransparentMesh: 1
---- !u!114 &8658869773225085844
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 731879025552473058}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  m_IgnoreLayout: 0
-  m_MinWidth: 59
-  m_MinHeight: 54
-  m_PreferredWidth: -1
-  m_PreferredHeight: -1
-  m_FlexibleWidth: -1
-  m_FlexibleHeight: -1
-  m_LayoutPriority: 1
 --- !u!114 &5495134090315458649
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -1539,14 +1518,14 @@ MonoBehaviour:
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
   m_PixelsPerUnitMultiplier: 1
-  _icon_name: icon_Friends_Invie
+  _icon_name: icon_tx116
   isNotLoadDeftIcon: 0
-  CurrSpriteAtlas: {fileID: 100100200, guid: 7b02f32fa59cd4e3085208946b112537, type: 3}
+  CurrSpriteAtlas: {fileID: 100100200, guid: 3855e71da36cb4dfeb0ce0972ed08272, type: 3}
   packInfo:
-    packName: all
-    packgJsonPath: /Art/UIAssets/TextrueJson/all.txt
-    packgSpritePath: Assets/Res/UIAtlas/all.spriteatlasv2
-    lasetJsonGUID: ace5466faa841bb7b9046587aae54d38
+    packName: allIcon
+    packgJsonPath: /Art/UIAssets/TextrueJson/allIcon.txt
+    packgSpritePath: Assets/Res/UIAtlas/allIcon.spriteatlasv2
+    lasetJsonGUID: 083ae4b3a7b2beffb51fed7b1b7800d3
 --- !u!1 &750435095842706522
 GameObject:
   m_ObjectHideFlags: 0
@@ -12136,6 +12115,105 @@ MonoBehaviour:
   m_hasFontAssetChanged: 0
   m_baseMaterial: {fileID: 0}
   m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
+--- !u!1 &6024056454653000931
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 7
+  m_Component:
+  - component: {fileID: 7679571116687404075}
+  - component: {fileID: 827566263712953353}
+  - component: {fileID: 2909207162732315732}
+  - component: {fileID: 6007860671520462442}
+  m_Layer: 0
+  m_HasEditorInfo: 1
+  m_Name: di_mask
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &7679571116687404075
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6024056454653000931}
+  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:
+  - {fileID: 412427599050978791}
+  m_Father: {fileID: 7590355994602595722}
+  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: -46.1, y: 16.1}
+  m_SizeDelta: {x: 42, y: 42}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &827566263712953353
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6024056454653000931}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_ShowMaskGraphic: 1
+--- !u!222 &2909207162732315732
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6024056454653000931}
+  m_CullTransparentMesh: 1
+--- !u!114 &6007860671520462442
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6024056454653000931}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 3c247620ca3a1fd4ab2a2f3a5b287e07, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 0.050980393, g: 0.94509804, b: 0.33333334, 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_Sprite: {fileID: 0}
+  m_Type: 0
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+  m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
+  _icon_name: dec_00_04_06_Bg
+  isNotLoadDeftIcon: 0
+  CurrSpriteAtlas: {fileID: 100100200, guid: 7b02f32fa59cd4e3085208946b112537, type: 3}
+  packInfo:
+    packName: all
+    packgJsonPath: /Art/UIAssets/TextrueJson/all.txt
+    packgSpritePath: Assets/Res/UIAtlas/all.spriteatlasv2
+    lasetJsonGUID: fdc09952e21a713f23682168cce500b3
 --- !u!1 &6088236847350139630
 GameObject:
   m_ObjectHideFlags: 0
@@ -18384,7 +18462,6 @@ GameObject:
   serializedVersion: 7
   m_Component:
   - component: {fileID: 7590355994602595722}
-  - component: {fileID: 1050030769063437467}
   m_Layer: 0
   m_HasEditorInfo: 1
   m_Name: Area
@@ -18405,7 +18482,7 @@ RectTransform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children:
-  - {fileID: 412427599050978791}
+  - {fileID: 7679571116687404075}
   - {fileID: 6032640576445051180}
   m_Father: {fileID: 6450843375123603411}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -18414,32 +18491,6 @@ RectTransform:
   m_AnchoredPosition: {x: 0, y: -14}
   m_SizeDelta: {x: 370.97, y: 62.83}
   m_Pivot: {x: 0.5, y: 0.5}
---- !u!114 &1050030769063437467
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 8405527899753364590}
-  m_Enabled: 0
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  m_Padding:
-    m_Left: 0
-    m_Right: 0
-    m_Top: 0
-    m_Bottom: 0
-  m_ChildAlignment: 4
-  m_Spacing: 17
-  m_ChildForceExpandWidth: 0
-  m_ChildForceExpandHeight: 0
-  m_ChildControlWidth: 0
-  m_ChildControlHeight: 0
-  m_ChildScaleWidth: 0
-  m_ChildScaleHeight: 0
-  m_ReverseArrangement: 0
 --- !u!1 &8504566407075160577
 GameObject:
   m_ObjectHideFlags: 0
@@ -20044,7 +20095,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 3724598441491386566, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_IsActive
-      value: 1
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 5231644514269099707, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchorMax.y
@@ -20056,7 +20107,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 5231644514269099707, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_SizeDelta.y
-      value: 0
+      value: 31
       objectReference: {fileID: 0}
     - target: {fileID: 5231644514269099707, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.x
@@ -20100,7 +20151,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 8233403908056166009, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_SizeDelta.y
-      value: 0
+      value: 31
       objectReference: {fileID: 0}
     - target: {fileID: 8233403908056166009, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.x
@@ -20120,7 +20171,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 8439587507723242819, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_SizeDelta.y
-      value: 0
+      value: 31
       objectReference: {fileID: 0}
     - target: {fileID: 8439587507723242819, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.x
@@ -20220,7 +20271,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 8870045557280260565, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_SizeDelta.y
-      value: 0
+      value: 31
       objectReference: {fileID: 0}
     - target: {fileID: 8870045557280260565, guid: 0e32f2c66c36945f1a6217839d31a7df, type: 3}
       propertyPath: m_AnchoredPosition.x

+ 14 - 0
Assets/Scripts/GameLogic/Hero/HeroController.cs

@@ -57,6 +57,20 @@ namespace GameLogic.Hero
             EventManager.Instance.Dispatch(CustomEventType.MainLvUp, new SimpleEventData(){intData = m_MainLevel});
         }
 
+
+        public HeroUpResultType CanPromote(HeroInfo heroInfo)
+        {
+            long curHeroCount = BagController.Instance.GetItemInfo(heroInfo.modelConfig.itemID).count.Value;
+            int costHeroCount = heroInfo.promoteConfig.costCount;
+
+            if (curHeroCount < costHeroCount)
+            {
+                return HeroUpResultType.ResNotEnough;    
+            }
+            
+            return HeroUpResultType.Success;
+        }
+        
         public HeroUpResultType CanUpgrade(HeroInfo heroInfo, bool isOpenPre = false)
         {
             if (PlayerManager.Instance.gameConstantConfig.maxLv <= heroInfo.level.Value)

+ 16 - 8
Assets/Scripts/GameUI/UI/Hero/HeroDetailPanel.cs

@@ -140,7 +140,7 @@ namespace Fort23.Mono
         public SkillUIComponent skillUIComponent;
         private async void OnClickSkill()
         {
-            // skillUIComponent = await UIManager.Instance.CreateGComponent<SkillUIComponent>(null, poolName:"SkillUIComponent",
+            // skillUIComponent = await UIManager.Instance.CreateGCompo nent<SkillUIComponent>(null, poolName:"SkillUIComponent",
             //     root:transform);
             
             
@@ -163,13 +163,20 @@ namespace Fort23.Mono
 
             if (isOpenPre)
             {
-                heroInfo.Promote();
-                PlayerManager.Instance.SaveHeroData(heroInfo);
-                UpdateAttributeUI();
-                HeroUITools.SetStarShow(stars, heroInfo.star.Value);
-                PlayerManager.Instance.heroController.SendEvent(HeroUpType.Promote, heroInfo, HeroUpResultType.Success);
-                ExitPowerUpPre(curPreTyp, upPre.Stars2);
-                
+
+                if (PlayerManager.Instance.heroController.CanPromote(heroInfo) == HeroUpResultType.Success)
+                {
+                    heroInfo.Promote();
+                    PlayerManager.Instance.SaveHeroData(heroInfo);
+                    UpdateAttributeUI();
+                    HeroUITools.SetStarShow(stars, heroInfo.star.Value);
+                    PlayerManager.Instance.heroController.SendEvent(HeroUpType.Promote, heroInfo, HeroUpResultType.Success);
+                    ExitPowerUpPre(curPreTyp, upPre.Stars2);
+                }
+                else
+                {
+                    TipMessagePanel.OpenTipMessagePanel("资源不足", Vector2.zero);
+                }
             }
             else
             {
@@ -396,6 +403,7 @@ namespace Fort23.Mono
             iconZhiYe.icon_name = heroInfo.GetZyIconName();
             iconCommonEquip.icon_name = heroInfo.GetZyIconName();
             heroName.text = LanguageManager.Instance.Text(heroInfo.modelConfig.name);
+            heroShards.icon_name = heroInfo.modelConfig.headicon;
             // LayoutRebuilder.MarkLayoutForRebuild(StarsLayout.transform.GetComponent<RectTransform>());
             // StarsLayout.gameObject.SetActive(true);