Browse Source

가챠 이펙트 애니메이터 형식으로 변환

sound
ldh 1 year ago
parent
commit
ebf50ef40c
  1. 50
      Assets/_2_0Script/Item/GoodsEfcItem.cs
  2. 5
      Assets/_2_0Script/Mgr/GachaMgr.cs
  3. 25
      Assets/_3Prefab/Item/GoodsEfcItem.prefab
  4. 8
      Assets/_6Animator.meta
  5. 12
      Assets/_6Animator/AA.controller
  6. 8
      Assets/_6Animator/AA.controller.meta

50
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<RectTransform>();
imgBg = GetComponent<Image>();
imgIcon = transform.Find("icon").GetComponent<Image>();
imgRarity = transform.Find("rarity").GetComponent<Image>();
imgStars = transform.Find("stars").GetComponentsInChildren<Image>();
txtRarity = transform.Find("txtRarity").GetComponent<TextMeshProUGUI>();
trfShineEffect = transform.Find("ShineEffect");
trfTopEffect = transform.Find("gachaTopEffect");
txtCount = transform.Find("txtCount").GetComponent<TextMeshProUGUI>();
}
@ -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);
}
}

5
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++;

25
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

8
Assets/_6Animator.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 81982a7e9301a404ca377038513d9f62
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

12
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: []

8
Assets/_6Animator/AA.controller.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 70fd0e8ba344f064e98b9c17a877dad3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save