加入很多新内容,这波一块交了
This commit is contained in:
@@ -139,19 +139,27 @@ public class chooseSkillPrefab : MonoBehaviour, IPointerEnterHandler, IPointerEx
|
||||
detailPinnedByButton = pinnedByButton;
|
||||
detailOpenedFrame = Time.frameCount;
|
||||
|
||||
Transform parent = transform.root != null ? transform.root : transform;
|
||||
Transform parent = ResolveDetailParent();
|
||||
spawnedDetail = Instantiate(sskilldetialPrefab, parent);
|
||||
spawnedDetail.transform.SetAsLastSibling();
|
||||
|
||||
RectTransform selfRect = transform as RectTransform;
|
||||
RectTransform detailRect = spawnedDetail.transform as RectTransform;
|
||||
RectTransform parentRect = parent as RectTransform;
|
||||
if (selfRect != null && detailRect != null && parentRect != null)
|
||||
{
|
||||
Canvas canvas = parent.GetComponentInParent<Canvas>();
|
||||
Camera eventCamera = null;
|
||||
if (canvas != null && canvas.renderMode != RenderMode.ScreenSpaceOverlay)
|
||||
{
|
||||
eventCamera = canvas.worldCamera;
|
||||
}
|
||||
|
||||
Vector3 worldPoint = selfRect.TransformPoint(new Vector3(selfRect.rect.xMax, selfRect.rect.center.y, 0f));
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(
|
||||
parentRect,
|
||||
RectTransformUtility.WorldToScreenPoint(null, worldPoint),
|
||||
null,
|
||||
RectTransformUtility.WorldToScreenPoint(eventCamera, worldPoint),
|
||||
eventCamera,
|
||||
out Vector2 localPoint);
|
||||
detailRect.anchoredPosition = localPoint + detailPrefabOffset;
|
||||
}
|
||||
@@ -163,6 +171,22 @@ public class chooseSkillPrefab : MonoBehaviour, IPointerEnterHandler, IPointerEx
|
||||
}
|
||||
}
|
||||
|
||||
private Transform ResolveDetailParent()
|
||||
{
|
||||
Canvas canvas = GetComponentInParent<Canvas>();
|
||||
if (canvas != null && canvas.rootCanvas != null)
|
||||
{
|
||||
return canvas.rootCanvas.transform;
|
||||
}
|
||||
|
||||
if (transform.root != null)
|
||||
{
|
||||
return transform.root;
|
||||
}
|
||||
|
||||
return transform;
|
||||
}
|
||||
|
||||
private bool IsPointerInside(Vector2 screenPoint)
|
||||
{
|
||||
if (IsScreenPointInside(transform as RectTransform, screenPoint))
|
||||
|
||||
@@ -195,6 +195,11 @@ public class equipSmelt : MonoBehaviour
|
||||
SavePersistentState();
|
||||
}
|
||||
|
||||
public void RefreshPlayerSkillAdjustedUi()
|
||||
{
|
||||
RefreshAllUi();
|
||||
}
|
||||
|
||||
public void SetDragPreviewVisible(bool visible)
|
||||
{
|
||||
if (dragObj == null)
|
||||
@@ -382,6 +387,7 @@ public class equipSmelt : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
int grantedFragments = Mathf.Max(0, pendingDirectFragmentsState);
|
||||
if (pendingDirectFragmentsState > 0)
|
||||
{
|
||||
PlayerEconomyLedger.EnsureInstance().AddMaterial(pendingDirectFragmentsState);
|
||||
@@ -398,6 +404,11 @@ public class equipSmelt : MonoBehaviour
|
||||
SavePersistentState();
|
||||
RefreshAllSmeltPools();
|
||||
RefreshAllEquipBags();
|
||||
|
||||
if (grantedFragments > 0)
|
||||
{
|
||||
gItemGet.display(gItemGet.Create("记忆碎片", ResolveMemoryFragmentSprite(), grantedFragments, ItemRarity.Uncommon));
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleGetRewardClicked()
|
||||
@@ -530,10 +541,30 @@ public class equipSmelt : MonoBehaviour
|
||||
ReinstateRewardEquipment(generated);
|
||||
storedSmeltEnergyState = Mathf.Max(0, storedSmeltEnergyState - requiredAmount);
|
||||
SavePersistentState();
|
||||
gItemGet.display(gItemGet.FromEquipment(generated, 1));
|
||||
RefreshAllUi();
|
||||
RefreshAllEquipBags();
|
||||
}
|
||||
|
||||
private static Sprite ResolveMemoryFragmentSprite()
|
||||
{
|
||||
equipSmelt[] instances = FindObjectsByType<equipSmelt>(FindObjectsInactive.Include, FindObjectsSortMode.None);
|
||||
if (instances == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < instances.Length; i++)
|
||||
{
|
||||
if (instances[i] != null && instances[i].memoryFragment != null)
|
||||
{
|
||||
return instances[i].memoryFragment;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void HandleRewardSelectorClosed()
|
||||
{
|
||||
activeCtasInstance = null;
|
||||
@@ -959,12 +990,14 @@ public class equipSmelt : MonoBehaviour
|
||||
|
||||
private int GetQuickFinishCost()
|
||||
{
|
||||
return ssrso != null ? Mathf.Max(0, ssrso.quickFinishCost) : 0;
|
||||
int baseCost = ssrso != null ? Mathf.Max(0, ssrso.quickFinishCost) : 0;
|
||||
return PlayerSkillService.ModifySmeltCoinCost(baseCost);
|
||||
}
|
||||
|
||||
private int GetStartSmeltCost()
|
||||
{
|
||||
return ssrso != null ? Mathf.Max(0, ssrso.startSmeltCost) : 0;
|
||||
int baseCost = ssrso != null ? Mathf.Max(0, ssrso.startSmeltCost) : 0;
|
||||
return PlayerSkillService.ModifySmeltCoinCost(baseCost);
|
||||
}
|
||||
|
||||
private smeltStageRewardSO.SmeltStageRewardRequirement GetSelectedRewardRequirement()
|
||||
|
||||
Reference in New Issue
Block a user