Example #1
0
    public bool KillObjectByAlias(string alias)
    {
        PoolSlot slot = mObjPool.UsedList();

        while (slot != null)
        {
            ObjectBase obj = slot.Content as ObjectBase;
            if (obj == null)
            {
                slot = slot.NextSlot;
                continue;
            }

            if (!string.Equals(obj.GetAlias(), alias))
            {
                slot = slot.NextSlot;
                continue;
            }

            if (!typeof(BuildObj).IsAssignableFrom(obj.GetType()))
            {
                slot = slot.NextSlot;
                continue;
            }

            BattleUnit unit = obj as BattleUnit;
            unit.Die(new AttackerAttr(unit));

            slot = slot.NextSlot;
        }
        return(true);
    }
Example #2
0
    private bool Kill(ObjectBase obj, ArrayList param)
    {
        if (obj == null || param == null)
        {
            return(false);
        }

        BaseScene scn = SceneManager.Instance.GetCurScene();

        if (scn == null)
        {
            return(false);
        }

        if (param.Count != 0)
        {
            obj = scn.FindObject((uint)System.Convert.ToInt32(param[0]));
        }

        if (obj != null && obj is BattleUnit)
        {
            BattleUnit battleunit = obj as BattleUnit;
            battleunit.Die(new AttackerAttr(battleunit));
            return(true);
        }

        return(false);
    }
Example #3
0
    private bool Kill(ObjectBase obj, respond_msg_gm respond)
    {
        if (respond == null)
        {
            return(false);
        }

        if (obj == null)
        {
            return(false);
        }

        BaseScene scn = SceneManager.Instance.GetCurScene();

        if (scn == null)
        {
            return(false);
        }

        obj = scn.FindObject((uint)System.Convert.ToInt32(respond.param1));

        if (obj != null && obj is BattleUnit)
        {
            BattleUnit battleunit = obj as BattleUnit;
            battleunit.Die(new AttackerAttr(battleunit));
            return(true);
        }

        return(false);
    }