public void OnObjectSpawned(GameObject obj)
    {
        MoveToGridObject move = obj.GetComponent <MoveToGridObject>();

        if (move == null)
        {
            return;
        }

        move.Target = Target;
    }
Ejemplo n.º 2
0
    public bool IsValidTarget(HealthComponent other)
    {
        if (other == null || other.Side == this.Side)
        {
            return(false);
        }

        bool bAttack = true;

        MoveToGridObject move = GetComponent <MoveToGridObject>();

        if (move != null && move.Target != null)
        {
            // check if we have reached the thing we are attacking
            //bAttack = move.Target.gameObject == other.gameObject;
        }

        return(bAttack);
    }