protected override void OnInitialize()
        {
            PlayerAttacker = new PlayerAttacker(PlayerId);
            var playerMover = GetComponent <PlayerMover>();

            playerMover.OnHipDropped.DelayFrame(1).Subscribe(_ =>
            {
                var prefab            = _ShowWaveNomalGO[(int)PlayerId - 1];
                var go                = Instantiate(prefab);
                go.transform.position = transform.position;
                go.Attacker           = PlayerAttacker;
            }).AddTo(gameObject);

            // ヒップドロップ時
            playerMover.IsHipDroping.Subscribe(x =>
            {
                hipDroCollider.enabled = x;
            });

            hipDroCollider.OnTriggerEnterAsObservable()
            .Select(x => x.GetComponent <IDamageApplicable>())
            .Where(x => x != null)
            .Subscribe(x =>
            {
                var damage = new Damage
                {
                    Attacker  = new PlayerAttacker(PlayerId),
                    Value     = 300,
                    Direction = Vector3.down,
                    Type      = AttackType.HipDrop
                };
                x.ApplyDamage(damage);
            });
        }
Beispiel #2
0
    public void Start()
    {
        pointer          = GetComponent <VRTK_Pointer>();
        bezierRenderer   = GetComponent <VRTK_BezierPointerRenderer>();
        straightRenderer = GetComponent <VRTK_StraightPointerRenderer>();

        attacker  = PlayerController.GetComponent <PlayerAttacker>();
        commander = PlayerController.GetComponent <PlayerCommander>();
        digger    = PlayerController.GetComponent <PlayerDigger>();
        flyer     = PlayerController.GetComponent <PlayerFlyer>();
        grabber   = PlayerController.GetComponent <PlayerGrabber>();
        mover     = PlayerController.GetComponent <PlayerMover>();
        summoner  = PlayerController.GetComponent <PlayerSummoner>();

        mover.PointerRenderer = bezierRenderer;

        SetPointer(false);

        pointer.DestinationMarkerHover += (object marker, DestinationMarkerEventArgs args) => {
            destinationArgs = args;
            destination     = args.destinationPosition;
        };

        controllerEvents = GetComponent <VRTK_ControllerEvents>();

        controllerEvents.TriggerPressed   += OnTriggerPressed;
        controllerEvents.TriggerReleased  += OnTriggerReleased;
        controllerEvents.TouchpadPressed  += OnTouchpadPressed;
        controllerEvents.TouchpadReleased += OnTouchpadReleased;
    }
Beispiel #3
0
 private void Awake()
 {
     inputManager     = GetComponent <InputManager>();
     animatorManager  = GetComponentInChildren <AnimatorManager>();
     cameraManager    = FindObjectOfType <CameraManager>();
     playerLocomotion = GetComponent <PlayerLocomotion>();
     playerAttacker   = GetComponent <PlayerAttacker>();
 }
Beispiel #4
0
 private void Awake()
 {
     playerAttacker  = GetComponentInChildren <PlayerAttacker>();
     playerInventory = GetComponent <PlayerInventory>();
     playerStats     = GetComponent <PlayerStats>();
     cameraHandler   = FindObjectOfType <CameraHandler>();
     animatorHandler = GetComponentInChildren <AnimatorHandler>();
     playerManager   = GetComponent <PlayerManager>();
 }
Beispiel #5
0
 public void Initialize()
 {
     playerManager  = GetComponentInParent <PlayerManager>();
     pl             = GetComponentInParent <PlayerAttacker>();
     anim           = GetComponent <Animator>();
     inputHandler   = GetComponentInParent <InputHandler>();
     playerMovement = GetComponentInParent <PlayerMovement>();
     vertical       = Animator.StringToHash("Vertical");
     horizontal     = Animator.StringToHash("Horizontal");
 }
Beispiel #6
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     animatorManager = GetComponent <AnimatorManager>();
     playerMovement  = GetComponent <PlayerMovement>();
     playerAttacker  = GetComponent <PlayerAttacker>();
     playerInventory = GetComponent <PlayerInventory>();
 }
    private void Awake()
    {
        playerAttacker  = GetComponent <PlayerAttacker>();
        playerInventory = GetComponent <PlayerInventory>();
        playerManager   = GetComponent <PlayerManager>();
        tutorial        = FindObjectOfType <tutorialHandler>();

        playerEffectsManager  = GetComponentInChildren <PlayerEffectsManager>();
        playerAnimatorManager = GetComponentInChildren <AnimatorHandler>();
        weaponSlotManager     = GetComponentInChildren <WeaponSlotManager>();

        playerLocomotion = GetComponent <PlayerLocomotion>();
        playerStats      = GetComponent <PlayerStats>();
        cameraHolder     = FindObjectOfType <CameraHolder>();
        UIManager        = FindObjectOfType <UIManager>();
        help_input       = false;
    }
Beispiel #8
0
    private void Awake()
    {
        playerAttacker  = GetComponent <PlayerAttacker>();
        playerInventory = GetComponent <PlayerInventory>();
        playerManager   = GetComponent <PlayerManager>();
        skillManager    = GetComponent <SkillManager>();
        animHandler     = GetComponentInChildren <AnimatorHandler>();

        if (inputActions == null)
        {
            //We need to Instantiate the Control Asset via Script. It doesnt show in the inspector
            inputActions = new Controls();

            inputActions.Player.Movement.performed += ctx => _movementInput = ctx.ReadValue <Vector2>();
            //inputActions.Player.XYAxis.performed += ctx => _cameraInput = ctx.ReadValue<Vector2>();
        }

        SetCursorState(false, true);
    }
Beispiel #9
0
    private void Start()
    {
        EnemyGlobalListener.Instance.InitPlayer(transform);

        _playerInput    = GetComponent <PlayerInput>();
        _playerMovement = GetComponent <PlayerMovement>();

        _playerAttacker = GetComponent <PlayerAttacker>();
        _playerAttacker.SetAttackDamage(_playerStats.GetAttackDamage());
        _playerAttacker.SetAttackSpeed(_playerStats.GetAttackSpeed());

        _playerAnimation = GetComponent <PlayerAnimation>();

        _playerHealth = GetComponent <PlayerHealth>();
        _playerHealth.InitHeath(_playerHPDataContainer.PlayerHP, _playerHPDataContainer.PlayerMaxHP);

        _playerAttacker.OnShoot += _playerAnimation.SetAttack;
        EndLevelEvents.Instance.OnAllEnemiesKilled += SavePlayerHP;
    }
Beispiel #10
0
 void FindPlayer()
 {
     if (game_start_director_ != null)
     {
         return;
     }
     foreach (var player in FindObjectsOfType <PlayerAttacker>())
     {
         if (!MyNetworkLobbyManager.s_singleton.IsTutorial)
         {
             if (!player.isLocalPlayer)
             {
                 continue;
             }
         }
         player_attacker_     = player;
         game_start_director_ = player.gameObject.GetComponent <GameStartDirector>();
         game_end_director_   = player.gameObject.GetComponent <GameEndDirector>();
     }
 }
        private void Awake()
        {
            _characterController                   = GetComponent <CharacterController>();
            _wallJumper                            = GetComponent <WallJumper>();
            _controller                            = new InputActionController();
            _playerAttacker                        = GetComponent <PlayerAttacker>();
            _controller.Player.Jump.started       += ctx => PlayerFunction(StartJumping);
            _controller.Player.Jump.canceled      += ctx => PlayerFunction(StopJumping);
            _controller.Player.Jump.performed     += ctx => PlayerFunction(StopJumping);
            _controller.Player.Crouch.performed   += ctx => PlayerFunction(Crouch);
            _controller.Player.Attack.performed   += ctx => PlayerFunction(Attack);
            _controller.Player.TimeStop.performed += ctx => PlayerFunction(TimeStopAbility);
            _controller.Player.Dash.performed     += ctx => PlayerFunction(Dash);

            _wallJumper.OnTouchingWall += (grabbing, right) => WallGrabbed(grabbing);

            aPlayer.OnDie        += () => _enabled = false;
            aPlayer.OnResetLevel += () => _enabled = true;
            // _axisDetection = new AxisDetection(Move, Dash, timeForDoublePress);
        }
Beispiel #12
0
 private void Awake()
 {
     _player         = GetComponent <Player>();
     _playerAttacker = GetComponent <PlayerAttacker>();
 }
Beispiel #13
0
 void FindPlayer()
 {
     if (game_start_director_ != null) return;
     foreach (var player in FindObjectsOfType<PlayerAttacker>())
     {
         if (!MyNetworkLobbyManager.s_singleton.IsTutorial)
         {
             if (!player.isLocalPlayer) continue;
         }
         player_attacker_ = player;
         game_start_director_ = player.gameObject.GetComponent<GameStartDirector>();
         game_end_director_ = player.gameObject.GetComponent<GameEndDirector>();
     }
 }
Beispiel #14
0
 private void Awake()
 {
     animatorManager  = GetComponentInChildren <AnimatorManager>();
     playerLocomotion = GetComponent <PlayerLocomotion>();
     playerAttacker   = GetComponent <PlayerAttacker>();
 }
Beispiel #15
0
 private void Awake()
 {
     _playerAttacker = _player.GetComponent <PlayerAttacker>();
     _audioSource    = GetComponent <AudioSource>();
     _audioSource.Play();
 }