Ejemplo n.º 1
0
    //helper method for SpreadFire() and GetFireSpreadPositions()
    private List <Vector2Int> SpreadFireHelper()
    {
        GameObject[]      allItemsOnMap = TimeManagerScript.instance.allItemsOnGrid;
        List <Vector2Int> toFire        = new List <Vector2Int>();

        for (int i = 0; i < allItemsOnMap.Length; i++)
        {
            ItemScript scr = allItemsOnMap[i].GetComponent <ItemScript>();
            if (scr.isOnFire)
            {
                toFire.AddRange(scr.GetSurroundingFireSpace(GlobalStuff.gridSize, GlobalStuff.gridSize));
            }
        }
        return(toFire);
    }