Example #1
0
    public void EndIncantation(string[] res)
    {
        int     x;
        int     y;
        int     success;
        Vector2 pos;

        if (res.Length != 4)
        {
            return;
        }
        x       = int.Parse(res[1]);
        y       = int.Parse(res[2]);
        success = int.Parse(res[3]);
        pos     = new Vector2(x, y);
        Incantation incantation = spawnManager.incantationList.Find(incant => incant.getGridPos() == pos);

        if (incantation != null)
        {
            incantation.StopIncantation(success == 1);
            spawnManager.incantationList.Remove(incantation);
            StartCoroutine(DelayDestroy(incantation.gameObject, 2f));
        }
    }