Example #1
0
    //Inicializo algunas vars
    private void Awake()
    {
        _rb = GetComponent <Rigidbody>();

        _idle  = new IdleComponent();
        _move  = new MoveComponent(_rb, transform, _speed);
        _shoot = new ShootComponent(transform, _manager);

        _view = GetComponent <View>();
    }
Example #2
0
 // Update is called once per frame
 void Update()
 {
     if (isLocalPlayer)
     {
         if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.D))
         {
             WalkComponent.Walk();
         }
         if (Input.GetKey(KeyCode.Space))
         {
             JumpComponent.Jump();
         }
         if (!Input.anyKeyDown && !Input.anyKey)
         {
             IdleComponent.Idle();
         }
         if (Input.GetMouseButtonDown(1))
         {
             WeaponComponents[SelectedWeapon].UseWeaponPrimary();
         }
         if (Input.GetMouseButtonDown(2))
         {
             WeaponComponents[SelectedWeapon].UseWeaponSecondary();
         }
         if (Input.GetKey(KeyCode.V))
         {
             //Quick Meele
         }
         if (Input.GetKey(KeyCode.Q))
         {
             //Ultimate
         }
         if (Input.GetKey(KeyCode.E))
         {
             //PrimaryAbility
         }
         if (Input.GetKey(KeyCode.LeftShift))
         {
             //UtilityAbility
         }
         if (Input.GetKey(KeyCode.R))
         {
             //Reload
         }
     }
 }