Esempio n. 1
0
        public override void Enter()
        {
            parasiteEnemy = context.parasite as IEnemy;

            PlayerInputManager.OnParasitePressed += HandleOnPlayerParasitePressed;
            PlayerInputManager.DelayParasiteButtonPress(parasiteTimeDelay);
            parasiteEnemy.GetToleranceCtrl().OnMaxTolleranceBar += HandleOnMaxTolleranceBar;
            context.player.OnDamageableCollision += HandleOnDamageableCollision;
            parasiteEnemy.gameObject.layer        = context.player.gameObject.layer;
            if (context.player.gameObject.layer == LayerMask.NameToLayer("Player"))
            {
                context.player.OnEnemyCollision += HandleOnEnemyCollision;
                gainHealth = true;
                immunity   = false;
            }
            else
            {
                context.player.OnPlayerImmunityEnd += HandlePlayerImmunityEnd;
                gainHealth = false;
                immunity   = true;
            }

            parasitePressed = false;

            parasiteEnemy.gameObject.transform.parent        = context.player.transform;
            parasiteEnemy.gameObject.transform.localPosition = Vector3.zero;
            parasiteEnemy.gameObject.transform.localRotation = Quaternion.identity;

            context.player.GetCollisionController().CalculateParasiteCollision(parasiteEnemy);
            context.player.GetMovementController().SetCanMove(true);
            context.player.GetShotController().SetShotPoint(parasiteEnemy.GetShotPoint());
        }
Esempio n. 2
0
    public override void Enter()
    {
        cam = LevelManager.instance.GetCameraManager();
        parasitePlatform = context.parasite as LaunchingPlatform;

        parasitePlatform.GetToleranceCtrl().OnMaxTolleranceBar += HandleOnMaxTolleranceBar;
        PlayerInputManager.OnShotPressed     += HandleParasiteExit;
        PlayerInputManager.OnParasitePressed += HandleParasiteExit;
        context.player.OnDamageableCollision += HandleDamageableCollision;
        PlayerInputManager.DelayParasiteButtonPress(parasiteTimeDelay);

        parasitePressed = false;
        healthMax       = false;

        parasitePlatform.gameObject.transform.parent        = context.player.transform;
        parasitePlatform.gameObject.transform.localPosition = Vector3.zero;

        context.player.GetShotController().SetCrossairDistance(3f);
        context.player.GetShotController().SetCanShoot(false);
        context.player.StopImmunityCoroutine();
        context.player.gameObject.layer = LayerMask.NameToLayer("PlayerImmunity");

        cam.SetPlatformCamera(parasitePlatform.GetObjectToFollow());
    }