Example #1
0
        protected override void OnEntityDestroy(IJoyStick entity)
        {
            base.OnEntityDestroy(entity);
            if (this._needsViewKill)
            {
                Object.Destroy(this._view);
            }

            this._view = null;
        }
Example #2
0
        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;
        }
Example #3
0
        private void SetJoystickListener(JoyStickView joystick, ControlId id)
        {
            var listener = new SwJoystickListener(id);

            joystick.SetOnMoveListener(listener);
        }
Example #4
0
        private void SetJoystickListener(JoyStickView joystick, SwSettings.ControlId cid)
        {
            var motion = SwSettings.GetControlMotion(cid);

            joystick.SetOnMoveListener(new SwJoystickListener(motion));
        }