void OnLevelWasLoaded(int i) { if (!ShipToUse && SceneManager.GetActiveScene().name.Equals("GalaxyMap")) { ShipSceneVisability ssv = ShipInformation.GetComponent <ShipSceneVisability>(); if (!ssv) { Debug.Log("Missing ssv"); return; } GameObject loadShip = Resources.Load(ssv.GetSpacePath()) as GameObject; if (!loadShip) { Debug.Log("Error with spacepath"); return; } EquipedDevices equipDev = loadShip.GetComponent <EquipedDevices>(); if (!equipDev) { Debug.Log("Did not find equipedDevices on " + loadShip.name); return; } weaponPaths = equipDev.GetPaths('w'); shieldPaths = equipDev.GetPaths('s'); enginePaths = equipDev.GetPaths('e'); ShipToUse = loadShip; } }
void Start() { if (!GalaxyContainer || !PlayerPrefabs) { Debug.Log("Missing MasterController settings, please insert"); return; } ssv = GetComponentInChildren <ShipSceneVisability>(); ControllScenes(); }
public void ChangeShipLoadOut() { GameObject go = GameObject.Find("MasterObject"); if (go) { ShipSceneVisability ssv = go.GetComponentInChildren <ShipSceneVisability>(); if (ssv) { } else { Debug.Log("Could not find ship scene visability on " + go.name); } } else { Debug.Log("could not find master object in scene"); } }