Hi everyone,
I’d like to have a public class with a struct List goProps contains info about a lot different game objects.
public class GOInfoProps
{
public struct GoProp
{
public double percent;
public Transform TrackSideGO;
public ushort evtType;
public short evtOP1;
public short evtOP2;
public short evtOP3;
public string evtName;
}
// predefine for 1000 Go's
public List<GoProp> goProps= new List<GoProp>(1000);
}
Game object should sign to the List goProps and add its values.
public class GO : MonoBehaviour {
private EventSamples.GoProp goProp = new EventSamples.GoProp;
private EventSamples.goProps probList = new EventSamples.goProps;
void Start(){
goProp.percent = 0.6;
probList.add(goProp);
}
}
}
In the end I want access List from anywhere for statistic purposes in real time.
But declaring:
private EventSamples.GoProp goProp = new EventSamples.GoProp;
private EventSamples.goProps probList = new EventSamples.goProps;
this way does not work.
How do I get a reference to goProps in the game object GO or from anywhere?