Ejemplo n.º 1
0
        private void HandleDragAndDropGUI(Rect dragdropArea, EditorWindow w)
        {
            Event evt = Event.current;

            switch (evt.type)
            {
            case EventType.DragUpdated:
            case EventType.DragPerform:
                if (!dragdropArea.Contains(evt.mousePosition))
                {
                    return;
                }

                DragAndDrop.visualMode = DragAndDropVisualMode.Copy;

                if (evt.type == EventType.DragPerform)
                {
                    DragAndDrop.AcceptDrag();

                    foreach (Object obj in DragAndDrop.objectReferences)
                    {
                        VariantOperation.GetOperation().CreateObjectVariantInfo(obj);
                    }
                }
                break;
            }
        }
        public bool HandleChildDelete(VariantInfo child)
        {
            m_Children.Remove(child);
            VariantOperation.GetOperation().RemoveVariantFromVariantAxis(child.AssignedVariant, AssignedAxis);

            return(true);
        }
 public void SetRemapConfig(ObjectVariantDestinationInfo info)
 {
     if (info.DstObject != null)
     {
         VariantOperation.GetOperation().AddVariantMapping(info.CreateTagFromSelection(), m_obj, info.DstObject);
     }
     else
     {
         RemoveRemapConfig(info);
     }
 }
        void ApplyAll()
        {
            VariantOperation.GetOperation().ResetRemap();

            VariantOperation.GetOperation().RemoveVariantMapping();

            foreach (var objInfo in VariantOperation.Objects)
            {
                objInfo.SetAllRemapConfig();
            }

            VariantOperation.GetOperation().ApplyRemap();
        }
        private void DrawContent(Rect r)
        {
            var tex = AssetPreview.GetAssetPreview(m_obj);

            GUILayout.Label(tex, GUILayout.Width(100f), GUILayout.Height(100f));
            GUILayout.Label(m_obj.name, "BoldLabel", GUILayout.Width(100f));

            GUILayout.Space(8f);

            if (GUILayout.Button("Add Variant"))
            {
                m_destinations.Add(new ObjectVariantDestinationInfo());
            }

            if (GUILayout.Button("Delete Config"))
            {
                VariantOperation.GetOperation().RemoveObjectVariantInfo(m_obj);
            }
        }
        void DeleteVariant(object b)
        {
            var selectedNodes = b as List <TreeViewItem>;

            if (selectedNodes != null && selectedNodes.Count > 0)
            {
                foreach (var i in selectedNodes)
                {
                    if (i is VariantAxisTreeItem)
                    {
                        VariantAxisTreeItem item = i as VariantAxisTreeItem;
                        VariantOperation.GetOperation().RemoveVariantAxis(item.Info.AssignedAxis);
                    }
                    else if (i is VariantTreeItem)
                    {
                        VariantTreeItem     item = i as VariantTreeItem;
                        VariantAxisTreeItem p    = i.parent as VariantAxisTreeItem;
                        VariantOperation.GetOperation().RemoveVariantFromVariantAxis(item.Info.AssignedVariant, p.Info.AssignedAxis);
                    }
                }
            }
            ForceReloadData(this);
        }
 public void RemoveRemapConfig()
 {
     VariantOperation.GetOperation().RemoveAllVariantMappingForObject(m_obj);
 }
 public void RemoveRemapConfig(ObjectVariantDestinationInfo info)
 {
     VariantOperation.GetOperation().RemoveVariantMapping(info.CreateTagFromSelection(), m_obj);
 }
 public void SelectVariant(Variant v)
 {
     m_currentSelection = v;
     VariantOperation.GetOperation().ApplyRemap();
 }
 public void ResetSelection()
 {
     m_currentSelection = null;
     VariantOperation.GetOperation().ApplyRemap();
 }
Ejemplo n.º 11
0
        public static void AddNewAxis()
        {
            var newAxis = VariantOperation.GetOperation().CreateNewAxis("New Variant Group");

            m_RootLevelVariant.AddChild(newAxis);
        }
 void ResetAll()
 {
     VariantOperation.GetOperation().ResetRemap();
 }
 public void HandleDelete()
 {
     VariantOperation.GetOperation().RemoveVariantAxis(AssignedAxis);
     m_Children.Clear();
 }