Exemplo n.º 1
0
    protected override IEnumerator Run(MainSystem sys)
    {
        sys.Msg_UseItem(_item);

        CharacterBase hitTarget;
        Loc           to = sys.FindHitTarget(_player.Loc, _player.Dir, out hitTarget);

        // 魔法弾を飛ばす
        var obj  = Resources.Load("Prefabs/Effect/magic-ball");
        var gobj = (GameObject)GameObject.Instantiate(obj);

        yield return(CAction.Move(gobj, _player.Loc, to));

        GameObject.Destroy(gobj);

        if (hitTarget == null)
        {
            yield return(_item.Hit(_player, to, sys));
        }
        else
        {
            yield return(_item.Hit(_player, hitTarget, sys));
        }
    }
Exemplo n.º 2
0
 protected override IEnumerator Run(MainSystem sys)
 {
     sys.Msg_UseItem(_item);
     yield return(_item.Use(Actor, sys));
 }