// Use this for initialization void Awake() { if(instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
// Use this for initialization void Start() { missionLoader = GameObject.FindObjectOfType<MissionLoader>(); //missionLoader = GameObject.Find("MissionLoadoutDataKeeper").GetComponent<MissionLoader>(); missionLoadoutDataKeeper = MissionLoadoutDataKeeper.instance; planeDisplayControl = GameObject.Find("PlaneDisplayControl").GetComponent<PlaneDisplayControl>(); PlaneSelectionUI.OnPlaneSelectionComplete += delegate(int id) { if(id != -1){ missionLoadoutDataKeeper.AddPlaneToMissionLoadout(id); ChangePlaneEntry(planeDisplayControl.planesArray.Find(delegate(GameObject obj) { return id == obj.GetComponent<AircraftCore>().aircraftId; })); } }; }