Exemple #1
0
 private void Jsm_JoyStickError(object sender, Exception e)
 {
     this.tentative += 1;
     if (this.jsm != null)
     {
         this.jsm.BoutonEvent   -= this.Jsm_BoutonEvent;
         this.jsm.JoyStickError -= this.Jsm_JoyStickError;
         this.jsm = null;
     }
     if (this.tentative < 10)
     {
         this.jsm                = new JoyStickManager();
         this.jsm.BoutonEvent   += Jsm_BoutonEvent;
         this.jsm.JoyStickError += Jsm_JoyStickError;
         this.jsm.CaptureJoyStick();
     }
     else
     {
         if (MessageBox.Show("Reconnecter au joystick?", "Erreur de joystick", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
         {
             this.jsm                = new JoyStickManager();
             this.jsm.BoutonEvent   += Jsm_BoutonEvent;
             this.jsm.JoyStickError += Jsm_JoyStickError;
             this.jsm.CaptureJoyStick();
         }
         else
         {
             if (this.ErreurConnexion != null)
             {
                 this.ErreurConnexion(this, new EventArgs());
             }
         }
     }
 }
Exemple #2
0
 private void Awake()
 {
     Instance = this;
     pressA   = testA;
     pressB   = testB;
     pressX   = testX;
     pressY   = testY;
 }
Exemple #3
0
 public DirectChronostickInputMgr()
 {
     this.listeSignaux       = new Dictionary <int, DateTime>();
     this.jsm                = new JoyStickManager();
     this.jsm.BoutonEvent   += Jsm_BoutonEvent;
     this.jsm.JoyStickError += Jsm_JoyStickError;
     this.jsm.CaptureJoyStick();
 }
Exemple #4
0
 public void Reconnecter()
 {
     if (this.jsm != null)
     {
         this.jsm.BoutonEvent   -= this.Jsm_BoutonEvent;
         this.jsm.JoyStickError -= this.Jsm_JoyStickError;
         this.jsm = null;
     }
     this.jsm                = new JoyStickManager();
     this.jsm.BoutonEvent   += Jsm_BoutonEvent;
     this.jsm.JoyStickError += Jsm_JoyStickError;
     this.jsm.CaptureJoyStick();
 }
Exemple #5
0
    void Awake()
    {
        _rgbd2d  = GetComponent <Rigidbody2D>();
        _attacks = GetComponent <Attacks>();

        GameObject go = new GameObject();

        go.name             = "Controller";
        go.transform.parent = this.transform;

        _jsm = go.AddComponent <JoyStickManager>();
        _jsm.Reset(playerNumber - 1);

        _transform = this.GetComponent <Transform>();
        _anim      = this.GetComponent <Animator>();

        _inventory = this.GetComponent <Items.Inventory>();

        _movementBlocked = false;
        _movementSlowed  = false;
        _jumpBlocked     = false;
    }
Exemple #6
0
 public void Terminer(int delais)
 {
     this.jsm.BoutonEvent   -= this.Jsm_BoutonEvent;
     this.jsm.JoyStickError -= this.Jsm_JoyStickError;
     this.jsm = null;
 }