Exemplo n.º 1
0
    public override void PreCast()
    {
        GChess chess = GridManager.instance.GetChess(owner.location + direction);

        if (chess != null)
        {
            chess.FreezeFoot();
            UnityAction a; UnityAction <Element> b;
            a = () =>
            {
                chess.DeactiveFreezeFoot();
            };
            b = (element) =>
            {
                if (element == Element.Fire)
                {
                    chess.DeactiveFreezeFoot();
                }
                ;
            };
            owner.eBePush.AddListener(a);
            owner.eElementReaction.AddListener(b);
            chess.eFreezeFootBroken.AddListener(() =>
            {
                owner.eBePush.RemoveListener(a);
                owner.eElementReaction.RemoveListener(b);
            });
        }
    }