コード例 #1
0
ファイル: BarrelRollAction.cs プロジェクト: keldren/FlyCasual
        private void CancelBarrelRoll()
        {
            Selection.ThisShip.IsLandedOnObstacle = false;
            inReposition = false;
            MonoBehaviour.Destroy(ShipStand);
            Game.Movement.CollidedWith = null;
            MovementTemplates.HideLastMovementRuler();

            PreviousSubPhase.Resume();
        }
コード例 #2
0
ファイル: GenericMovement.cs プロジェクト: Conzar/FlyCasual
        protected virtual void FinishMovementEvents()
        {
            MovementTemplates.HideLastMovementRuler();

            Selection.ThisShip.CallExecuteMoving();

            //Called as callbacks
            //Selection.ThisShip.FinishMovement();
            //Selection.ThisShip.FinishPosition();
            //Phases.FinishSubPhase(typeof(SubPhases.MovementExecutionSubPhase));
        }
コード例 #3
0
ファイル: BankBoost.cs プロジェクト: stwangner/FlyCasual
        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();
        }
コード例 #4
0
        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));
        }
コード例 #5
0
ファイル: BoostAction.cs プロジェクト: Wutex666/FlyCasual
        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();
        }
コード例 #6
0
ファイル: CloakRule.cs プロジェクト: thordurk91/FlyCasual
        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();
        }
コード例 #7
0
ファイル: BoostAction.cs プロジェクト: vitreuz/FlyCasual
        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);
        }
コード例 #8
0
        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));
        }
コード例 #9
0
        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();
        }
コード例 #10
0
ファイル: BarrelRollAction.cs プロジェクト: Conzar/FlyCasual
        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();
        }
コード例 #11
0
ファイル: TurnBoost.cs プロジェクト: vitreuz/FlyCasual
        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();
        }
コード例 #12
0
ファイル: BarrelRollAction.cs プロジェクト: keldren/FlyCasual
        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();
        }
コード例 #13
0
ファイル: BarrelRollAction.cs プロジェクト: Conzar/FlyCasual
        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);
        }
コード例 #14
0
        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);
        }
コード例 #15
0
        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);
        }
コード例 #16
0
        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);
        }
コード例 #17
0
        // 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);
        }
コード例 #18
0
        private void FinishManeuverExecution()
        {
            MovementTemplates.HideLastMovementRuler();

            GameMode.CurrentGameMode.FinishMovementExecution();
        }
コード例 #19
0
ファイル: GenericMovement.cs プロジェクト: marcne/FlyCasual
        private void FinishManeuverExecution()
        {
            MovementTemplates.HideLastMovementRuler();

            Selection.ActiveShip.CallExecuteMoving(Triggers.FinishTrigger);
        }
コード例 #20
0
 private static void Finish()
 {
     GameObject.Destroy(FakeShip);
     MovementTemplates.HideLastMovementRuler();
     GenericSubPhase.HideSubphaseDescription();
 }
コード例 #21
0
        private void FinishManeuverExecution()
        {
            MovementTemplates.HideLastMovementRuler();

            Selection.ActiveShip.CallExecuteMoving(GameMode.CurrentGameMode.FinishMovementExecution);
        }