public void EventTrigger(Events.FlystickButtonPressEvent ev) { // ev.FrameId = this.frame; // ev.Position = this.transform.position; // ev.Invoke( ev ); ev.Invoke(ev.FlystickId, ev.ButtonId); }
// Start is called before the first frame update void Start() { if (this.buttonPressEvent1 == null) { this.buttonPressEvent1 = new Events.FlystickButtonPressEvent(); } this.buttonPressEvent1.ButtonId = 1; this.buttonPressEvent1.FlystickId = this.flystickId; this.buttonPressEvent1.AddListener(this.Alarm); if (this.buttonPressEvent2 == null) { this.buttonPressEvent2 = new Events.FlystickButtonPressEvent(); } this.buttonPressEvent2.ButtonId = 2; this.buttonPressEvent2.FlystickId = this.flystickId; this.buttonPressEvent2.AddListener(this.Alarm); if (this.buttonPressEvent3 == null) { this.buttonPressEvent3 = new Events.FlystickButtonPressEvent(); } this.buttonPressEvent3.ButtonId = 3; this.buttonPressEvent3.FlystickId = this.flystickId; this.buttonPressEvent3.AddListener(this.Alarm); if (this.buttonPressEvent4 == null) { this.buttonPressEvent4 = new Events.FlystickButtonPressEvent(); } this.buttonPressEvent4.ButtonId = 4; this.buttonPressEvent4.FlystickId = this.flystickId; this.buttonPressEvent4.AddListener(this.Alarm); if (this.buttonPressEvent5 == null) { this.buttonPressEvent5 = new Events.FlystickButtonPressEvent(); } this.buttonPressEvent5.ButtonId = 5; this.buttonPressEvent5.FlystickId = this.flystickId; this.buttonPressEvent5.AddListener(this.Alarm); if (this.buttonPressEvent6 == null) { this.buttonPressEvent6 = new Events.FlystickButtonPressEvent(); } this.buttonPressEvent6.ButtonId = 6; this.buttonPressEvent6.FlystickId = this.flystickId; this.buttonPressEvent6.AddListener(this.Alarm); }