Closed jellewie closed 5 years ago
if (this.gameObject.GetComponent<BuildingOption>().BuildingName == "Stone_Gate") //If this is a stone gate
{
for (int i = 0; i < Hits.Length; i++) //For each item hit
{
string Name = Hits[i].GetComponent<BuildingOption>().BuildingName; //Get there building name
if (Name == "Stone_Wall" || Name == "Stone_Wall_Spiked" || Name == "Wooden_Wall" || Name == "Wooden_Wall_Spiked")
ObjectsHitAmount--; //Remove one from the Amount ObjectsHit list (This entry should be ignored)
}
}
Debug.Log(ObjectsHitAmount);
return ObjectsHitAmount > 0; //Return true if there's at least 1 collider.
When a Stone||Wooden Gate||Tower is placed a wall should not be seen as an obstruction.
The wall (or spiked wall) should be removed upon placement of a gate. This would make the user able to place a wall, and then place gates and tower over the wall