Ejemplo n.º 1
0
        protected virtual void Start()
        {
            _workspace = FindObjectOfType <Workspace>();
            _workspace.OnEntryAdded   += updateDisplayOnAdded;
            _workspace.OnEntryRemoved += updateDisplayOnRemoved;
            bool hasEntry = _workspace.HasEntry(_entry);

            _target.SetActive(hasEntry && _show || !hasEntry && !_show);
        }
        public void OnBeginDrag(PointerEventData eventData)
        {
            if (_workspace.HasEntry(_entry))
            {
                return;
            }

            PendingWorkspaceEntry result = Instantiate(_entryPrefab);

            result.Base.SetParent(GetComponentInParent <Canvas>().transform, false);
            result.Base.localScale            = Vector3.one;
            result.WorkspaceEntry.LinkedEntry = _entry;
            result.WorkspaceEntry.Set(_volumeFactory.Create(_entry.Volume));
            result.WorkspaceEntry.Volume.Data = _entry.Volume.Data;
            result.Base.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, _entry.Base.rect.width);
            _workspace.PendingEntry = result;
        }