12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System.Diagnostics;
- using Common.Utility.CombatTimer;
- using Fort23.Core;
- using Fort23.UTool;
- using GameLogic.Combat.CombatTool;
- using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
- using UnityEngine;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "ShowTextWidget")]
- public partial class ShowTextWidget : UIComponent
- {
- private void Init()
- {
- }
- public override void AddEvent()
- {
- }
- public override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- }
- public void ShowUI(CombatHeroEntity heroEntity, long att, HarmType harmType, bool isHarm)
- {
- Vector3 worldPos = heroEntity.combatHeroGameObject.hpTransform.position;
- Vector3 p = UIManager.Instance.CurrCustomCameraStack.camera.WorldToScreenPoint(worldPos);
- Vector3 p2 = UIManager.Instance.UICamera.ScreenToWorldPoint(p);
- transform.position = p2;
- string playName = "show";
- if (harmType.HasFlag(HarmType.Shields))
- {
- text.color = Color.cyan;
- }
- else if (harmType.HasFlag(HarmType.Buff))
- {
- playName = "buffshow";
- text.color = Color.white;
- }
- else if (harmType.HasFlag(HarmType.Recover))
- {
- text.color = Color.green;
- }
- else if (harmType.HasFlag(HarmType.Default))
- {
- text.color = Color.red;
- }
- // if (isHarm)
- // {
- // text.color=heroEntity.IsEnemy?Color.white:Color.red;
- // }
- // else
- // {
- // text.color=Color.green;
- // }
- text.text = att.ToString();
- anim.Play(playName, false);
- // if (Animator != null)
- // {
- // if (harmType.HasFlag(HarmType.BaoJi))
- // {
- // Animator.Play("ShowTextWidgetBaoji");
- // }
- // else
- // {
- // Animator.Play("ShowTextWidgetShow");
- // }
- // }
- CombatTimerManager.Instance.AddTimer(1, delegate { GObjectPool.Instance.Recycle(this); });
- }
- }
- }
|