Exemplo n.º 1
0
        protected void AddSystemButtonPressed(MouseClickEvent e)
        {
            if (e.button != 0)
            {
                return;
            }
            List <System.Type> existingTypes = chosenKey.systemManager.GetCurrentSystemTypes();

            TypeSelector.TypeSelectorParameters searchParameters = new TypeSelector.TypeSelectorParameters(typeof(ProvenceSystem), false, chosenKey.systemManager.GetCurrentSystemTypes(), typeof(Entity));
            TypeSelector.Open(searchParameters, args => {
                Helpers.InvokeGenericMethod <ProvenceManagerEditor>(this, "AddSystem", args.value);
            });
        }
 protected virtual void AddTagButtonClicked(MouseClickEvent e)
 {
     if (e.button != 0)
     {
         return;
     }
     if (collection.ContainsKey(chosenKey))
     {
         List <Type> existingTypes = collection[chosenKey].tags.Select(t => t.GetType()).ToList();
         TypeSelector.TypeSelectorParameters searchParameters = new TypeSelector.TypeSelectorParameters(typeof(MainframeTag), false, existingTypes);
         TypeSelector.Open(searchParameters, args => {
             AddTagToEntry(args.value);
         });
     }
 }
 protected virtual void AddComponentButtonClicked(MouseClickEvent e)
 {
     if (e.button != 0)
     {
         return;
     }
     if (collection.ContainsKey(chosenKey))
     {
         List <Type> existingTypes = collection[chosenKey].components.Keys.ToList();
         TypeSelector.TypeSelectorParameters searchParameters = new TypeSelector.TypeSelectorParameters(typeof(ProvenceComponent), false, existingTypes, typeof(Entity));
         TypeSelector.Open(searchParameters, args => {
             Helpers.InvokeGenericMethod <ProvenceCollectionEditor <U> >(this, "AddComponentToEntry", args.value);
         });
     }
 }
        protected void AddSystemButtonPressed(MouseClickEvent e)
        {
            if (e.button != 0)
            {
                return;
            }
            List <System.Type> existingTypes = collection[chosenKey].systems.ToList();

            TypeSelector.TypeSelectorParameters searchParameters = new TypeSelector.TypeSelectorParameters(typeof(ProvenceSystem), false, existingTypes, typeof(Entity));
            TypeSelector.Open(searchParameters, args => {
                collection[chosenKey].systems.Add(args.value);
                collection[chosenKey].systems = new HashSet <System.Type>(collection[chosenKey].systems.OrderBy(system => system.Name));
                eventManager.Raise <SetSceneDirtyEvent>(new SetSceneDirtyEvent(SceneManager.GetActiveScene()));
                eventManager.Raise <DrawColumnEventArgs <string> >(new DrawColumnEventArgs <string>(1));
            });
        }
Exemplo n.º 5
0
        protected void AddComponentButtonClicked(MouseClickEvent e)
        {
            if (e.button != 0)
            {
                return;
            }
            List <System.Type> existingTypes = new List <System.Type>();

            foreach (ComponentHandle <ProvenceComponent> handle in chosenKey.GetAllComponents())
            {
                existingTypes.Add(handle.component.GetType());
            }
            TypeSelector.TypeSelectorParameters searchParameters = new TypeSelector.TypeSelectorParameters(typeof(ProvenceComponent), false, existingTypes, typeof(Entity));
            TypeSelector.Open(searchParameters, args => {
                Helpers.InvokeGenericMethod <EntityEditor>(this, "AddComponent", args.value);
            });
        }