public void Move()
 {
     if (!CKeyBoard.pressed(CKeyBoard.k_UpArrow) && !CKeyBoard.pressed(CKeyBoard.k_DownArrow) && !CKeyBoard.pressed(CKeyBoard.k_LeftArrow) && !CKeyBoard.pressed(CKeyBoard.k_RigthArrow))
     {
         
         this.setState(STATE_STAND);
     }
     if (CKeyBoard.pressed(KeyCode.UpArrow))
     {
         this.setVector(Vector2.up);
         this.setState(STATE_MOVE);
     }
     if (CKeyBoard.pressed(KeyCode.DownArrow))
     {
         setVector(-Vector2.up);
         this.setState(STATE_MOVE);
     }
    if (CKeyBoard.pressed(KeyCode.RightArrow))
     {
         setVector(Vector2.right);
         this.setState(STATE_MOVE);
     }
    if (CKeyBoard.pressed(KeyCode.LeftArrow))
     {
         setVector(-Vector2.right);
         this.setState(STATE_MOVE);
     }
    // else if(CKeyBoard.pressed)
 }
    //public void setHO(int newHP)
    //{
    //    if(newHP <= 0)
    //    {
    //        this.HP = 0;
    //        this.invulTimer = 0f;
    //        UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
    //    }
    //}

    //============================Maquina de estado=================
    private void setState(int aState)
    {
        _State = aState;
        
        if(_State == STATE_STAND)
        {
            this.setVector(Vector3.zero);
            rigidbody.velocity = getVector();

            
        }
        else if(_State == STATE_MOVE)
        {
            if(CKeyBoard.pressed(CKeyBoard.k_UpArrow))
               {
                rigidbody.velocity = this.getVector() * this.getMaxVelocityVector();

            }
             if(CKeyBoard.pressed(CKeyBoard.k_DownArrow))
            {
                rigidbody.velocity = this.getVector() * this.getMaxVelocityVector();
            }
            if(CKeyBoard.pressed(CKeyBoard.k_RigthArrow))

            {
                rigidbody.velocity = this.getVector() * this.getMaxVelocityVector();
            }
            if(CKeyBoard.pressed(CKeyBoard.k_LeftArrow))
            {
                rigidbody.velocity = this.getVector() * this.getMaxVelocityVector();
            }
            else if(CKeyBoard.pressed(CKeyBoard.k_UpArrow)&& CKeyBoard.pressed(CKeyBoard.k_RigthArrow))
            {
                setVector(new Vector2(getVector().x* this.getMaxVelocityVector(), getVector().y * this.getMaxVelocityVector());
                rigidbody.velocity = getVector();
            }
            else if (CKeyBoard.pressed(CKeyBoard.k_UpArrow) && CKeyBoard.pressed(CKeyBoard.k_LeftArrow))
            {

            }
            else if(CKeyBoard.pressed(CKeyBoard.k_DownArrow)&& CKeyBoard.pressed(CKeyBoard.k_RigthArrow))
            {

            }
            else if (CKeyBoard.pressed(CKeyBoard.k_DownArrow) && CKeyBoard.pressed(CKeyBoard.k_LeftArrow))
            {

            }



        }
        else{
            setState(STATE_STAND);
            }
    }