Beispiel #1
0
    public override bool Cast(ISpellParams parameters)
    {
        SpellTargetParams targetParams = (SpellTargetParams)parameters;

        Transform t = Instantiate(gameObject).transform;

        t.GetComponent <SpellAttach>().target = targetParams.destination;

        if (immobilizeEnemy)
        {
            IEnemy enemy = targetParams.destination.GetComponent <IEnemy>();
            if (enemy != null)
            {
                enemy.AddImmobilizedAgent(t);
            }
        }

        return(true);
    }