Esempio n. 1
0
        public bool TakeEntityOnPositionInHandTry(DataSlot slot, Vector2 positionCreateHand)
        {
            if (slot == null)
            {
                throw new ArgumentNullException(nameof(slot));
            }
            var entitySource = DatabaseReadOnly.GetEntityOrNull(slot);

            if (entitySource == null)
            {
                return(false);
            }
            if (Debug.DebugMode)
            {
                _point = Debug.PointForDebug.InstantiateOnRootCanvas().transform;
                _point.SetAsLastSibling();
            }

            TakeEntityInHand(entitySource);
            var entityComponent = _bindComponentToDataDbRead.GetEntityComponent(entitySource);

            _handView = new HandView(entityComponent, HandData.DataEntityHand);
            _handView.PositionSet(positionCreateHand);
            return(true);
        }
Esempio n. 2
0
        public void PositionSet(Vector2 position)
        {
            _handView?.PositionSet(position);

            if (Debug.DebugMode && !IsEmpty)
            {
                PointerEventData pointerEventData = new PointerEventData(EventSystem.current);
                Vector2          delta            = Vector2.zero;
                if (IsAreaEntity)
                {
                    delta = _positionsManager.GetDeltaEntityAreaCenterToLeftTopWithScaleFactor(DataEntityHand);
                }
                pointerEventData.position = position + delta;
                _point.position           = pointerEventData.position;
                _point.SetAsLastSibling();
            }
        }