From ebf50ef40c0f5b80969cffbd42cb03cd4a04aa6a Mon Sep 17 00:00:00 2001 From: ldh Date: Tue, 13 Feb 2024 17:43:55 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B0=80=EC=B1=A0=20=EC=9D=B4=ED=8E=99?= =?UTF-8?q?=ED=8A=B8=20=EC=95=A0=EB=8B=88=EB=A9=94=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=ED=98=95=EC=8B=9D=EC=9C=BC=EB=A1=9C=20=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/_2_0Script/Item/GoodsEfcItem.cs | 50 +++++------------------- Assets/_2_0Script/Mgr/GachaMgr.cs | 5 +-- Assets/_3Prefab/Item/GoodsEfcItem.prefab | 25 +++++++++++- Assets/_6Animator.meta | 8 ++++ Assets/_6Animator/AA.controller | 12 ++++++ Assets/_6Animator/AA.controller.meta | 8 ++++ 6 files changed, 62 insertions(+), 46 deletions(-) create mode 100644 Assets/_6Animator.meta create mode 100644 Assets/_6Animator/AA.controller create mode 100644 Assets/_6Animator/AA.controller.meta diff --git a/Assets/_2_0Script/Item/GoodsEfcItem.cs b/Assets/_2_0Script/Item/GoodsEfcItem.cs index a63c06a29..bf81c4fd6 100644 --- a/Assets/_2_0Script/Item/GoodsEfcItem.cs +++ b/Assets/_2_0Script/Item/GoodsEfcItem.cs @@ -1,4 +1,4 @@ -using IVDataFormat; +using IVDataFormat; using System.Numerics; using TMPro; using UnityEngine; @@ -6,26 +6,17 @@ using UnityEngine.UI; public class GoodsEfcItem : GoodsItem { - #region UI - private Transform trfShineEffect; - private Transform trfTopEffect; - private RectTransform rtrf; - #endregion UI - - - + static readonly int _rarityParam = Animator.StringToHash("Rarity"); + [SerializeField] private Animator rarityEffectAnimator; protected override void Init() { - rtrf = GetComponent(); imgBg = GetComponent(); imgIcon = transform.Find("icon").GetComponent(); imgRarity = transform.Find("rarity").GetComponent(); imgStars = transform.Find("stars").GetComponentsInChildren(); txtRarity = transform.Find("txtRarity").GetComponent(); - trfShineEffect = transform.Find("ShineEffect"); - trfTopEffect = transform.Find("gachaTopEffect"); txtCount = transform.Find("txtCount").GetComponent(); } @@ -35,7 +26,7 @@ public class GoodsEfcItem : GoodsItem Init(); imgIcon.sprite = AddressableMgr.GetIcon(itype, icode); - SetActiveEffects(false); + rarityEffectAnimator?.SetInteger(_rarityParam, 0); switch (itype) { @@ -70,15 +61,12 @@ public class GoodsEfcItem : GoodsItem case cGoods.TBagAcceRing: dGear gear = DataHandler.GetGearEquip(itype, icode); imgIcon.enabled = true; - //imgBg.color = Global.CLR_RarityBack[gear.rarity]; - //imgRarity.color = Global.CLR_RarityFront[gear.rarity]; imgRarity.enabled = true; - for (int i = 0; i < imgStars.Length; i++) + for (int i = 0; i < imgStars.Length; ++i) imgStars[i].enabled = i < gear.grade; txtRarity.text = Global.STR_Rarity[gear.rarity]; txtRarity.enabled = true; - if (gear.rarity >= cGoods.RUnique) - SetActiveEffects(true); + rarityEffectAnimator?.SetInteger(_rarityParam, gear.rarity); if (icount == 1) { @@ -89,7 +77,7 @@ public class GoodsEfcItem : GoodsItem txtCount.enabled = true; txtCount.text = icount.ToString(); } - imgBg.sprite = AddressableMgr.GetGradeIcon(gear.rarity);// Global.CLR_RarityBack[]; + imgBg.sprite = AddressableMgr.GetGradeIcon(gear.rarity); imgRarity.sprite = AddressableMgr.GetGradeLatterIcon(gear.rarity); break; @@ -232,8 +220,7 @@ public class GoodsEfcItem : GoodsItem imgStars[i].enabled = i < box.grade; txtRarity.text = Global.STR_Rarity[box.rarity]; txtRarity.enabled = true; - if (box.rarity >= cGoods.RUnique) - SetActiveEffects(true); + rarityEffectAnimator?.SetInteger(_rarityParam, box.rarity); } if (icount == 1) @@ -266,27 +253,8 @@ public class GoodsEfcItem : GoodsItem } break; } + if (bpvp) imgBg.color = Color.clear; } - - public void SetEffect(bool blarge) - { - if(blarge) - { - trfShineEffect.localScale = new UnityEngine.Vector3(1f, 1f, 1f); - trfTopEffect.localScale = new UnityEngine.Vector3(100f, 100f, 1f); - } - else - { - trfShineEffect.localScale = new UnityEngine.Vector3(0.7f, 0.7f, 1f); - trfTopEffect.localScale = new UnityEngine.Vector3(70f, 70f, 1f); - } - } - public void SetActiveEffects(bool bvalue) - { - trfShineEffect.gameObject.SetActive(bvalue); - trfTopEffect.gameObject.SetActive(bvalue); - } - } diff --git a/Assets/_2_0Script/Mgr/GachaMgr.cs b/Assets/_2_0Script/Mgr/GachaMgr.cs index 38727a383..63c5aa1d7 100644 --- a/Assets/_2_0Script/Mgr/GachaMgr.cs +++ b/Assets/_2_0Script/Mgr/GachaMgr.cs @@ -1,4 +1,4 @@ -using DG.Tweening; +using DG.Tweening; using IVDataFormat; using IVServerFormat; using Spine.Unity; @@ -1598,9 +1598,6 @@ public class GachaMgr : MonoBehaviour } - goodsItems[i].SetEffect(blarge); - //goodsItems[i].gameObject.SetActive(true); - if (icount <= 56) { itemcnt++; diff --git a/Assets/_3Prefab/Item/GoodsEfcItem.prefab b/Assets/_3Prefab/Item/GoodsEfcItem.prefab index 46054104c..530be6549 100644 --- a/Assets/_3Prefab/Item/GoodsEfcItem.prefab +++ b/Assets/_3Prefab/Item/GoodsEfcItem.prefab @@ -489,6 +489,7 @@ GameObject: - component: {fileID: 1634192707293094109} - component: {fileID: 823748656915559242} - component: {fileID: 4182979342035112685} + - component: {fileID: 5753434882885946160} m_Layer: 5 m_Name: GoodsEfcItem m_TagString: Untagged @@ -535,6 +536,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fed6d4403bdc1fd4eba85e4a32c68da1, type: 3} m_Name: m_EditorClassIdentifier: + rarityEffectAnimator: {fileID: 5753434882885946160} --- !u!222 &823748656915559242 CanvasRenderer: m_ObjectHideFlags: 0 @@ -573,6 +575,27 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!95 &5753434882885946160 +Animator: + serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5395863509908773252} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 70fd0e8ba344f064e98b9c17a877dad3, type: 2} + m_CullingMode: 0 + m_UpdateMode: 2 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 --- !u!1 &5834861895424211374 GameObject: m_ObjectHideFlags: 0 @@ -1267,7 +1290,7 @@ MeshRenderer: m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 1526676023 - m_SortingLayer: 4 + m_SortingLayer: 6 m_SortingOrder: 52 m_AdditionalVertexStreams: {fileID: 0} --- !u!114 &1549567373645146543 diff --git a/Assets/_6Animator.meta b/Assets/_6Animator.meta new file mode 100644 index 000000000..a9ca98c8e --- /dev/null +++ b/Assets/_6Animator.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81982a7e9301a404ca377038513d9f62 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_6Animator/AA.controller b/Assets/_6Animator/AA.controller new file mode 100644 index 000000000..e0dac8bca --- /dev/null +++ b/Assets/_6Animator/AA.controller @@ -0,0 +1,12 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AA + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: [] diff --git a/Assets/_6Animator/AA.controller.meta b/Assets/_6Animator/AA.controller.meta new file mode 100644 index 000000000..7d5835228 --- /dev/null +++ b/Assets/_6Animator/AA.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 70fd0e8ba344f064e98b9c17a877dad3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: