I’ve been digging around and have found many similar but not exactly matching results to this question, all of which have made this infinitely more confusing. Below is example mock-up code of what we’re trying to do here. Please read the bottom paragraph for an explanation. Thank you!
Base.cs
using UnityEngine;
using System.Collections;
public class Base : MonoBehaviour {
public GameObject Chase;
void Update () {
Chase = GameObject.Find("Chase"); // Never GO.Find on Update, this is just a mock-up.
}
}
Race.cs
using UnityEngine;
using System.Collections;
public class Race : Base {
void Update () {
Debug.Log(Chase);
}
}
With that in-mind, is it possible to get the instance of a variable that we’re inheriting from? The idea here is having a ‘base’ class that houses a couple variables that will be used across all scripts within the project. These variables are assigned during run-time, so we need to grab the Instance of them. However at this point, I am no longer sure if this is something inheritance will support. Statics don’t seem like the way to go, and namespaces/interfaces are just as useless in this case scenario.