public RemovingWeaponState(CharacterModel characterModel, InputModel inputModel, CharacterAnimationController animationController,
                            CharacterStateMachine stateMachine) : base(characterModel, inputModel, animationController, stateMachine)
 {
     Type           = StateType.Default;
     IsTargeting    = false;
     IsAttacking    = false;
     CanExit        = false;
     CanBeOverriden = false;
 }
示例#2
0
 public RollingTargetState(CharacterModel characterModel, InputModel inputModel, CharacterAnimationController animationController,
                           CharacterStateMachine stateMachine) : base(characterModel, inputModel, animationController, stateMachine)
 {
     Type           = StateType.Battle;
     IsTargeting    = true;
     IsAttacking    = false;
     CanExit        = false;
     CanBeOverriden = false;
 }
示例#3
0
 public RollingState(CharacterModel characterModel, InputModel inputModel, CharacterAnimationController animationController,
                     CharacterStateMachine stateMachine) : base(characterModel, inputModel, animationController, stateMachine)
 {
     Type            = StateType.Battle;
     IsTargeting     = false;
     IsAttacking     = false;
     CanExit         = false;
     CanBeOverriden  = false;
     CameraTransform = Services.SharedInstance.CameraService.CharacterCamera.transform;
 }
 public BattleTargetMovementState(CharacterModel characterModel, InputModel inputModel, CharacterAnimationController animationController,
                                  CharacterStateMachine stateMachine) : base(characterModel, inputModel, animationController, stateMachine)
 {
     Type           = StateType.Battle;
     IsTargeting    = true;
     IsAttacking    = false;
     CanExit        = false;
     CanBeOverriden = true;
     SpeedIncreace  = _characterModel.CharacterCommonSettings.InBattleRunSpeed /
                      _characterModel.CharacterCommonSettings.InBattleWalkSpeed;
 }
示例#5
0
 public JumpingState(CharacterModel characterModel, InputModel inputModel, CharacterAnimationController animationController,
                     CharacterStateMachine stateMachine) : base(characterModel, inputModel, animationController, stateMachine)
 {
     Type                = StateType.Default;
     IsTargeting         = false;
     IsAttacking         = false;
     CanExit             = false;
     CanBeOverriden      = true;
     JumpVerticalForce   = _characterModel.CharacterCommonSettings.JumpVerticalForce;
     JumpHorizontalForce = _characterModel.CharacterCommonSettings.JumpHorizontalForce;
 }
        public void OnAwake()
        {
            Cursor.visible   = false;
            Cursor.lockState = CursorLockMode.Locked;

            _characterModel      = _context.CharacterModel;
            _animationController = new CharacterAnimationController(_characterModel.CharacterAnimator);

            _speedCountFrame         = _characterModel.CharacterCommonSettings.SpeedMeasureFrame;
            _lastPosition            = _characterModel.CharacterTransform.position;
            _currentPosition         = _lastPosition;
            _currentHealth           = _characterModel.CharacterCommonSettings.HealthPoints;
            _currentBattleIgnoreTime = 0;

            _stateMachine = new CharacterStateMachine(_inputModel, _characterModel, _animationController);
            _stateMachine.SetStartState(_stateMachine._defaultIdleState);

            _inputModel.OnJump        += SetJumpingState;
            _inputModel.OnBattleExit  += ExitBattle;
            _inputModel.OnTargetLock  += ChangeTargetMode;
            _inputModel.OnAttackLeft  += SetAttackingLeftState;
            _inputModel.OnAttackRight += SetAttackingRightState;
            _inputModel.OnDance       += ChangeDancingState;

            _characterModel.PlayerBehavior.OnFilterHandler       += OnFilterHandler;
            _characterModel.PlayerBehavior.OnTriggerEnterHandler += OnTriggerEnterHandler;
            _characterModel.PlayerBehavior.OnTriggerExitHandler  += OnTriggerExitHandler;
            _characterModel.PlayerBehavior.OnTakeDamageHandler   += TakeDamage;

            _stateMachine.OnStateChangeHandler   += OnStateChange;
            LockCharAction.LockCharacterMovement += SetTalkingState;

            SetRightWeapon(_services.InventoryService.GetAllWeapons()[0]);
            //SetLeftWeapon(_services.InventoryService.Feast);
            //SetRightWeapon(_services.InventoryService.Feast);
            _services.InventoryService.HideWepons(_characterModel);
        }