private static void Prefix(PlayerMove_Fly __instance) { if (autoNav.enable) { if (__instance.player.movementState != EMovementState.Fly) { return; } if (autoNav.DetermineArrive()) { ModDebug.Log("FlyModeArrive"); autoNav.Arrive(); } else if ( __instance.mecha.thrusterLevel < 2) { autoNav.Arrive("驱动引擎等级过低".ModText()); } else if (__instance.player.mecha.coreEnergy < minAutoNavEnergy.Value) { autoNav.Arrive("机甲能量过低".ModText()); } else { ++__instance.controller.input1.y; if (__instance.currentAltitude > sailMinAltitude) { AutoStellarNavigation.Fly.TrySwtichToSail(__instance); } } } }
public static bool TrySwtichToSail(PlayerMove_Fly __instance) { #if DEBUG ModDebug.Log("Try Swtich To Sail"); #endif if (__instance.mecha.thrusterLevel < THRUSTER_LEVEL_SAIL) { return(false); } //取消建造模式 if (__instance.controller.cmd.type == ECommand.Build) { __instance.controller.cmd.type = ECommand.None; } __instance.controller.movementStateInFrame = EMovementState.Sail; __instance.controller.actionSail.ResetSailState(); GameCamera.instance.SyncForSailMode(); GameMain.gameScenario.NotifyOnSailModeEnter(); return(true); }