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()); } } } }
private void Awake() { Instance = this; pressA = testA; pressB = testB; pressX = testX; pressY = testY; }
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(); }
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(); }
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; }
public void Terminer(int delais) { this.jsm.BoutonEvent -= this.Jsm_BoutonEvent; this.jsm.JoyStickError -= this.Jsm_JoyStickError; this.jsm = null; }