fuqunaga / rosettaui Goto Github PK
View Code? Open in Web Editor NEWCode-based UI library for development menus for Unity
License: MIT License
Code-based UI library for development menus for Unity
License: MIT License
Would be good to have a Fold element that doesn't create its content until it's first opened. Maybe also add an option to destroy content if it's closed. Main use case is to hide expensive to process but not always needed UI behind it
main
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here are some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
package.json
file.A package.json file at the root of your project is required to release on npm.
Please follow the npm guideline to create a valid package.json
file.
Good luck with your project ✨
Your semantic-release bot 📦🚀
Changing float values seems to be limited to [-0.02f; 0.02f] when changing by holding down the mouse button.
Unity 2021.3.2f1
Rosetta UI 0.0.2 (last version from Package Manager)
P.s. In general, the framework looks very good, thank you very much)
If you want to develop a runtime editor, you still lack a timeline component
Library/PackageCache/[email protected]/Runtime/UnityInternalAccess/Custom/ListViewCustom.cs(104,41): error CS0507: 'ListViewCustom.CreateViewController()': cannot change access modifiers when overriding 'protected' inherited member 'ListView.CreateViewController()'
I use C# 9.0, .NET Framework 4.7.1 on macOS Unity 2022.1.9f1c1
UI.Fields() supports at #21
Is there an option to make a field only update actual value after I finished typing and press ENTER/focus out of the current window?
Right now it seems like value changed event is emitted every time I type a symbol, which may cause some performance issues if value setter is not cheap.
When trying to input a number into float
field, for example 0.5
, it snaps back to 0.
Unity 2021.3.10f
Dragging windows with a lot of fields cause constant layout recalculation (at least this is what I suspect based on profiler), dropping FPS from 300 to 10. I've used example scene windows to test it
Same thing happens when I'm rearranging array items by dragging them, which causes even worse performance drops, down to 5.
FPS drops massively when rearranging list elements. Video:
Let's take code from #11 and change Start()
function like this:
private void Start()
{
Req.req = new And()
{
Operands = new[] { Req }
};
_root = GetComponent<RosettaUIRoot>();
_root.Build(CreateElement());
}
Running this code causes extreme lag and error spam cuz it tries to create an infinite UI
If Api Compatibility Level use .Net Framework 4.x, will not work.
Library\PackageCache\[email protected]\Runtime\Reactive\ReactiveProperty.cs(37,37): error CS1503: Argument 1: cannot convert from 'System.Action' to 'System.IObserver'
Library\PackageCache\[email protected]\Runtime\Reactive\Observable.cs(59,41): error CS1503: Argument 1: cannot convert from 'System.Action' to 'System.IObserver'
Library\PackageCache\[email protected]\Runtime\Elements\ElementGroup\DynamicElement.cs(53,32): error CS1660: Cannot convert lambda expression to type 'IObserver' because it is not a delegate type
Array fields cause extreme lag in nested layouts.
Here is an example code to replicate:
public int[] Req3 = new int[0];
private Element CreateElement()
{
return UI.Window(
Recursive(UI.Field(() => Req3), 6)
);
}
private Element Recursive(Element child, int count = 1)
{
while (count-- > 0)
{
child = UI.Fold("Recursion", UI.Box(child)).Open();
}
return child;
}
With recursion count of 5, lag is already noticeable, and if you increase it, lag increases exponentially, up to ~13 seconds of freeze if you hover over "+" button with count of 8.
Other kinds of fields don't seem to have this lag, I can stack regular int field into high recursion counts without performance consequences, up to 26
I was trying to make a simple boolean nodes calculator, but quickly ran into "Circular reference detected"
[RequireComponent(typeof(RosettaUIRoot))]
public class RosettaUIExample : MonoBehaviour
{
[Serializable]
public enum RequirementType
{
AlwaysTrue,
And,
Or,
Not,
Checkbox,
}
[Serializable]
public abstract class Requirement : IElementCreator
{
public abstract bool CalculateOutcome();
public bool Ignored = false;
public abstract Element CreateElement(LabelElement label);
}
[Serializable]
public class AlwaysTrue : Requirement
{
public override bool CalculateOutcome() => true;
public override Element CreateElement(LabelElement label) => UI.Column();
}
[Serializable]
public class And : Requirement
{
public RequirementNode[] Operands = Array.Empty<RequirementNode>();
public override bool CalculateOutcome() => Operands.All(e => e.req.CalculateOutcome());
public override Element CreateElement(LabelElement label) => UI.Field(() => Operands);
}
[Serializable]
public class Or : Requirement
{
public RequirementNode[] Operands = Array.Empty<RequirementNode>();
public override bool CalculateOutcome() => Operands.Any(e => e.req.CalculateOutcome());
public override Element CreateElement(LabelElement label) => UI.Field(() => Operands);
}
[Serializable]
public class Not : Requirement
{
public RequirementNode Operand = new RequirementNode();
public override bool CalculateOutcome() => !Operand.req.CalculateOutcome();
public override Element CreateElement(LabelElement label) => UI.Field(() => Operand);
}
[Serializable]
public class Checkbox : Requirement
{
public bool Active;
public override bool CalculateOutcome() => Active;
public override Element CreateElement(LabelElement label) => UI.Field(() => Active);
}
public static class RequirementFactory
{
public static Requirement Create(RequirementType type)
{
return type switch
{
RequirementType.AlwaysTrue => new AlwaysTrue(),
RequirementType.And => new And(),
RequirementType.Or => new Or(),
RequirementType.Not => new Not(),
RequirementType.Checkbox => new Checkbox(),
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
};
}
}
[Serializable]
public class RequirementNode : IElementCreator
{
private RequirementType _requirementType;
public RequirementType RequirementType
{
get => _requirementType;
set
{
if (_requirementType == value) return;
_requirementType = value;
req = RequirementFactory.Create(value);
}
}
public Requirement req = new AlwaysTrue();
public Element CreateElement(LabelElement label)
{
return UI.Column(
UI.Field(() => RequirementType),
UI.DynamicElementOnStatusChanged(() => RequirementType, _ => req.CreateElement(null))
);
}
}
public RequirementNode Req = new();
private RosettaUIRoot _root;
private void Start()
{
_root = GetComponent<RosettaUIRoot>();
_root.Build(CreateElement());
}
private Element CreateElement()
{
return UI.Window(
// ExampleTypes.Select(type => UI.WindowLauncher(type))
UI.Field(() => Req),
UI.Field("Outcome", () => Req.req.CalculateOutcome())
);
}
}
This is the result I get in the UI
As you can see, all nodes are working normally, except for Not
node that throws circular reference, even tho I clearly don't have any in my code.
Also, I have an unrelated question: Is there a better way to make an editor for this kind of data structure? Aka one "holder" that have a type
field, and a body
field that contains different classes depending on type
. My current implementation requires to manually write UI controls for every possibly body
class, and I'm concerned about performance implication of dozens of DynamicElement
s performing checks on type
field every tick
It would be good to have a dynamic element that isn't updated every tick to check for condition, but rather listen to some event, and only triggers the rebuild function if a new value was emitted by that event. The main use case is to have DynamicElement that is tied to changes in some other field, without wasting resourced updating it every tick. Performance impact is negligible with one, but what about a dozen?
Currently, when using lists, the whole list is generated at once, aka all of its elements are added to the tree, which may cause issues if there are a lot of elements, so my question:
Is there a UI element that allows me to create a list that only shows elements that are currently on-screen? Afaik, UI toolkit default ListView already have this functionality, so would it be possible to have a similar feature here? Maybe as a separate component even
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.