122 子 【武将】武将系统 / 【武将】武将系统-客户端 - 去掉旧的UIEffect
12个文件已修改
3个文件已添加
1 文件已复制
9个文件已删除
11 文件已重命名
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | public class ItemBaseEffect : MonoBehaviour |
| | | public class ItemBaseEffect : MonoBehaviour |
| | | { |
| | | [SerializeField] EffectPlayer m_SuitEffect; |
| | | |
| | | int itemId = 0; |
| | | |
| | | private void OnEnable() |
| | | { |
| | | [SerializeField] UIEffect m_SuitEffect; |
| | | |
| | | int itemId = 0; |
| | | Display(itemId); |
| | | } |
| | | |
| | | private void OnEnable() |
| | | public void Display(int itemId, bool dirty = false) |
| | | { |
| | | this.itemId = itemId; |
| | | var curItem = ItemConfig.Get(this.itemId); |
| | | bool isPlay = true; |
| | | if (curItem == null) |
| | | { |
| | | Display(itemId); |
| | | isPlay = false; |
| | | return; |
| | | } |
| | | |
| | | public void Display(int itemId, bool dirty = false) |
| | | int effectId = 0; |
| | | switch (curItem.ItemColor) |
| | | { |
| | | this.itemId = itemId; |
| | | var curItem = ItemConfig.Get(this.itemId); |
| | | bool isPlay = true; |
| | | if (curItem == null) |
| | | { |
| | | isPlay = false; |
| | | return; |
| | | } |
| | | |
| | | int effectId = 0; |
| | | switch (curItem.ItemColor) |
| | | { |
| | | case 4: |
| | | effectId = 7119; |
| | | break; |
| | | case 5: |
| | | effectId = 7120; |
| | | break; |
| | | case 6: |
| | | case 7: |
| | | case 8: |
| | | effectId = 7121; |
| | | break; |
| | | } |
| | | |
| | | if (curItem.BaseEffectID != 0) |
| | | { |
| | | effectId = curItem.BaseEffectID; |
| | | } |
| | | |
| | | if (m_SuitEffect.effect != effectId) |
| | | { |
| | | //同一个位置替换特效需要先释放 |
| | | m_SuitEffect.StopImediatly(); |
| | | } |
| | | m_SuitEffect.effect = effectId; |
| | | |
| | | if (m_SuitEffect.effect == 0) |
| | | { |
| | | isPlay = false; |
| | | } |
| | | if (isPlay) |
| | | { |
| | | m_SuitEffect.Play(); |
| | | } |
| | | else |
| | | { |
| | | m_SuitEffect.StopImediatly(); |
| | | } |
| | | |
| | | // if (dirty) |
| | | // { |
| | | // SnxxzGame.Instance.StartCoroutine(Co_SetOrder(this, transform as RectTransform)); |
| | | // } |
| | | case 4: |
| | | effectId = 7119; |
| | | break; |
| | | case 5: |
| | | effectId = 7120; |
| | | break; |
| | | case 6: |
| | | case 7: |
| | | case 8: |
| | | effectId = 7121; |
| | | break; |
| | | } |
| | | |
| | | public static ItemBaseEffect Create(RectTransform transform) |
| | | if (curItem.BaseEffectID != 0) |
| | | { |
| | | var go = UIUtility.CreateWidget("ItemBaseEffect", "ItemBaseEffect"); |
| | | var behaviour = go.GetComponent<ItemBaseEffect>(); |
| | | |
| | | // SnxxzGame.Instance.StartCoroutine(Co_SetOrder(behaviour, transform)); |
| | | |
| | | var scale = 1f; |
| | | var itemBasic = transform.GetComponentInParent<CommonItemBaisc>(); |
| | | if (itemBasic == null) |
| | | itemBasic = transform.GetComponentInParent<ItemCell>(); |
| | | if (itemBasic != null) |
| | | { |
| | | scale = GetEffectScale(itemBasic.format); |
| | | } |
| | | // else |
| | | // { |
| | | // var itemBehaviour = transform.GetComponentInParent<ItemBehaviour>(); |
| | | // if (itemBehaviour != null) |
| | | // { |
| | | // if (itemBehaviour.backGround != null) |
| | | // { |
| | | // var size = itemBehaviour.backGround.rectTransform.rect.width; |
| | | // scale = size / 84; |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // var findPreciousItemBehaviour = transform.GetComponentInParent<FindPreciousItemBehaviour>(); |
| | | // if (findPreciousItemBehaviour != null) |
| | | // { |
| | | // scale = 0.86f; //暂且写死 |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | var rect = go.transform as RectTransform; |
| | | go.transform.SetParentEx(transform, Vector3.zero, Quaternion.identity, Vector3.one); |
| | | rect.MatchWhith(transform); |
| | | go.transform.localScale = Vector3.one * scale; |
| | | go.transform.SetAsLastSibling(); |
| | | |
| | | return behaviour; |
| | | effectId = curItem.BaseEffectID; |
| | | } |
| | | |
| | | static IEnumerator Co_SetOrder(ItemBaseEffect behaviour, RectTransform transform) |
| | | if (m_SuitEffect.effectId != effectId) |
| | | { |
| | | yield return null; |
| | | |
| | | if (transform == null || behaviour == null) |
| | | { |
| | | yield break; |
| | | } |
| | | |
| | | Canvas canva = transform.GetComponentInParent<Canvas>(); |
| | | if (canva != null) |
| | | { |
| | | behaviour.m_SuitEffect.ResetOrder(canva.sortingOrder + 1); |
| | | } |
| | | |
| | | if (behaviour.m_SuitEffect.maskArea == null) |
| | | { |
| | | behaviour.m_SuitEffect.SetMask(); |
| | | } |
| | | //同一个位置替换特效需要先释放 |
| | | m_SuitEffect.Stop(); |
| | | } |
| | | m_SuitEffect.effectId = effectId; |
| | | |
| | | static float GetEffectScale(ItemCellformat format) |
| | | if (m_SuitEffect.effectId == 0) |
| | | { |
| | | switch (format) |
| | | { |
| | | case ItemCellformat.Format_100x100: |
| | | return 1.1f; |
| | | case ItemCellformat.Format_80x80: |
| | | return 0.95f; |
| | | case ItemCellformat.Format_70x70: |
| | | return 0.83f; |
| | | case ItemCellformat.Format_64x64: |
| | | return 0.76f; |
| | | default: |
| | | return 1f; |
| | | } |
| | | isPlay = false; |
| | | } |
| | | if (isPlay) |
| | | { |
| | | m_SuitEffect.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | m_SuitEffect.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | public static ItemBaseEffect Create(RectTransform transform) |
| | | { |
| | | var go = UIUtility.CreateWidget("ItemBaseEffect", "ItemBaseEffect"); |
| | | var behaviour = go.GetComponent<ItemBaseEffect>(); |
| | | |
| | | var scale = 1f; |
| | | var itemBasic = transform.GetComponentInParent<CommonItemBaisc>(); |
| | | if (itemBasic == null) |
| | | itemBasic = transform.GetComponentInParent<ItemCell>(); |
| | | if (itemBasic != null) |
| | | { |
| | | scale = GetEffectScale(itemBasic.format); |
| | | } |
| | | else |
| | | { |
| | | var itemBehaviour = transform.GetComponentInParent<ItemBehaviour>(); |
| | | if (itemBehaviour != null) |
| | | { |
| | | if (itemBehaviour.backGround != null) |
| | | { |
| | | var size = itemBehaviour.backGround.rectTransform.rect.width; |
| | | scale = size / 84; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | var rect = go.transform as RectTransform; |
| | | go.transform.SetParentEx(transform, Vector3.zero, Quaternion.identity, Vector3.one); |
| | | rect.MatchWhith(transform); |
| | | go.transform.localScale = Vector3.one * scale; |
| | | go.transform.SetAsLastSibling(); |
| | | |
| | | return behaviour; |
| | | } |
| | | |
| | | |
| | | static float GetEffectScale(ItemCellformat format) |
| | | { |
| | | switch (format) |
| | | { |
| | | case ItemCellformat.Format_100x100: |
| | | return 1.1f; |
| | | case ItemCellformat.Format_80x80: |
| | | return 0.95f; |
| | | case ItemCellformat.Format_70x70: |
| | | return 0.83f; |
| | | case ItemCellformat.Format_64x64: |
| | | return 0.76f; |
| | | default: |
| | | return 1f; |
| | | } |
| | | } |
| | | } |
| | |
| | |
|
| | | [SerializeField] ItemType m_ItemType = ItemType.Rewards;
|
| | |
|
| | | EquipSuitEffect m_EquipSuitEffect;
|
| | | EquipSuitEffect equipSuitEffect
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_EquipSuitEffect == null)
|
| | | {
|
| | | m_EquipSuitEffect = EquipSuitEffect.Create(transform as RectTransform);
|
| | | }
|
| | | return m_EquipSuitEffect;
|
| | | }
|
| | | }
|
| | |
|
| | | //物品基础特效(物品表)
|
| | | ItemBaseEffect m_ItemBaseEffect;
|
| | | ItemBaseEffect itemBaseEffect
|
| | |
| | | backGround.SetItemBackGround(itemQuality != 0 ? itemQuality : itemInfo.ItemColor, itemInfo.QualityEchoType);
|
| | | }
|
| | |
|
| | | equipSuitEffect.Display(itemId);
|
| | | itemBaseEffect.Display(itemId);
|
| | | }
|
| | | catch (Exception e)
|
New file |
| | |
| | | using UnityEngine.UI; |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | public class OutlineColor : Outline |
| | | { |
| | | |
| | | [SerializeField][HideInInspector] |
| | | QualityTextColType m_ColorType = QualityTextColType.None; |
| | | public QualityTextColType colorType |
| | | { |
| | | get { return m_ColorType; } |
| | | set |
| | | { |
| | | if (m_ColorType != value) |
| | | { |
| | | m_ColorType = value; |
| | | this.effectColor = UIHelper.GetUIOutlineColor(value); |
| | | } |
| | | } |
| | | } |
| | | |
| | | [SerializeField][HideInInspector] |
| | | Vector2 m_EffectDistanceEx = new Vector2(1.5f, -1.5f); |
| | | public Vector2 effectDistanceEx |
| | | { |
| | | get { return m_EffectDistanceEx; } |
| | | set |
| | | { |
| | | if (m_EffectDistanceEx != value) |
| | | { |
| | | m_EffectDistanceEx = value; |
| | | effectDistance = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | protected override void Awake() |
| | | { |
| | | this.effectDistance = m_EffectDistanceEx; |
| | | this.effectColor = UIHelper.GetUIOutlineColor(colorType); |
| | | } |
| | | |
| | | |
| | | } |
File was renamed from Main/Component/UI/Effect/UIEffectTransmitController.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ef9791258cf62d544871c2a0c053d930 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | using UnityEngine; |
| | | |
| | | public class EffectMgr : SingletonMonobehaviour<EffectMgr> |
| | | |
| | | { |
| | | public UIEffectBehaviour GetUIEffect(int id, bool _destroy = false) |
| | | { |
| | | EffectConfig effectCfg = EffectConfig.Get(id); |
| | | |
| | | if (null == effectCfg) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | var _prefab = ResManager.Instance.LoadAsset<GameObject>("UIEffect/" + effectCfg.packageName, effectCfg.fxName); |
| | | if (_prefab == null) |
| | | { |
| | | return null; |
| | | } |
| | | GameObjectPoolManager.GameObjectPool _pool = GameObjectPoolManager.Instance.RequestPool(_prefab); |
| | | _prefab = _pool.Request(); |
| | | var _effect = _prefab.GetComponent<UIEffect>(); |
| | | if (_effect != null && _destroy) |
| | | { |
| | | Destroy(_effect); |
| | | } |
| | | var _behaviour = _prefab.AddMissingComponent<UIEffectBehaviour>(); |
| | | return _behaviour; |
| | | } |
| | | |
| | | //玩家是否主动屏蔽了特效 |
| | | public bool IsNotShowBySetting(int id) |
| | |
| | | if (config == null) |
| | | { |
| | | #if UNITY_EDITOR |
| | | Debug.LogError("特效配置表中没有找到id为" + id + "的特效"); |
| | | if (id != 0) |
| | | Debug.LogError("特效配置表中没有找到id为" + id + "的特效"); |
| | | #endif |
| | | return true; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | public UIEffect PlayUIEffect(int id, int renderQueue, Transform parent, bool loop) |
| | | { |
| | | if (IsNotShowBySetting(id)) |
| | | return null; |
| | | UIEffectBehaviour _behaviour = GetUIEffect(id); |
| | | UIEffect uieffect = null; |
| | | if (_behaviour != null) |
| | | { |
| | | _behaviour.SetActive(false); |
| | | _behaviour.transform.SetParent(parent); |
| | | uieffect = _behaviour.AddMissingComponent<UIEffect>(); |
| | | uieffect.target = _behaviour; |
| | | SetUIEffect(uieffect, id, renderQueue, loop, Vector3.zero, Vector3.zero); |
| | | uieffect.Active(); |
| | | } |
| | | return uieffect; |
| | | } |
| | | |
| | | public UIEffect PlayUIEffect(int id, int renderQueue, Transform parent, Vector3 _localPos, Vector3 _localRot, bool loop) |
| | | { |
| | | if (IsNotShowBySetting(id)) |
| | | return null; |
| | | UIEffectBehaviour _behaviour = GetUIEffect(id); |
| | | UIEffect uieffect = null; |
| | | if (_behaviour != null) |
| | | { |
| | | _behaviour.SetActive(false); |
| | | _behaviour.transform.SetParent(parent); |
| | | uieffect = _behaviour.AddMissingComponent<UIEffect>(); |
| | | uieffect.target = _behaviour; |
| | | SetUIEffect(uieffect, id, renderQueue, loop, _localPos, _localRot); |
| | | uieffect.Active(); |
| | | } |
| | | return uieffect; |
| | | } |
| | | |
| | | public UIEffect PlayUIEffect(int id, int renderQueue, Vector3 _localPos, bool loop = false) |
| | | { |
| | | if (IsNotShowBySetting(id)) |
| | | return null; |
| | | UIEffectBehaviour _behaviour = GetUIEffect(id); |
| | | UIEffect uieffect = null; |
| | | if (_behaviour != null) |
| | | { |
| | | _behaviour.SetActive(false); |
| | | // TODO YYL |
| | | // _behaviour.transform.SetParent(WindowCenter.Instance.uiRoot.baseCanvas); |
| | | uieffect = _behaviour.AddMissingComponent<UIEffect>(); |
| | | uieffect.target = _behaviour; |
| | | SetUIEffect(uieffect, id, renderQueue, loop, _localPos, Vector3.zero); |
| | | uieffect.Active(); |
| | | } |
| | | return uieffect; |
| | | } |
| | | // public void RecyleUIEffect(int id, GameObject _effectObj) |
| | | // { |
| | | // EffectConfig effectCfg = EffectConfig.Get(id); |
| | | |
| | | private void SetUIEffect(UIEffect effect, int id, int renderQueue, bool loop, Vector3 _localPos, Vector3 _localRot) |
| | | { |
| | | effect.effect = id; |
| | | effect.renderQueue = renderQueue; |
| | | effect.loop = loop; |
| | | effect.effectPos = _localPos; |
| | | effect.effectRot = _localRot; |
| | | } |
| | | // if (null == effectCfg) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | public void RecyleUIEffect(int id, GameObject _effectObj) |
| | | { |
| | | EffectConfig effectCfg = EffectConfig.Get(id); |
| | | // var _prefab = ResManager.Instance.LoadAsset<GameObject>("UIEffect/" + effectCfg.packageName, effectCfg.fxName); |
| | | // if (_prefab == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | if (null == effectCfg) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var _prefab = ResManager.Instance.LoadAsset<GameObject>("UIEffect/" + effectCfg.packageName, effectCfg.fxName); |
| | | if (_prefab == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | GameObjectPoolManager.GameObjectPool _pool = GameObjectPoolManager.Instance.RequestPool(_prefab); |
| | | if (_pool != null) |
| | | { |
| | | _pool.Release(_effectObj); |
| | | } |
| | | } |
| | | // GameObjectPoolManager.GameObjectPool _pool = GameObjectPoolManager.Instance.RequestPool(_prefab); |
| | | // if (_pool != null) |
| | | // { |
| | | // _pool.Release(_effectObj); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | |
| | | |
| | | [HideInInspector] public GameObject effectTarget = null; |
| | | |
| | | protected void Start() |
| | | { |
| | | if (EffectMgr.Instance.IsNotShowBySetting(effectId)) |
| | | { |
| | | return; |
| | | } |
| | | protected void Start() |
| | | { |
| | | ReStart(); |
| | | } |
| | | |
| | | if (null != effectTarget) |
| | | { |
| | | DestroyImmediate(effectTarget); |
| | | effectTarget = null; |
| | | } |
| | | public void Stop() |
| | | { |
| | | if (null != effectTarget) |
| | | { |
| | | DestroyImmediate(effectTarget); |
| | | effectTarget = null; |
| | | } |
| | | } |
| | | |
| | | public void Play() |
| | | { |
| | | ReStart(); |
| | | } |
| | | |
| | | |
| | | |
| | | protected void ReStart() |
| | | { |
| | | if (EffectMgr.Instance.IsNotShowBySetting(effectId)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (null != effectTarget) |
| | | { |
| | | DestroyImmediate(effectTarget); |
| | | effectTarget = null; |
| | | } |
| | | |
| | | EffectConfig effectCfg = EffectConfig.Get(effectId); |
| | | |
| | |
| | | Debug.LogError($"加载UI特效失败: {effectCfg.packageName}"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // 实例化特效 |
| | | effectTarget = Instantiate(effectPrefab, transform); |
| | | effectTarget.name = $"Effect_{effectCfg.fxName}"; |
| | | |
| | | if (null == canvas) |
| | | canvas = GetComponentInParent<Canvas>(); |
| | | |
| | | if (null == canvas) |
| | | { |
| | | Debug.LogError("can not find canvas for UIEffect " + effectId); |
| | | return; |
| | | } |
| | | if (null == canvas) |
| | | canvas = GetComponentInParent<Canvas>(); |
| | | |
| | | if (null == canvas) |
| | | { |
| | | Debug.LogError("can not find canvas for UIEffect " + effectId); |
| | | return; |
| | | } |
| | | |
| | | // 添加特效穿透阻挡器 |
| | | EffectPenetrationBlocker blocker = effectTarget.AddComponent<EffectPenetrationBlocker>(); |
| | |
| | | this.DelayFrame(blocker.UpdateSortingOrder); |
| | | |
| | | // blocker.UpdateSortingOrder(); |
| | | |
| | | |
| | | // 自动销毁 |
| | | if (autoDestroy) |
| | | { |
| | | Destroy(effectTarget, destroyDelay); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | [SerializeField] Text taskNumText; |
| | | [SerializeField] Image awardIcon; |
| | | [SerializeField] Text awardCnt; |
| | | [SerializeField] UIEffect taskEffect; |
| | | [SerializeField] EffectPlayer taskEffect; |
| | | |
| | | |
| | | //关卡 |
| | |
| | | }
|
| | | }
|
| | |
|
| | | UIEffect m_AvatarUIEffect;
|
| | | private UIEffect avatarUIEffect
|
| | | EffectPlayer m_AvatarUIEffect;
|
| | | private EffectPlayer avatarUIEffect
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_AvatarUIEffect == null)
|
| | | {
|
| | | m_AvatarUIEffect = this.GetComponent<UIEffect>("AvatarCell/Img_Avatar");
|
| | | m_AvatarUIEffect = this.GetComponent<EffectPlayer>("AvatarCell/Img_Avatar");
|
| | | }
|
| | | return m_AvatarUIEffect;
|
| | | }
|
| | | }
|
| | |
|
| | | UIEffect m_AvatarFrameUIEffect;
|
| | | private UIEffect avatarFrameUIEffect
|
| | | EffectPlayer m_AvatarFrameUIEffect;
|
| | | private EffectPlayer avatarFrameUIEffect
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_AvatarFrameUIEffect == null)
|
| | | {
|
| | | m_AvatarFrameUIEffect = this.GetComponent<UIEffect>("AvatarCell/Img_AvatarFrame");
|
| | | m_AvatarFrameUIEffect = this.GetComponent<EffectPlayer>("AvatarCell/Img_AvatarFrame");
|
| | | }
|
| | | return m_AvatarFrameUIEffect;
|
| | | }
|
| | |
| | |
|
| | | private void InitAvatarUI(int avatarID, int avatarUIEffectID)
|
| | | {
|
| | | avatarUIEffect.Stop();
|
| | | avatarUIEffect?.Stop();
|
| | | avatarUIFrame.enabled = false;
|
| | | if (!PlayerFaceConfig.HasKey(avatarID))
|
| | | return;
|
| | |
| | |
|
| | | if (!EffectConfig.HasKey(avatarUIEffectID))
|
| | | return;
|
| | | avatarUIEffect.effect = avatarUIEffectID;
|
| | | avatarUIEffect.loop = true;
|
| | | avatarUIEffect.effectId = avatarUIEffectID;
|
| | | // avatarUIEffect.loop = true;
|
| | | avatarUIEffect.Play();
|
| | | }
|
| | |
|
| | | private void InitAvatarFrameUI(int avatarFrameID, int avatarFrameUIEffectID)
|
| | | {
|
| | | avatarFrameUIEffect.Stop();
|
| | | avatarFrameUIEffect?.Stop();
|
| | | avatarFrameUIFrame.enabled = false;
|
| | | if (!PlayerFacePicConfig.HasKey(avatarFrameID))
|
| | | return;
|
| | |
| | |
|
| | | if (!EffectConfig.HasKey(avatarFrameUIEffectID))
|
| | | return;
|
| | | avatarUIEffect.effect = avatarFrameUIEffectID;
|
| | | avatarUIEffect.loop = true;
|
| | | avatarUIEffect.effectId = avatarFrameUIEffectID;
|
| | | // avatarUIEffect.loop = true;
|
| | | avatarUIEffect.Play();
|
| | | }
|
| | | }
|
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c1ae185223108c54388b2570cb6b4758 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c1ae185223108c54388b2570cb6b4758 |
| | | guid: 1d795cb72a0e7f34dbc29ba9ff86777a |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using UnityEngine.Events; |
| | | |
| | | public class SkillBaseCell : MonoBehaviour |
| | | { |
| | | |
| | | Image m_SkillIcon; |
| | | Image skillIcon |
| | | { |
| | | get |
| | | { |
| | | if (m_SkillIcon == null) |
| | | { |
| | | m_SkillIcon = this.transform.GetComponent<Image>("Container_SkillCell/Img_Icon"); |
| | | } |
| | | return m_SkillIcon; |
| | | } |
| | | } |
| | | |
| | | Button m_SkillBtn; |
| | | Button skillBtn |
| | | { |
| | | get |
| | | { |
| | | if (m_SkillBtn == null) |
| | | { |
| | | m_SkillBtn = this.transform.GetComponent<Button>("Container_SkillCell"); |
| | | } |
| | | return m_SkillBtn; |
| | | } |
| | | } |
| | | |
| | | |
| | | Text m_SkillType; |
| | | Text skillType |
| | | { |
| | | get |
| | | { |
| | | if (m_SkillType == null) |
| | | { |
| | | m_SkillType = this.transform.GetComponent<Text>("Container_SkillCell/type"); |
| | | } |
| | | return m_SkillType; |
| | | } |
| | | } |
| | | |
| | | void Awake() |
| | | { |
| | | LoadPrefab(); |
| | | } |
| | | |
| | | private void Init(int skillID, UnityAction onclick, bool showType = false) |
| | | { |
| | | var config = SkillConfig.Get(skillID); |
| | | skillIcon.SetSprite(config.IconName); |
| | | skillBtn.AddListener(onclick); |
| | | |
| | | if (showType) |
| | | { |
| | | skillType.text = Language.Get(config.FuncType == 23 ? "HeroSkillType_1" : "HeroSkillType_2"); |
| | | } |
| | | else |
| | | { |
| | | skillType.text = string.Empty; |
| | | } |
| | | } |
| | | |
| | | GameObject cellContainer; |
| | | protected void LoadPrefab() |
| | | { |
| | | if (cellContainer != null) |
| | | return; |
| | | |
| | | var tmp = transform.Find("Container_SkillCell"); |
| | | if (tmp != null) |
| | | { |
| | | cellContainer = tmp.gameObject; |
| | | return; |
| | | } |
| | | if (cellContainer == null) |
| | | { |
| | | cellContainer = UIUtility.CreateWidget("SkillBaseCell", "Container_SkillCell"); |
| | | |
| | | if (cellContainer != null) |
| | | { |
| | | cellContainer.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one); |
| | | cellContainer.transform.SetAsFirstSibling(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
copy from Main/Component/UI/Effect/UIEffectTransmitController.cs.meta
copy to Main/System/Skill/SkillBaseCell.cs.meta
File was copied from Main/Component/UI/Effect/UIEffectTransmitController.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ef9791258cf62d544871c2a0c053d930 |
| | | guid: 73fe4ad712c0103409678bbc847e4116 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | [SerializeField] RichText marqueeText; |
| | | [SerializeField] RectTransform marqueeBg; |
| | | [SerializeField] TweenCurve tweenCurve; |
| | | [SerializeField] UIEffect m_Effect; |
| | | [SerializeField] EffectPlayer m_Effect; |
| | | |
| | | Vector3 fromPos; |
| | | Vector3 toPos; |
| | |
| | | [SerializeField] Button popCancelBtn; |
| | | [SerializeField] RichText popConfirmInfo; |
| | | [SerializeField] Text popConfirmTitle; |
| | | [SerializeField] Button closeBtn; |
| | | protected override void InitComponent() |
| | | { |
| | | base.InitComponent(); |
| | | popConfirmBtn.onClick.AddListener(OnPopConfirmOkBtn); |
| | | popCancelBtn.onClick.AddListener(OnPopConfirmCancelBtn); |
| | | closeBtn.onClick.AddListener(OnPopConfirmCancelExBtn); |
| | | btnClickEmptyCloseEvent = OnPopConfirmCancelExBtn; |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | // 打开遮罩 |
| | | [SerializeField] public bool openMask = false; |
| | | |
| | | // 点击空白区域关闭界面 |
| | | // 默认点击空白区域关闭界面 |
| | | [SerializeField] public bool clickEmptySpaceClose = false; |
| | | |
| | | private GameObject screenMask = null; |
| | | |
| | | private Button btnClickEmptyClose; |
| | | public Action btnClickEmptyCloseEvent = null; //提供点击空白区域关闭界面的回调 |
| | | |
| | | // 跟OneLevelWin联动 实际上是需要继承自OneLevelWin才能生效的值 使用需要注意 |
| | | int m_FunctionOrder = 0; |
| | |
| | | //延迟创建会导致层级在ScreenMask之上 |
| | | GameObject goBtnESC = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/ClickEmptyCloseMask"), transform); |
| | | btnClickEmptyClose = goBtnESC.GetComponent<Button>(); |
| | | btnClickEmptyClose.AddListener(CloseWindow); |
| | | btnClickEmptyClose.transform.SetAsFirstSibling(); |
| | | await UniTask.DelayFrame(5); |
| | | |
| | | btnClickEmptyClose = goBtnESC.GetComponent<Button>(); |
| | | btnClickEmptyClose.AddListener(CloseWindow); |
| | | btnClickEmptyClose.AddListener(()=> |
| | | { |
| | | if (btnClickEmptyCloseEvent != null) |
| | | { |
| | | btnClickEmptyCloseEvent(); |
| | | } |
| | | else |
| | | { |
| | | CloseWindow(); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | //品质文字描边颜色 |
| | | public enum QualityTextColType |
| | | { |
| | | None = -1, |
| | | itemcucao = 0, //粗糙 |
| | | itemputong = 1, //普通 |
| | | itemjingliang = 2, //精良 |
| | | itemxiyou = 3, //稀有 |
| | | itemshishi = 4, //史诗 |
| | | itemchuanqi = 5, //传奇 |
| | | itemshenhua = 6, //神话 |
| | | itemwuxia = 7, //无暇 |
| | | itemanjin = 8, //暗金 |
| | | itemjueyi = 9, //绝艺 |
| | | itemyuanzu = 10, //元祖 |
| | | itembuxiu = 11, //不朽 |
| | | itemyonghen = 12, //永恒 |
| | | } |
| | | |
| | | public enum TextColType |
| | | { |
| | |
| | | /// (204, 204, 204, 255) |
| | | /// </summary> |
| | | Gray = 16, |
| | | //物品品质颜色 |
| | | itemjingliang = 17, //精良 |
| | | itemxiyou = 18, //稀有 |
| | | itemshishi = 19, //史诗 |
| | | itemchuanqi = 20, //传奇 |
| | | itemshenhua = 21, //神话 |
| | | itemwuxia = 22, //无暇 |
| | | itemanjin = 23, //暗金 |
| | | itemjueyi = 24, //绝艺 |
| | | itemyuanzu = 25, //元祖 |
| | | itembuxiu = 26, //不朽 |
| | | itemyonghen = 27, //永恒 |
| | | |
| | | } |
| | | |
| | | |
| | | public enum E_ModelResType |
| | | { |
| | |
| | | public static readonly Color s_DarkPurpleColor = new Color32(236, 75, 246, 255); |
| | | public static readonly Color s_DarkBlueColor = new Color32(49, 206, 251, 255);//31cefb |
| | | public static readonly Color s_DarkOrangeColor = new Color32(248, 152, 59, 255); |
| | | public static readonly Color s_DarkWhiteColor = new Color32(247, 247, 247, 255); |
| | | public static readonly Color s_DarkWhiteColor = new Color32(255, 255, 255, 255); //ffffff |
| | | public static readonly Color s_DarkGreenColor = new Color32(42, 227, 55, 255);//2ae337 |
| | | |
| | | public static readonly Color s_NavyBrown = new Color32(110, 76, 49, 255);//6e4c31 |
| | |
| | | public static readonly Color s_NavyYellow = new Color32(255, 239, 71, 255); |
| | | public static readonly Color s_LightGreen = new Color32(42, 227, 55, 255);//2ae337 |
| | | public static readonly Color s_LightWhite = new Color32(245, 246, 230, 255); //f5f6e6 |
| | | public static readonly Color s_Gray = new Color32(204, 204, 204, 255); |
| | | public static readonly Color s_Gray = new Color32(187, 187, 187, 255); //bbbbbb |
| | | public static readonly Color s_Gold = new Color32(255, 239, 71, 255);//ffef47 |
| | | public static readonly Color s_EarthYellow = new Color32(248, 152, 59, 255);//f8983b |
| | | |
| | |
| | | switch (itemColor) |
| | | { |
| | | case 0: |
| | | return GetUIColor(TextColType.White, bright); |
| | | return GetUIColor(TextColType.Gray, bright); |
| | | case 1: |
| | | return GetUIColor(TextColType.White, bright); |
| | | case 2: |
| | | return GetUIColor(TextColType.Blue, bright); |
| | | return GetUIColor(TextColType.itemjingliang, bright); |
| | | case 3: |
| | | return GetUIColor(TextColType.Purple, bright); |
| | | return GetUIColor(TextColType.itemxiyou, bright); |
| | | case 4: |
| | | return GetUIColor(TextColType.Orange, bright); |
| | | return GetUIColor(TextColType.itemshishi, bright); |
| | | case 5: |
| | | return GetUIColor(TextColType.Red, bright); |
| | | return GetUIColor(TextColType.itemchuanqi, bright); |
| | | case 6: |
| | | return GetUIColor(TextColType.itemshenhua, bright); |
| | | case 7: |
| | | return GetUIColor(TextColType.itemwuxia, bright); |
| | | case 8: |
| | | return GetUIColor(TextColType.Pink, bright); |
| | | return GetUIColor(TextColType.itemanjin, bright); |
| | | case 9: |
| | | return GetUIColor(TextColType.Green, bright); |
| | | return GetUIColor(TextColType.itemjueyi, bright); |
| | | case 10: |
| | | return GetUIColor(TextColType.itemyuanzu, bright); |
| | | case 11: |
| | | return GetUIColor(TextColType.itembuxiu, bright); |
| | | case 12: |
| | | return GetUIColor(TextColType.itemyonghen, bright); |
| | | |
| | | |
| | | } |
| | | return GetUIColor(TextColType.White, bright); |
| | | } |
| | |
| | | return s_LightWhite; |
| | | case TextColType.Gray: |
| | | return s_Gray; |
| | | case TextColType.itemjingliang: |
| | | // 729de4 精良 |
| | | return new Color32(114, 157, 228, 255); |
| | | case TextColType.itemxiyou: |
| | | // c87bfa稀有 |
| | | return new Color32(199, 123, 253, 255); |
| | | case TextColType.itemshishi: |
| | | // f6de56 史诗 |
| | | return new Color32(246, 222, 86, 255); |
| | | case TextColType.itemchuanqi: |
| | | // fe8534 传奇 |
| | | return new Color32(254, 133, 52, 255); |
| | | case TextColType.itemshenhua: |
| | | // fe4a47 神话 |
| | | return new Color32(254, 66, 71, 255); |
| | | case TextColType.itemwuxia: |
| | | // eb5ce9 无瑕 |
| | | return new Color32(235, 90, 233, 255); |
| | | case TextColType.itemanjin: |
| | | // f9e29f 暗金 |
| | | return new Color32(254, 181, 68, 255); |
| | | case TextColType.itemjueyi: |
| | | // cdfef2 绝艺 |
| | | return new Color32(205, 239, 242, 255); |
| | | case TextColType.itemyuanzu: |
| | | // dfbbed 元祖 |
| | | return new Color32(223, 187, 237, 255); |
| | | case TextColType.itembuxiu: |
| | | // 5eeff2 不朽 |
| | | return new Color32(94, 239, 242, 255); |
| | | case TextColType.itemyonghen: |
| | | // f5b4ea 永恒 |
| | | return new Color32(245, 180, 234, 255); |
| | | } |
| | | return bright ? s_BrightWhiteColor : s_DarkWhiteColor; |
| | | } |
| | | |
| | | |
| | | //描边颜色,对应品质 |
| | | public static Color GetUIOutlineColor(QualityTextColType type) |
| | | { |
| | | switch (type) |
| | | { |
| | | case QualityTextColType.itemcucao: |
| | | // 2d2d2d 粗糙 |
| | | return new Color32(45, 45, 45, 255); |
| | | case QualityTextColType.itemputong: |
| | | // 424242 普通 |
| | | return new Color32(66, 66, 66, 255); |
| | | case QualityTextColType.itemjingliang: |
| | | // 172543 精良 |
| | | return new Color32(23, 37, 67, 255); |
| | | case QualityTextColType.itemxiyou: |
| | | // 2a0f30 稀有 |
| | | return new Color32(42, 15, 48, 255); |
| | | case QualityTextColType.itemshishi: |
| | | // 4a2f00 史诗 |
| | | return new Color32(74, 47, 0, 255); |
| | | case QualityTextColType.itemchuanqi: |
| | | // 451800 传奇 |
| | | return new Color32(69, 24, 0, 255); |
| | | case QualityTextColType.itemshenhua: |
| | | // 510000 神话 |
| | | return new Color32(81, 0, 0, 255); |
| | | case QualityTextColType.itemwuxia: |
| | | // 43003e 无瑕 |
| | | return new Color32(67, 0, 62, 255); |
| | | case QualityTextColType.itemanjin: |
| | | // 6f4401 暗金 |
| | | return new Color32(111, 68, 1, 255); |
| | | case QualityTextColType.itemjueyi: |
| | | // 203995 绝艺 |
| | | return new Color32(32, 57, 149, 255); |
| | | case QualityTextColType.itemyuanzu: |
| | | // 461f5d 元祖 |
| | | return new Color32(70, 31, 93, 255); |
| | | case QualityTextColType.itembuxiu: |
| | | // 2e3975 不朽 |
| | | return new Color32(46, 57, 117, 255); |
| | | case QualityTextColType.itemyonghen: |
| | | // 5d1d52 永恒 |
| | | return new Color32(93, 29, 82, 255); |
| | | } |
| | | return new Color32(0, 0, 0, 255); |
| | | } |
| | | |
| | | private static Regex m_TextColorRegex = new Regex("<color=#[0-9a-zA-Z]+>(.*)</color>", RegexOptions.Singleline); |
| | |
| | | return msg; |
| | | } |
| | | |
| | | // public static int GetItemColor(int _id, Dictionary<int, List<int>> _dict = null) |
| | | // { |
| | | // int _itemColor = 0; |
| | | // var _itemCfg = ItemConfig.Get(_id); |
| | | // if (_itemCfg != null) |
| | | // { |
| | | // _itemColor = _itemCfg.ItemColor; |
| | | // if (_itemCfg.Type == 113 && _dict != null) |
| | | // { |
| | | // _itemColor = ItemLogicUtility.Instance.GetItemQuality(_itemCfg.ID, _dict); |
| | | // } |
| | | // } |
| | | // return _itemColor; |
| | | // } |
| | | |
| | | |
| | | public static Color GetPropertyColor(int property) |
| | | { |