public static bool FindMechCommanderUnity(out MechCommanderUnity mcUnityOut) { mcUnityOut = GameObject.FindObjectOfType(typeof(MechCommanderUnity)) as MechCommanderUnity; if (mcUnityOut == null) { LogMessage("Could not locate MechCommanderUnity GameObject instance in scene!", true); return(false); } return(true); }
private void SetupSingleton() { if (instance == null) { instance = this; } else if (instance != this) { if (Application.isPlaying) { LogMessage("Multiple MechCommanderUnity instances detected!", true); Destroy(gameObject); } } }
private void SetupContentReaders(bool force = false) { if (isPathValidated && _fileManager == null) { _fileManager = new FileManager(MCGPath); } if (reader == null || force) { // Ensure content readers available even when path not valid if (isPathValidated) { //MechCommanderUnity.LogMessage(string.Format("Setting up content readers with MCG path '{0}'.", MCGPath)); reader = new ContentReader(MCGPath, this); } else { MechCommanderUnity.LogMessage(string.Format("Setting up content readers without MCG path. Not all features will be available.")); reader = new ContentReader(string.Empty, this); } } }