protected override void OnEntityDestroy(IJoyStick entity) { base.OnEntityDestroy(entity); if (this._needsViewKill) { Object.Destroy(this._view); } this._view = null; }
public override void CreateView() { JoyStickView view; if (this.Owner.Source != null) { view = this.Owner.Source.GetComponentInChildren <JoyStickView>(true); this._needsViewKill = false; } else { var viewGo = SyncAddressables.Instantiate("JoyStickView"); view = viewGo.GetComponent <JoyStickView>(); this._needsViewKill = true; } view.Setup(this); this._view = view; }
private void SetJoystickListener(JoyStickView joystick, ControlId id) { var listener = new SwJoystickListener(id); joystick.SetOnMoveListener(listener); }
private void SetJoystickListener(JoyStickView joystick, SwSettings.ControlId cid) { var motion = SwSettings.GetControlMotion(cid); joystick.SetOnMoveListener(new SwJoystickListener(motion)); }