Hello,
If I have the following interface :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public interface INodeDistributable {
bool Filled{get; set;}
}
And a child class that implement it like this
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class NodeTile : NodeBase , INodeDistributable {
public bool filled;
public bool Filled
{
get
{
return filled;
}
set
{
filled = value;
}
}
}
How do I access the base class fields Line 13 Below in a generic method
public T[,] DrawFillT<T>( T[,] gridIn ) where T : INodeDistributable{
//
// Draw world rectangle
Gizmos.DrawWireCube (transform.position, new Vector3 (gridWorldSize.x, 1, gridWorldSize.y));
// Draw Q in rectangle
if (gridIn != null && displayGridGizmos) {
foreach (T n in gridIn) {
Gizmos.color = (n.Filled== true)?Color.black:Color.white;
Debug.Log (n.Filled);
Gizmos.DrawCube(n. nodeAttrBase.worldPosition, Vector3.one * (nodeDiameter)); ??????????
}
}
// Return
return gridIn;
}
Thanks in advance for the help