Jump to content

Fields don't show up in editor


photo

Recommended Posts

I am having trouble with the fields in my C# component not showing up in the Node Properties section of the Parameters window.

I have a PlayerJump component attached to an object of type ObjectMeshStatic with 2 fields which I want to be able to modify in-editor. One of them is a jump key, a key on the keyboard I want to use for jumping, and a jump force.

using Unigine;

[Component(PropertyGuid = "7f93b2a9029f5bf4d7fdd6c350ef8d4696b903ed")]
public class PlayerJump : Component
{
	[Parameter(Title = "Jump Key")]	
	public Input.KEY jumpKey = Input.KEY.SPACE;
	[Parameter(Title = "Jump Force")]
	public float jumpForce = 10f;
	
	private BodyRigid rigidBody;

	private void Init()
	{
		rigidBody = node.ObjectBodyRigid;
	}

	private void Update()
	{
		if(Input.IsKeyDown(jumpKey) && rigidBody)
		{
			rigidBody.AddForce(vec3.UP * jumpForce);
		}
	}
}

Neither of them show up in the editor (demonstrated in the included GIF), even if I make them public or make them private and add the ShowInEditor attribute. The fields don't show up in my current project, a new clean project or even the C# Third Person Platformer demo.

Is there perhaps a tick box I haven't ticked on somewhere or am I declaring the properties wrong or is there something else going on?

unigine why 2.gif

Link to comment

Reimporting doesn't seem to be doing anything.

Maybe it's an issue with my installation. I'll try reinstalling my Unigine Browser, SDK and .NET Core.

Link to comment

Ok, reinstalled everything.

The original project still doesn't want to show the fields even after manually reimporting the component several times like you told me, however pasting the contents of the PlayerJump class into a new component class created in a new clean project seems to remove the issue even for entirely new components, so I guess the issue lied in the previous installation or lies in the project itself, because the original .cs file still doesn't work even in the new project.

Thank you for your help!

Edited by jan.aler
Link to comment
  • 1 month later...

Hello everyone!
Did You solve this problem? I have the same issue I guess...

Edited by vasiliy.kuznetsov
Link to comment
×
×
  • Create New...