private void CancelBarrelRoll() { Selection.ThisShip.IsLandedOnObstacle = false; inReposition = false; MonoBehaviour.Destroy(ShipStand); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); PreviousSubPhase.Resume(); }
protected virtual void FinishMovementEvents() { MovementTemplates.HideLastMovementRuler(); Selection.ThisShip.CallExecuteMoving(); //Called as callbacks //Selection.ThisShip.FinishMovement(); //Selection.ThisShip.FinishPosition(); //Phases.FinishSubPhase(typeof(SubPhases.MovementExecutionSubPhase)); }
protected override void FinishMovement() { //TEMP GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.FuncsToUpdate.Remove(UpdateBoost); MovementTemplates.HideLastMovementRuler(); TheShip.ResetRotationHelpers(); (Phases.CurrentSubPhase as SubPhases.BoostExecutionSubPhase).FinishBoost(); }
protected override void FinishMovement() { //TEMP GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.FuncsToUpdate.Remove(UpdateBoost); MovementTemplates.HideLastMovementRuler(); Selection.ThisShip.ResetRotationHelpers(); Phases.FinishSubPhase(typeof(SubPhases.BoostExecutionSubPhase)); }
public void CancelBoost() { Selection.ThisShip.IsLandedOnObstacle = false; MonoBehaviour.Destroy(ShipStand); GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); PreviousSubPhase.Resume(); }
private void CancelDecloak() { Selection.ThisShip.RemoveAlreadyExecutedAction(typeof(ActionsList.CloakAction)); Selection.ThisShip.IsLandedOnObstacle = false; inReposition = false; MonoBehaviour.Destroy(ShipStand); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); MovementTemplates.CurrentTemplate.gameObject.SetActive(true); PreviousSubPhase.Resume(); }
public void CancelBoost(List <ActionFailReason> boostProblems) { TheShip.IsLandedOnObstacle = false; MonoBehaviour.Destroy(ShipStand); GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); Rules.Actions.ActionIsFailed(TheShip, HostAction, boostProblems); }
public void CancelBoost() { TheShip.IsLandedOnObstacle = false; MonoBehaviour.Destroy(ShipStand); GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); RuleSet.Instance.ActionIsFailed(TheShip, typeof(ActionsList.BoostAction)); }
public void CancelBoost() { TheShip.IsLandedOnObstacle = false; TheShip.RemoveAlreadyExecutedAction(typeof(ActionsList.BoostAction)); MonoBehaviour.Destroy(ShipStand); GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); PreviousSubPhase.Resume(); }
private void CancelBarrelRoll() { Selection.ThisShip.RemoveAlreadyExecutedAction(typeof(ActionsList.BarrelRollAction)); Selection.ThisShip.IsLandedOnObstacle = false; inReposition = false; MonoBehaviour.Destroy(ShipStand); GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); PreviousSubPhase.Resume(); }
protected override void FinishMovement() { //TEMP GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.FuncsToUpdate.Remove(UpdateBoost); MovementTemplates.HideLastMovementRuler(); TheShip.ResetRotationHelpers(); // Important! Fixes final position according to prediction - otherwise animation can cause another final position TheShip.SetPositionInfo(FinalPositionInfo); (Phases.CurrentSubPhase as SubPhases.BoostExecutionSubPhase).FinishBoost(); }
private void FinishBarrelRollAnimation() { performingAnimation = false; MonoBehaviour.Destroy(ShipStand); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); MovementTemplates.CurrentTemplate.gameObject.SetActive(true); Selection.ThisShip.ToggleShipStandAndPeg(true); Selection.ThisShip.FinishPosition(delegate() { }); Phases.FinishSubPhase(typeof(BarrelRollExecutionSubPhase)); callBack(); }
private void FinishBarrelRollAnimation() { performingAnimation = false; MonoBehaviour.Destroy(ShipStand); GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); MovementTemplates.CurrentTemplate.gameObject.SetActive(true); Selection.ThisShip.ToggleShipStandAndPeg(true); Selection.ThisShip.FinishPosition(FinishBarrelRollAnimationPart2); }
public void FinishBarrelRollAnimation() { performingAnimation = false; TheShip.ApplyRotationHelpers(); TheShip.ResetRotationHelpers(); TheShip.SetAngles(TemporaryShipBase.transform.eulerAngles); MonoBehaviour.DestroyImmediate(TemporaryShipBase); GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); TheShip.ToggleShipStandAndPeg(true); TheShip.FinishPosition(FinishBarrelRollAnimationPart2); }
public override GameObject[] PlanFinalPosition() { //Temporary MovementTemplates.ApplyMovementRuler(TheShip); GameObject[] result = new GameObject[1]; float distance = ProgressTarget; Vector3 position = TheShip.GetPosition(); GameObject prefab = (GameObject)Resources.Load(TheShip.ShipBase.TemporaryPrefabPath, typeof(GameObject)); GameObject ShipStand = MonoBehaviour.Instantiate(prefab, position, TheShip.GetRotation(), BoardTools.Board.GetBoard()); Renderer[] renderers = ShipStand.GetComponentsInChildren <Renderer>(); if (!DebugManager.DebugMovementShowTempBases) { foreach (var render in renderers) { render.enabled = false; } } float turningDirection = (Direction == ManeuverDirection.Right) ? 1 : -1; ShipStand.transform.RotateAround(TheShip.TransformPoint(new Vector3(turningAroundDistance * turningDirection, 0, 0)), new Vector3(0, 1, 0), turningDirection * distance); UpdatePlanningRotation(ShipStand); position = ShipStand.transform.position; distance = TheShip.ShipBase.GetShipBaseDistance(); ShipStand.transform.position = Vector3.MoveTowards(position, position + ShipStand.transform.TransformDirection(Vector3.forward), distance); UpdatePlanningRotationFinisher(ShipStand); result[0] = ShipStand; ShipStand.name = "Finishing"; MovementTemplates.HideLastMovementRuler(); return(result); }
public void FinishDecloakAnimation() { performingAnimation = false; TheShip.ApplyRotationHelpers(); TheShip.ResetRotationHelpers(); TheShip.SetAngles(TemporaryShipBase.transform.eulerAngles); TheShip.Model.transform.localPosition = new Vector3(TheShip.Model.transform.localPosition.x, 0, TheShip.Model.transform.localPosition.z); MonoBehaviour.Destroy(TemporaryShipBase); GameManagerScript Game = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Game.Movement.CollidedWith = null; MovementTemplates.HideLastMovementRuler(); MovementTemplates.CurrentTemplate.gameObject.SetActive(true); Selection.ThisShip.ToggleShipStandAndPeg(true); Selection.ThisShip.FinishPosition(FinishDecloakAnimationPart2); }
// PLANNING public override GameObject[] PlanMovement() { //Temporary MovementTemplates.ApplyMovementRuler(Selection.ThisShip); GameObject[] result = new GameObject[101]; float distancePart = ProgressTarget / 80; Vector3 position = Selection.ThisShip.GetPosition(); GameObject lastShipStand = null; for (int i = 0; i <= 80; i++) { float step = (float)i * distancePart; GameObject prefab = (GameObject)Resources.Load(Selection.ThisShip.ShipBase.TemporaryPrefabPath, typeof(GameObject)); GameObject ShipStand = MonoBehaviour.Instantiate(prefab, position, Selection.ThisShip.GetRotation(), Board.BoardManager.GetBoard()); Renderer[] renderers = ShipStand.GetComponentsInChildren <Renderer>(); if (!DebugManager.DebugMovement) { foreach (var render in renderers) { render.enabled = false; } } if (i > 0) { float turningDirection = (Direction == ManeuverDirection.Right) ? 1 : -1; ShipStand.transform.RotateAround(Selection.ThisShip.TransformPoint(new Vector3(turningAroundDistance * turningDirection, 0, 0)), new Vector3(0, 1, 0), turningDirection * step); UpdatePlanningRotation(ShipStand); if (i == 80) { lastShipStand = ShipStand; } } result[i] = ShipStand; ShipStand.name = "Main" + i; } GameObject savedShipStand = MonoBehaviour.Instantiate(lastShipStand); savedShipStand.transform.localEulerAngles -= new Vector3(0f, lastPlanningRotation, 0f); position = lastShipStand.transform.position; distancePart = Selection.ThisShip.ShipBase.GetShipBaseDistance() / 20; for (int i = 1; i <= 20; i++) { position = Vector3.MoveTowards(position, position + savedShipStand.transform.TransformDirection(Vector3.forward), distancePart); GameObject prefab = (GameObject)Resources.Load(Selection.ThisShip.ShipBase.TemporaryPrefabPath, typeof(GameObject)); GameObject ShipStand = MonoBehaviour.Instantiate(prefab, position, savedShipStand.transform.rotation, Board.BoardManager.GetBoard()); Renderer[] renderers = ShipStand.GetComponentsInChildren <Renderer>(); if (!DebugManager.DebugMovement) { foreach (var render in renderers) { render.enabled = false; } } UpdatePlanningRotationFinisher(ShipStand); result[i + 80] = ShipStand; ShipStand.name = "Finishing" + i; } MonoBehaviour.Destroy(savedShipStand); MovementTemplates.HideLastMovementRuler(); return(result); }
private void FinishManeuverExecution() { MovementTemplates.HideLastMovementRuler(); GameMode.CurrentGameMode.FinishMovementExecution(); }
private void FinishManeuverExecution() { MovementTemplates.HideLastMovementRuler(); Selection.ActiveShip.CallExecuteMoving(Triggers.FinishTrigger); }
private static void Finish() { GameObject.Destroy(FakeShip); MovementTemplates.HideLastMovementRuler(); GenericSubPhase.HideSubphaseDescription(); }
private void FinishManeuverExecution() { MovementTemplates.HideLastMovementRuler(); Selection.ActiveShip.CallExecuteMoving(GameMode.CurrentGameMode.FinishMovementExecution); }