I have a class Array2DBool. I am trying to change it's values on initialisation. I've tried different approaches but making a constructor for it seems to be the best one so far. Tried testing different parameters: strings, bools and ints. But all leads to the same result - when instantiating I always get "Here" in console and the second constructor just never gets invoked.
namespace Array2DEditor
{
[System.Serializable]
public class Array2DBool : Array2D<bool>
{
public Array2DBool () {
Debug.Log("Here");
}
public Array2DBool (int gridSizeInt) {
Debug.Log("Finally Here");
GridSize = Vector2Int.one * gridSizeInt;
}
}
}
// This line is used in another file.
public Array2DBool exits = new Array2DBool(3);
Also, Array2D is an abstract class but it does not have any constructors. So I believe it does no matter since whatever happens there will not affect the constructors here.