Example #1
0
    public void UnRegister(XBoxComponent hero)
    {
        if (hero == null)
        {
            GLog.Log("UNREGISTER a null hero??");
            return;
        }

        if (_heroes.Contains(hero))
        {
            _heroes.Remove(hero);
        }
        else
        {
            GLog.Log("UNREGISTER a ghost hero?? {0}", hero.gameObject.name);
        }

        if (_bloodyHeroes != null)
        {
            XBoxBloody bloodyHero = _bloodyHeroes.Find(delegate(XBoxBloody obj) {
                return(obj.AttackHero == hero);
            });
            GLog.Log("Unregister bloodyHeroes {0}", _bloodyHeroes.Count);
            if (bloodyHero != null)
            {
                _bloodyHeroes.Remove(bloodyHero);
            }
        }
    }
Example #2
0
    private void AddBloodyHeroes(XBoxComponent attack, int receiveId, XBoxRect overlap)
    {
        XBoxBloody hero = _bloodyHeroes.Find(delegate(XBoxBloody obj)
        {
            return(obj.AttackHero == attack);
        });

        if (hero == null)
        {
            hero = new XBoxBloody(attack);
            _bloodyHeroes.Add(hero);
        }
        hero.AddBloodyHero(receiveId, overlap);
    }