Exemplo n.º 1
0
        private void Awake()
        {
            instance = this;

            GameEvents.onVesselChange.Add(OnVesselChange);
            GameEvents.onVesselGoOnRails.Add(OnVesselGoOnRails);
            GameEvents.onVesselGoOffRails.Add(OnVesselGoOffRails);
            GameEvents.onVesselCreate.Add(OnVesselCreate);
            GameEvents.onVesselWillDestroy.Add(OnVesselWillDestroy);
            GameEvents.onGameStateSave.Add(OnGameStateSave);
        }
Exemplo n.º 2
0
 private void OnDestroy()
 {
     instance = null;
     //Unbind functions from GameEvents
     GameEvents.onVesselChange.Remove(OnVesselChange);
     GameEvents.onVesselGoOnRails.Remove(OnVesselGoOnRails);
     GameEvents.onVesselGoOffRails.Remove(OnVesselGoOffRails);
     GameEvents.onVesselCreate.Remove(OnVesselCreate);
     GameEvents.onVesselWillDestroy.Remove(OnVesselWillDestroy);
     GameEvents.onGameStateSave.Remove(OnGameStateSave);
 }