private void OpenGate(GateSide G) { switch (G) { case GateSide.Entrance: EntranceGateOpened = true; break; case GateSide.Exit: ExitGateOpened = true; break; } }
/// <summary> /// Pick the correct gate from the current sequence for a given target direction and current position. /// </summary> /// <param name="mySide">indicates which side of a death gate devide the player is currently, DeepSide is towards 0,0/exit; ShallowSide is towards the world entrance</param> /// <param name="targetDepth">indicates which direction the destination is in, Deeper is towards 0,0/exit; Shallower is towards the world entrance</param> /// <param name="bestGatePosition">the position of the gate that is required to reach the destination</param> /// <returns></returns> public static bool TrySelectGate(GateSide mySide, SceneDepth targetDepth, out Vector3 bestGatePosition) { Core.Logger.Debug($"TrySelectGate MyCurrentSide={mySide} TargetDepth={targetDepth}"); if (mySide == GateSide.DeepSide) { switch (targetDepth) { case SceneDepth.Deeper: bestGatePosition = NextGateScene.ShallowPortalPosition; return(true); case SceneDepth.Same: bestGatePosition = CurrentGateScene.DeepPortalPosition; return(true); case SceneDepth.Shallower: bestGatePosition = CurrentGateScene.DeepPortalPosition; return(true); case SceneDepth.NotFound: bestGatePosition = CurrentGateScene.DeepPortalPosition; return(true); } } if (mySide == GateSide.ShallowSide) { switch (targetDepth) { case SceneDepth.Deeper: bestGatePosition = CurrentGateScene.ShallowPortalPosition; return(true); case SceneDepth.Same: bestGatePosition = CurrentGateScene.ShallowPortalPosition; return(true); case SceneDepth.Shallower: bestGatePosition = PreviousGateScene.DeepPortalPosition; return(true); case SceneDepth.NotFound: bestGatePosition = CurrentGateScene.ShallowPortalPosition; return(true); } } bestGatePosition = Vector3.Zero; return(false); }
private void CloseGate(GateSide G) { switch (G) { case GateSide.Entrance: EntranceGateOpened = false; tm1.Start(); break; case GateSide.Exit: ExitGateOpened = false; tm2.Start(); break; } }
public static bool TryCurrentSidePortalPosition(GateSide mySide, out Vector3 bestGatePosition) { switch (mySide) { case GateSide.DeepSide: bestGatePosition = CurrentGateScene.DeepPortalPosition; return(true); case GateSide.ShallowSide: bestGatePosition = CurrentGateScene.ShallowPortalPosition; return(true); } bestGatePosition = Vector3.Zero; return(false); }
private void GateTypeCombo_SelectedIndexChanged(object sender, EventArgs e) { try { if (GateTypeCombo.SelectedItem.Equals(GateSide.Entrance.ToString())) { StartEntranceOperations(); CurrentGate = GateSide.Entrance; } else { StartExitOperations(); CurrentGate = GateSide.Exit; } } catch { } }