Пример #1
0
 // Used for blender bank to know if a blender asset has been imported
 private void OnBlenderBankObjectImported(string objectName, string niceName)
 {
     if (niceName == requestedBlenderImportName && null != blenderImportTask && !blenderImportTask.Task.IsCompleted)
     {
         GameObject instance = SyncData.nodes[objectName].instances[0].Item1;
         blenderImportTask.TrySetResult(instance);
         Selection.AddToSelection(instance);
     }
 }
Пример #2
0
        private void Select_Button_Click(object sender, RoutedEventArgs e)
        {
            if (ActorReference == null)
            {
                return;
            }

            Selection s = ActorReference.World.ActorEditor.EditorSelection;

            s.ClearSelection();
            s.AddToSelection(ActorReference);
        }
Пример #3
0
        static void Main(string[] args)
        {
            AudioTrack mediaTrack = new AudioTrack(1, "metall", "http://metall");
            Picture    picture    = new Picture(2, "Kurt", "http://met");
            Video      video      = new Video(3, "garri poter", "http://vid");
            Disk       disk       = new Disk(new List <IDisc>()
            {
                mediaTrack, picture
            });
            Selection selection = new Selection();

            Console.WriteLine(disk.ShowAll());
            // Series series = new Series(new List<ISerial>(){video,picture});
            AudioTrack[] tracks = new AudioTrack[5];
            for (int i = 0; i < tracks.Length; i++)
            {
                tracks[i] = new AudioTrack(i, "Name- " + i, "http://loc" + i);
                disk.AddToDisk(tracks[i]);
                selection.AddToSelection(tracks[i]);
            }
            Console.WriteLine(mediaTrack.Play());
            Console.WriteLine(disk.ShowAll());
            Series series = new Series();

            series.AddContentToSerial(video);
            series.AddContentToSerial(picture);
            series.DeleteContentFromSerial(video);
            selection.AddToSelection(mediaTrack);
            Console.WriteLine(series.ShowAll());
            disk.AddToDisk(picture);
            Console.WriteLine(disk.AddToDisk(mediaTrack));
            VideoPicture videoPicture = new VideoPicture();

            videoPicture.AddToVideoPicture(picture);
            Console.WriteLine(videoPicture.ShowAll());


            Console.ReadLine();
        }
Пример #4
0
 private void OnMouseDown()
 {
     if (!Selected)
     {
         if (Selection.AddToSelection(gameObject))
         {
             GlowObject.SetActive(true);
             Selected = true;
         }
     }
     else if (Selected)
     {
         if (Selection.Contains(gameObject))
         {
             GlowObject.SetActive(false);
             Selected = false;
         }
     }
 }
Пример #5
0
        VisualElement SelectByType(BuilderSelectionType selectionType)
        {
            VisualElement element = null;

            switch (selectionType)
            {
            case BuilderSelectionType.Element:
                element = BuilderWindow.documentRootElement.Q(Selection.isEmpty ? "multi-uss-label" : "multi-uss-button");
                break;

            case BuilderSelectionType.ElementInTemplateInstance:
                element = BuilderWindow.documentRootElement.Q <TemplateContainer>(Selection.isEmpty ? "no-uss-document1" : "no-uss-document2").Q <Label>("no-uss-label");
                break;

            case BuilderSelectionType.StyleSelector:
                element = ViewportPane.styleSelectorElementContainer.Q(Selection.isEmpty ? "ColorsTestStyleSheet" : "LayoutTestStyleSheet").Children().First();
                break;

            case BuilderSelectionType.StyleSheet:
                element = ViewportPane.styleSelectorElementContainer.Q(Selection.isEmpty ? "ColorsTestStyleSheet" : "LayoutTestStyleSheet");
                break;

            case BuilderSelectionType.VisualTreeAsset:
                element = BuilderWindow.documentRootElement;
                break;
            }

            if (element == null)
            {
                return(null);
            }

            if (Selection.isEmpty || selectionType == BuilderSelectionType.VisualTreeAsset)
            {
                Selection.Select(null, element);
            }
            else
            {
                Selection.AddToSelection(null, element);
            }
            return(element);
        }