Beispiel #1
0
        public override void Initialize()
        {
            IHealthComponent healthComponent = ParentGameObject.GetComponent <IHealthComponent>();

            healthComponent.OnHealthDepleted += OnDeath;
            base.Initialize();
        }
        protected override void OnTrigger()
        {
            Animator animator = ParentGameObject.GetComponent <Animator>();

            if (animator == null)
            {
                End();
                return;
            }

            switch (_kind)
            {
            case Kind.TRIGGER: animator.SetTrigger(_parameter);
                break;

            case Kind.BOOL: animator.SetBool(_parameter, _boolValue);
                break;

            case Kind.INTEGER: animator.SetInteger(_parameter, _intValue);
                break;

            case Kind.FLOAT: animator.SetFloat(_parameter, _floatValue);
                break;
            }

            End();
        }
        public override void PostInitialize()
        {
            //Try to find the Metadata component and pull player information from it.
            player = ParentGameObject.GetMetadata("player") as Player;

            base.PostInitialize();
        }
Beispiel #4
0
        /// <summary>
        /// Method that runs once on start.
        /// </summary>
        public override void Start()
        {
            MapComponent map = ParentGameObject.GetComponent <MapComponent>();

            maxX = map.Map.GetLength(0);
            maxY = map.Map.GetLength(1);
        }
Beispiel #5
0
 /// <summary>
 /// Public override method which initiates at the first frame.
 /// </summary>
 public override void Start()
 {
     keyObserver = ParentGameObject.GetComponent <KeyObserver>();
     position    = ParentGameObject.GetComponent <Position>();
     x           = position.Pos.X;
     option      = 0;
 }
Beispiel #6
0
        /// <summary>
        /// Public override method which is launched at each frame.
        /// </summary>
        public override void Update()
        {
            // Sees if the player as not died or finish the level
            if (!player.Gameover)
            {
                framesForTime++;

                // At each 50 frames, the time goes down by 1
                if (framesForTime == 50)
                {
                    Timing--;

                    framesForTime = 0;

                    /* Actualizes the render of the game object with the
                     * actualized score */
                    ParentGameObject.GetComponent <RenderableStringComponent>().
                    SwitchString(() => "Time: " + Timing.ToString());
                }

                // Returns to the menu if the time's up.
                if (Timing == 0)
                {
                    ParentScene.Terminate();
                    Menu menu = new Menu();
                    menu.Run();
                }
            }
        }
        public override void Initialize()
        {
            var movementComponent = ParentGameObject.GetComponent <IMovementComponent>();

            movementComponent.MoveInDirection(new Vector2(0, 1));

            base.Initialize();
        }
Beispiel #8
0
 public override void Start()
 {
     sprite = ParentGameObject.GetComponent <ConsoleSprite>();
     if (sprite == null)
     {
         throw new InvalidOperationException(
                   $"The {nameof(SpriteCollider)} component " +
                   "requires a {nameof(ConsoleSprite)} component");
     }
 }
Beispiel #9
0
        /// <summary>
        /// Method to run at the beginning of a scene
        /// </summary>
        public override void Start()
        {
            _transform = ParentGameObject.GetComponent <Transform>();

            if (_transform == null)
            {
                throw new InvalidOperationException(
                          $"The {nameof(ObjectCollider)} component " +
                          $"requires a {nameof(Transform)} component");
            }
        }
        public override void Initialize()
        {
            healthComponent = ParentGameObject.GetComponent <IHealthComponent>();

            if (healthComponent != null)
            {
                healthComponent.OnHealthDepleted += OnHealthDepleted;
            }

            base.Initialize();
        }
Beispiel #11
0
        public override void Initialize()
        {
            //Subscribe to our ICollisionComponent.
            CollisionComponent              = ParentGameObject.GetComponent <ICollisionComponent>();
            CollisionComponent.OnCollision += Collided;

            //Get a reference to our damage component.
            DamageComponent = ParentGameObject.GetComponent <IDamageComponent>();

            base.Initialize();
        }
        /// <summary>
        /// Сигнал обновления модели
        /// </summary>
        /// <param name="parDeltaTime">Время кадра в секундах</param>
        public override void Update(double parDeltaTime)
        {
            base.Update(parDeltaTime);
            if (IsFirstUpdate)
            {
                IsFirstUpdate = false;
                if (ParentGameObject.LinkedAppModel.GetGameplaySettingsData().IsIntroDisabled)
                {
                    //пропускаем заставку
                    ToMainMenu();
                }
                else
                {
                    WatchingCutsceneProviderComponent = ParentGameObject.AddComponent <IntroViewProviderComponent>(
                        ActualLinkedObjectPoolSupportData.LinkedPoolManager
                        .GetObject <IntroViewProviderComponent>(typeof(IntroViewProviderComponent))
                        .Init(ParentGameObject));

                    ParentGameObject.LinkedAppModel.GetSoundManager().PlaySfx(EAppSfxAssets.IntroCutscene, false);

                    WatchingCutsceneProviderComponent.OnIntroCutsceneEndedPerform += OnCutsceneEnd;
                }
            }
            else if (_gameStartSignal)
            {
                //уничтожаем меню

                _currentMainMenuControlComponent.MenuClosedEvent -= ApplicationExit;
                _currentMainMenuControlComponent.OnGameStart     -= StartGame;

                _currentMainMenuControlComponent.DisableAndSendToPool();
                _currentMainMenuMainGameObject.DisableAndSendToPool();


                _currentMainMenuMainGameObject   = null;
                _currentMainMenuControlComponent = null;

                Console.WriteLine("Game is starting...");
                //переходим к выбранному игровому уровню
                _currentGameSessionGameObject = ActualLinkedObjectPoolSupportData.LinkedPoolManager
                                                .GetObject <GameObject>(typeof(GameObject)).Init(ParentGameObject.LinkedAppModel);

                _currentGameSessionControlComponent = ActualLinkedObjectPoolSupportData.LinkedPoolManager
                                                      .GetObject <GameSessionControllerComponent>(typeof(GameSessionControllerComponent))
                                                      .Init(_currentGameSessionGameObject, _selectedLevel);
                _currentGameSessionGameObject.AddComponent(_currentGameSessionControlComponent);

                _currentGameSessionControlComponent.OnGameSessionEnd += EndGameSession;

                _gameStartSignal = false;
            }
        }
Beispiel #13
0
        /// <summary>
        /// Выполнить действия перед отправкой в пул
        /// </summary>
        public override void OnBeforeResetPerform()
        {
            ParentGameObject?.RemoveComponent(this);

            if (IsUpdatable)
            {
                ParentGameObject.LinkedAppModel.UnregisterUpdatableObject(this);
            }

            if (IsFixedUpdatable)
            {
                ParentGameObject.LinkedAppModel.UnregisterFixedUpdatableObject(this);
            }

            base.OnBeforeResetPerform();
        }
Beispiel #14
0
        /// <summary>
        /// Turns the player sprite.
        /// </summary>
        /// <param name="right">True if player is facing right.</param>
        private void TurnSprite(bool right)
        {
            // Sprite for player facing right.
            char[,] playerSpriteRight =
            {
                { '─', '▄', '█', '└' },
                { '▄', '▀', '▄', '▄' },
                { '█', '█', '▐', '▄' },
                { '█', '▀', '▐', '▄' },
                { '█', '▐', '▄', '▄' },
                { '█', '└', '█', '▄' },
                { '▄', '─', '▄', '┘' },
                { '▄', '┐', '┘', ' ' },
            };

            // Sprite for player facing left.
            char[,] playerSpriteLeft =
            {
                { '▄', '┌', '└', ' ' },
                { '▄', '─', '▄', '└' },
                { '█', '┘', '█', '▄' },
                { '█', '▌', '▄', '▄' },
                { '█', '▀', '▌', '▄' },
                { '█', '█', '▌', '▄' },
                { '▄', '▀', '▄', '▄' },
                { '─', '▄', '█', '┘' },
            };

            if (!right)
            {
                ParentGameObject
                .GetComponent <ConsoleSprite>()
                .SwitchSprite(
                    playerSpriteLeft,
                    ConsoleColor.Red,
                    ConsoleColor.Gray);
            }
            else
            {
                ParentGameObject
                .GetComponent <ConsoleSprite>()
                .SwitchSprite(
                    playerSpriteRight,
                    ConsoleColor.Red,
                    ConsoleColor.Gray);
            }
        }
        /// <summary>
        /// Обработчик завершения стартовой заставки
        /// </summary>
        private void OnCutsceneEnd()
        {
            Console.WriteLine("Intro cutscene ending handled!");
            //dispose watcher and player
            WatchingCutsceneProviderComponent?.DisableAndSendToPool();
            WatchingCutsceneProviderComponent = null;

            //add listener for main menu transition
            WatchingKeyComponent = ParentGameObject.AddComponent <KeyListenerComponent>(ActualLinkedObjectPoolSupportData
                                                                                        .LinkedPoolManager.GetObject <KeyListenerComponent>(typeof(KeyListenerComponent)))
                                   .Init(ParentGameObject);

            WatchingKeyComponent.WatchData.Add(new KeyListenerData(EGameActionButton.Button_Start,
                                                                   ParentGameObject.LinkedAppModel.GetPlayersManager().Player1,
                                                                   ToMainMenu, true));

            //transitioning to main menu
        }
Beispiel #16
0
        private void CheckMaterial()
        {
            Renderer thisRenderer = ParentGameObject.GetComponent <Renderer>();

            if (thisRenderer == null)
            {
                m_useThis = false;
            }
            else
            {
#if UNITY_EDITOR
                m_useThis = ((UnityEditor.EditorApplication.isPlaying && m_material == thisRenderer.material) ||
                             (!UnityEditor.EditorApplication.isPlaying && m_material == thisRenderer.sharedMaterial));
#else
                m_useThis = (m_material == thisRenderer.material);
#endif
            }
        }
Beispiel #17
0
        /// <summary>
        /// Определяет основные стандартные обработчики ввода для осуществления операций перемешения по элементам
        /// пользовательского интерфейса меню
        /// </summary>
        protected void DefineStdMenuHandlingControls()
        {
            MenuHandlingControls = new List <KeyListenerComponent>();

            KeyListenerData menuMoveUp =
                new KeyListenerData(EGameActionButton.Dpad_Menu_Up, PlayerRef, StdMenuMoveUp, false);
            KeyListenerData menuMoveDown =
                new KeyListenerData(EGameActionButton.Dpad_Menu_Down, PlayerRef, StdMenuMoveDown, false);

            KeyListenerComponent menuControlComponent =
                ActualLinkedObjectPoolSupportData.LinkedPoolManager
                .GetObject <KeyListenerComponent>(typeof(KeyListenerComponent)).Init(ParentGameObject);

            menuControlComponent.WatchData.Add(menuMoveUp);
            menuControlComponent.WatchData.Add(menuMoveDown);

            MenuHandlingControls.Add(ParentGameObject.AddComponent <KeyListenerComponent>(menuControlComponent));
        }
Beispiel #18
0
        /// <summary>
        /// Public override method which is launched at each frame.
        /// </summary>
        public override void Update()
        {
            // Sees if the player as not died or finish the level
            if (!player.Gameover)
            {
                framesForTime++;

                // At each 50 frames, the score goes down by 10
                if (framesForTime == 50)
                {
                    Scoring -= 10;

                    framesForTime = 0;

                    /* Actualizes the render of the game object with the
                     * actualized score */
                    ParentGameObject.GetComponent <RenderableStringComponent>()
                    .SwitchString(() => "Score: " + Scoring.ToString());
                }
            }
        }
        /// <summary>
        /// Действия по началу игрового уровня (с пробросом в компонент главного меню)
        /// </summary>
        private void StartGameLevel()
        {
            ParentGameObject.LinkedAppModel.GetSoundManager().StopMusic();

            MainMenuControlComponent mainMenuControlComponent =
                ParentGameObject.GetComponent <MainMenuControlComponent>(typeof(MainMenuControlComponent));

            //disable all button listeners
            if (MenuHandlingControls != null)
            {
                foreach (var keyListenerComponent in MenuHandlingControls)
                {
                    keyListenerComponent.DisableAndSendToPool();
                }
            }

            SelectUiElement(null);


            ViewEndedTransitionToTheGameStage += () => mainMenuControlComponent.StartGameHandle(CurrentSelectedLevel);

            TransitionToTheGameStageStarted?.Invoke();
        }
Beispiel #20
0
        protected override void OnHealthDepleted(IHealthComponent sender, IGameObject damageInitator)
        {
            var renderComponent = ParentGameObject.GetComponent <IRenderComponent>();

            var particleAction = Parent.ActionFactory.GetAction <OneShotEmitParticleAction>();

            particleAction.ParticleName = ParticleEffectName;

            //Find the correct spot on the IRenderComponent if it's available.
            if (renderComponent != null)
            {
                float x = (ParentGameObject.Position.X + (renderComponent.Width / 2f));
                float y = (ParentGameObject.Position.Y + (renderComponent.Height / 2f));
                particleAction.TargetLocation = new Vector2(x, y);

                Parent.FireAction(particleAction, null);
            }
            else //No render component, just set the target to be this game object.
            {
                Parent.FireAction(particleAction, sender.Parent);
            }

            base.OnHealthDepleted(sender, damageInitator);
        }
Beispiel #21
0
        protected void ChangeMaterial()
        {
            if (m_useThis)
            {
                Renderer thisRenderer = ParentGameObject.GetComponent <Renderer>();

                if (thisRenderer == null)
                {
                    return;
                }
#if UNITY_EDITOR
                if (UnityEditor.EditorApplication.isPlaying)
                {
                    m_material = thisRenderer.material;
                }
                else
                {
                    m_material = thisRenderer.sharedMaterial;
                }
#else
                m_material = thisRenderer.material;
#endif
            }
        }
 // Start is called immediately before the game loop starts
 public override void Start()
 {
     // Get a reference to the key reader component
     keyReader = ParentGameObject.GetComponent <KeyReaderComponent>();
 }
Beispiel #23
0
 public override void Start()
 {
     keyObserver = ParentGameObject.GetComponent <KeyObserver>();
 }
        protected virtual void OnHealthDepleted(IHealthComponent sender, IGameObject damageInitator)
        {
            healthComponent.OnHealthDepleted -= OnHealthDepleted;

            ParentGameObject.Destroy();
        }
        public override void PostInitialize()
        {
            player = ParentGameObject.GetMetadata("player") as Player;

            base.Initialize();
        }
Beispiel #26
0
        /// <summary>
        /// Public override method which is launched at each frame.
        /// </summary>
        public override void Update()
        {
            bool ground;

            x = position.Pos.X;
            y = position.Pos.Y;
            bool colide = false;

            // Sets Gameover to true when the player reaches the end of the
            // level.
            if (ParentScene.xdim - 9 == position.Pos.X && !Gameover)
            {
                Gameover = true;
            }

            if (Gameover)
            {
                // Sets the correct keys to observe
                ParentGameObject.GetComponent <KeyObserver>().keysToObserve =
                    new ConsoleKey[] { ConsoleKey.Enter, ConsoleKey.Escape };
                ParentScene.inputHandler.quitKeys = new ConsoleKey[] {
                    ConsoleKey.Enter,
                    ConsoleKey.Escape,
                };
                ParentScene.inputHandler.RegisterObserver(
                    ParentGameObject
                    .GetComponent <KeyObserver>()
                    .keysToObserve, ParentGameObject
                    .GetComponent <KeyObserver>());

                // Runs if player falls of the map.
                if (ParentScene.ydim - 4 == position.Pos.Y)
                {
                    // Outputs the dead text
                    dead.GetComponent <RenderableStringComponent>()
                    .SwitchString(() => "Press Enter to restart");

                    // Waits for player input to go to the next level or
                    // back to the main menu.
                    foreach (ConsoleKey key in keyObserver.GetCurrentKeys())
                    {
                        if (key == ConsoleKey.Enter)
                        {
                            if (level == 1)
                            {
                                ParentScene.Terminate();
                                Level1 level1 = new Level1();
                                level1.Run();
                                break;
                            }
                            else
                            {
                                ParentScene.Terminate();
                                Level2 level2 = new Level2();
                                level2.Run();
                                break;
                            }
                        }

                        if (key == ConsoleKey.Escape)
                        {
                            ParentScene.Terminate();
                            Menu menu = new Menu();
                            menu.Run();
                            break;
                        }
                    }
                }

                // Runs if player reaches the end of the level.
                else if (ParentScene.xdim - 9 == position.Pos.X)
                {
                    // Outputs the ending level text
                    dead.GetComponent <RenderableStringComponent>()
                    .SwitchString(() =>
                                  $"Press Enter to go to the next level, your score is : {actualScore.Scoring}");

                    // Waits for player input to go to the next level or back
                    // to the main menu.
                    foreach (ConsoleKey key in keyObserver.GetCurrentKeys())
                    {
                        if (key == ConsoleKey.Enter)
                        {
                            if (level == 1)
                            {
                                ParentScene.Terminate();
                                Level2 level2 = new Level2();
                                level2.Run();
                                break;
                            }
                            else
                            {
                                ParentScene.Terminate();
                                Menu menu = new Menu();
                                menu.Run();
                                break;
                            }
                        }

                        if (key == ConsoleKey.Escape)
                        {
                            ParentScene.Terminate();
                            Menu menu = new Menu();
                            menu.Run();
                            break;
                        }
                    }
                }
            }
            else
            {
                // Checks if the player is on the ground
                ground = CheckGround();

                // If he is not jumping and not in the ground, the player
                // will then starts to fall
                if (!inAir && !ground)
                {
                    while (!ground)
                    {
                        Falling();

                        // Removes the keyObserver from the player.
                        ParentScene.inputHandler
                        .RemoveObserver(ParentGameObject
                                        .GetComponent <KeyObserver>());

                        doesNotHaveKeyObserver = true;
                        ground = true;
                    }
                }

                // If he is in the ground, then he can walk and jump as normal
                else if (!inAir)
                {
                    if (doesNotHaveKeyObserver)
                    {
                        // Adds the keyObserver to the player.
                        ParentScene.inputHandler
                        .AddObserver(ParentGameObject
                                     .GetComponent <KeyObserver>());
                        doesNotHaveKeyObserver = false;
                    }

                    // Controls the movement of the player.
                    foreach (ConsoleKey key in keyObserver.GetCurrentKeys())
                    {
                        switch (key)
                        {
                        case ConsoleKey.RightArrow:
                            lastkey = ConsoleKey.RightArrow;
                            foreach (Vector2 v in occupied)
                            {
                                if (position.Pos.X + 7 == v.X &&
                                    position.Pos.Y == v.Y)
                                {
                                    colide = true;
                                }
                            }

                            if (!colide)
                            {
                                x++;
                            }

                            // Map limits.
                            x            = Math.Clamp(x, 0, ParentScene.xdim - 9);
                            y            = Math.Clamp(y, 0, ParentScene.ydim - 3);
                            position.Pos = new Vector3(
                                x,
                                y,
                                position.Pos.Z);
                            TurnSprite(true);
                            break;

                        case ConsoleKey.UpArrow:
                            lastkey      = ConsoleKey.UpArrow;
                            position.Pos = new Vector3(
                                x,
                                y,
                                position.Pos.Z);
                            break;

                        case ConsoleKey.LeftArrow:
                            lastkey = ConsoleKey.LeftArrow;
                            foreach (Vector2 v in occupied)
                            {
                                if (position.Pos.X - 1 == v.X &&
                                    position.Pos.Y == v.Y)
                                {
                                    colide = true;
                                }
                            }

                            if (!colide)
                            {
                                x--;
                            }

                            // Map limits.
                            x            = Math.Clamp(x, 0, ParentScene.xdim - 9);
                            y            = Math.Clamp(y, 0, ParentScene.ydim - 3);
                            position.Pos = new Vector3(
                                x,
                                y,
                                position.Pos.Z);
                            TurnSprite(false);
                            break;

                        case ConsoleKey.Spacebar:
                            inAir        = true;
                            position.Pos = new Vector3(
                                x,
                                y,
                                position.Pos.Z);
                            break;

                        case ConsoleKey.Escape:
                            ParentScene.Terminate();
                            Menu menu = new Menu();
                            menu.Run();
                            break;
                        }
                    }

                    // Map limits.
                    x = Math.Clamp(x, 0, ParentScene.xdim - 9);
                    y = Math.Clamp(y, 0, ParentScene.ydim - 3);
                }

                // Player Jump.
                else if (inAir)
                {
                    actualScore.Scoring -= 5;
                    ParentScene.inputHandler.RemoveObserver(
                        ParentGameObject.GetComponent <KeyObserver>());
                    if (jumpFrames <= 2)
                    {
                        y -= 2;
                        if (lastkey == ConsoleKey.RightArrow)
                        {
                            x += 3;
                        }
                        else if (lastkey == ConsoleKey.LeftArrow)
                        {
                            x -= 3;
                        }
                        jumpFrames++;
                    }
                    else if (jumpFrames == 3)
                    {
                        y -= 2;
                        if (lastkey == ConsoleKey.RightArrow)
                        {
                            x += 3;
                        }
                        else if (lastkey == ConsoleKey.LeftArrow)
                        {
                            x -= 3;
                        }
                        jumpFrames = 0;
                        inAir      = false;
                    }

                    // Map limits.
                    x            = Math.Clamp(x, 0, ParentScene.xdim - 9);
                    y            = Math.Clamp(y, 0, ParentScene.ydim - 3);
                    position.Pos = new Vector3(x, y, position.Pos.Z);
                    Thread.Sleep(80);
                }

                if (coins != null)
                {
                    coinScore = CheckCoin();
                }
                if (coinScore)
                {
                    actualScore.Scoring += 1000;
                    coinScore            = false;
                }
            }
        }
Beispiel #27
0
        /// <summary>
        /// Процедура активации главного меню
        /// </summary>
        public override void Activate()
        {
            //заполенение подменю
            SubMenus = new List <MenuControlComponent>();

            SinglePlayerLobbySubMenu =
                ParentGameObject.AddComponent <SinglePlayerLobbyMenuControlComponent>(
                    ActualLinkedObjectPoolSupportData.LinkedPoolManager
                    .GetObject <SinglePlayerLobbyMenuControlComponent>(typeof(SinglePlayerLobbyMenuControlComponent))
                    .Init(ParentGameObject));

            SubMenus.Add(SinglePlayerLobbySubMenu);

            OptionsSubMenu =
                ParentGameObject.AddComponent <OptionsMenuControlComponent>(
                    ActualLinkedObjectPoolSupportData.LinkedPoolManager
                    .GetObject <OptionsMenuControlComponent>(typeof(OptionsMenuControlComponent))
                    .Init(ParentGameObject));

            SubMenus.Add(OptionsSubMenu);

            RecordsSubMenu =
                ParentGameObject.AddComponent <RecordsMenuControlComponent>(
                    ActualLinkedObjectPoolSupportData.LinkedPoolManager
                    .GetObject <RecordsMenuControlComponent>(typeof(RecordsMenuControlComponent))
                    .Init(ParentGameObject));

            SubMenus.Add(RecordsSubMenu);

            JukeboxSubMenu =
                ParentGameObject.AddComponent <JukeboxMenuControlComponent>(
                    ActualLinkedObjectPoolSupportData.LinkedPoolManager
                    .GetObject <JukeboxMenuControlComponent>(typeof(JukeboxMenuControlComponent))
                    .Init(ParentGameObject));

            SubMenus.Add(JukeboxSubMenu);


            //заполнение кнопок меню
            MenuUiElements = new LinkedList <UiElement>();

            NewGame1PPocketButton = CreateStandardButton(() => GoToSubmenu(SinglePlayerLobbySubMenu));

            MenuUiElements.AddLast(NewGame1PPocketButton); //лобби


            OptionsButton = CreateStandardButton(() => GoToSubmenu(OptionsSubMenu));

            MenuUiElements.AddLast(OptionsButton); //настройки


            RecordsButton = CreateStandardButton(() => GoToSubmenu(RecordsSubMenu));

            MenuUiElements.AddLast(RecordsButton); //рекорды


            JukeboxButton = CreateStandardButton(() => GoToSubmenu(JukeboxSubMenu));

            MenuUiElements.AddLast(JukeboxButton); //музыкальный плеер


            ExitButton = CreateStandardButton(ExitAction);

            MenuUiElements.AddLast(ExitButton); //выход


            SelectUiElement(MenuUiElements.First.Value);

            //Активация управления меню

            DefineStdMenuHandlingControls();

            base.Activate();
        }
Beispiel #28
0
 /// <summary>
 /// Public override method which initiates at the first frame.
 /// </summary>
 public override void Start()
 {
     position = ParentGameObject.GetComponent <Position>();
     x        = position.Pos.X;
 }
Beispiel #29
0
 private string ToCSharpParentName()
 {
     return(ParentGameObject == null ? " : " + "Entity" : " : " + ParentGameObject.ToCSharpName());
 }
Beispiel #30
0
        public override void Initialize()
        {
            MovementComponent = ParentGameObject.GetComponent <IMovementComponent>();

            base.Initialize();
        }