careboo / serially Goto Github PK
View Code? Open in Web Editor NEWAdds a unity-supported, SerializableType class and an inspector for editing SerializeReference fields.
License: MIT License
Adds a unity-supported, SerializableType class and an inspector for editing SerializeReference fields.
License: MIT License
Need a way to handle a manual release in case the publish command fails.
Serially/Editor/TypePickerWindow.cs
Lines 134 to 138 in c26b833
In unity 2021.1 it's don't working because List have Refresh
https://docs.unity3d.com/2021.1/Documentation/ScriptReference/UIElements.ListView.Refresh.html
Code coverage for this class is at 0%. Let's start testing it using the TestEditorWindow
NullReferenceException: Object reference not set to an instance of an object
CareBoo.Serially.Editor.ShowSerializeReferenceDrawer.GetSelectableTypes (UnityEditor.SerializedProperty property, System.Reflection.FieldInfo fieldInfo) (at Library/PackageCache/[email protected]/Editor/ShowSerializeReferenceDrawer.cs:95)
CareBoo.Serially.Editor.ShowSerializeReferenceDrawer+<>c__DisplayClass5_0.<OnGUI>b__0 () (at Library/PackageCache/[email protected]/Editor/ShowSerializeReferenceDrawer.cs:74)
System.Lazy`1[T].CreateValue () (at <fb001e01371b4adca20013e0ac763896>:0)
System.Lazy`1[T].LazyInitValue () (at <fb001e01371b4adca20013e0ac763896>:0)
System.Lazy`1[T].get_Value () (at <fb001e01371b4adca20013e0ac763896>:0)
CareBoo.Serially.Editor.TypeField.HandlePickerButtonClicked () (at Library/PackageCache/[email protected]/Editor/TypeField.cs:116)
CareBoo.Serially.Editor.TypeField.HandleMouseDown () (at Library/PackageCache/[email protected]/Editor/TypeField.cs:110)
CareBoo.Serially.Editor.TypeField.HandleCurrentEvent () (at Library/PackageCache/[email protected]/Editor/TypeField.cs:105)
CareBoo.Serially.Editor.TypeField.DrawGui () (at Library/PackageCache/[email protected]/Editor/TypeField.cs:88)
CareBoo.Serially.Editor.ShowSerializeReferenceDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, CareBoo.Serially.Editor.GuiEvent currentEvent, System.Reflection.FieldInfo fieldInfo) (at Library/PackageCache/[email protected]/Editor/ShowSerializeReferenceDrawer.cs:75)
CareBoo.Serially.Editor.ShowSerializeReferenceDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Library/PackageCache/[email protected]/Editor/ShowSerializeReferenceDrawer.cs:60)
Use the unity asset store tools to create a hybrid package! This should allow developers the ability to install via .unitypackage and local package
We don't need to know what the selectable types are until the type picker window is opened. Running into performance issues with many selectable types in the Reject project.
I'd like code coverage to show up in a PR with CodeCov.
Setting a TypeFilter delegate to a function that returns null will throw an ArgumentNullException
. Instead, it should be treated as an empty Sequence.
Would be nice :)
They aren't used anywhere else... and I don't think they will be. Move them into the tests folder.
When making a PR or pushing to master, there should be a GitHub workflow that is run that runs unity's automated tests.
Code Coverage on this class is 0%. Let's test it using TestEditorWindow
.
Currently it's taking in one type at a time. There is a performance benefit to taking in the whole sequence and filtering it at once. Modifying a sequence of types also makes more sense semantically.
Okay this looks really cool
https://github.com/semantic-release/semantic-release
The TypeFilterAttribute
allows dynamic type filtering, which can be useful with a ShowSerializeReference field.
Change ShowValueTypeAttribute
to ShowSerializeReferenceAttribute
because it's easier to understand.
The added context menu items, Copy
and Paste
, hide the existing context menu items like Copy Property Path
and Add Element
from the array / list methods.
Github now supports manual workflow triggers. This is perfect for the activation workflow in grabbing the unity license file.
When the release is created via semantic-release, the publish action isn't being called.
Currently using a hack to test TypeField
. Instead, I should be extracting a public method that includes all context parameters (e.g. Event.current
) to make it easier to test:
public static Rect TypeField(Rect position, Type type, Type[] types, Action<Type> onSelect, IMGUIEvent imguiEvent, GUISkin skin, ...)
{
...
}
When the ProvideSourceInfoAttribute
is defined in a script outside the Assets folder, e.g. in a package, clicking on the type label doesn't ping the script in editor.
Should be able to get run code coverage with the automated tests. The report should be uploaded as an artifact.
Now that there's a code coverage tool, it should be straightforward to increase coverage to 100%.
Add a contextmenu to the ShowValueType drawer that can copy and paste a SerializeReference object.
Copy should add the object to a static field.
Paste should attempt to paste the object, and if it's unassignable, it should show a warning in the console.
Setting the SerializableType to null doesn't work. No errors are reported.
Setting a value to the SerializeReference field isn't persisting it to a file. This could be a bug in Unity 2019.4.5f1 Linux, needs investigation.
InvalidOperationException: Cannot assign an object deriving from UnityEngine.Object to a managed reference. This is not supported.
Any types inheriting from UnityEngine.Object
should be removed.
Packages/com.careboo.serially/README.md
template.README.md
with the changes from the package one.SerializableType
and ShowSerializeReference
.The serializable type documentation here is using the following text
public IEnumerable<Type> MyCustomFilter(IEnumerable<Type> types)The delegate given to TypeFilter must be a Func<IEnumerable, IEnumerable> to work.
The documentation here is incorrect. The correct delegate type is of Func<Type, bool>
. The Documentation needs to be changed to the correct API first: Func<IEnumerable<Type>, IEnumerable<Type>>
-> Func<Type, bool>
, then we can think about supporting delegates of type Func<IEnumerable<Type>,IEnumerable<Type>>
.
It's almost there. However, we need explicit unit tests.
TypeField
is currently using IMGUI, and serves both the ShowSerializeReferenceDrawer
and the SerializableTypeDrawer
. Although these two drawers look the same, they're different.
ShowSerializeReferenceDrawer
should follow UnityEngine.Object
field drawer style.SerializableTypeDrawer
should follow an enum
field drawer style.This is causing the following error when using the package:
Asset Packages/com.careboo.serially/LICENSE.md has no meta file, but it's in an immutable folder. The asset will be ignored.
GuidAttribute
and ProvideSourceInfo
attributes are used to uniquely reference classes. The Unity Editor already does this with meta files, and exposes it through the MonoScript
asset.
The guid should be gotten from the MonoScript
asset, and the pinging of the file can be handled through this asset as well.
The only flaw through this method, is that it will scale as O(n) to lookup types through the MonoImporter.GetAllRuntimeMonoScripts
. Caching can help reduce any bottlenecks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.