コード例 #1
0
ファイル: Main.cs プロジェクト: ihsoft/PersistentRotation
        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);
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: ihsoft/PersistentRotation
 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);
 }