Beispiel #1
0
        public override int Attack(IActor defender, int value)
        {
            OnPlayerAttackEventArgs args = ReferencePool.Acquire <OnPlayerAttackEventArgs>().Fill(defender);

            GameEntry.Event.Fire(this, args);
            return(base.Attack(defender, value));
        }
Beispiel #2
0
        private void OnPlayerAttack(object sender, GameEventArgs e)
        {
            OnPlayerAttackEventArgs ne = e as OnPlayerAttackEventArgs;

            if (ne == null)
            {
                return;
            }

            Vector3 wordPos   = ne.Target.CachedTransform.position + new Vector3(0, ne.Target.Height, 0);
            Vector2 screenPos = GameEntry.Camera.MainCamera.WorldToScreenPoint(wordPos);

            screenPos.y = Screen.height - screenPos.y;
            Vector2 pt = GRoot.inst.GlobalToLocal(screenPos);

            UI.SetXY(pt.x - 100, pt.y);

            Refresh();
            m_Timer = 0;
        }