123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using Common.Utility.CombatTimer;
- using Fort23.Core;
- using Fort23.UTool;
- using GameLogic.Combat.CombatTool;
- 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;
- if (isHarm)
- {
- text.color=heroEntity.IsEnemy?Color.white:Color.red;
- }
- else
- {
- text.color=Color.green;
- }
- text.text = att.ToString();
- anim.Play("show",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);
- });
- }
- }
- }
|