Jump to content

Naming Conventions


photo

Recommended Posts

Hi,

Is there a official naming convention for programming in Unigine2 ?

Following examples do not break the code but limit the functionality of the editor.

  • No spaces in project names
  • No underscore in ParameterCondition names 

 

Link to comment

Hi Silent,

When encountering following problem I simply started a new project using “_”.

Pseudo code
  
public bool disable_someParameter = false;
[parametercondition(“disable_someParameter”, 1)]
public string s = shown in editor ;

public bool disableSomeParameter = true;
[parametercondition(“disableSomeParameter”, 1)]
public string s = hiden in editor”;

 

Link to comment

Issue with space in project name should be already fixed (it was found in 2.11).

Also there is no any restrictions on underscore usage in ParameterCondition. If you wan to show the exact name in the Editor you can use following code:

[Parameter(Title="disable_someParameter")]
public bool disable_someParameter = false;
[ParameterCondition("disable_someParameter", 1)]
public string s = "shown in editor" ;

 

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

The error does not seem to be consistent.

Yesterday the “_” set gave no hidden fields. now 2 out of 3 are hidden.
After reimporting the script all 3 where hidden.

image.png.30a8bce681ff17f4fd5efebdf0541b72.pngimage.png.25f8e3986c7f186cfa2e633cc24342c0.png

image.png.baf287b40b6af16b4e5797fe752f0c94.pngimage.png.f2d4e043dc7f08aa378fdfec7b1ab649.png

Link to comment

Hi David,

What is your SDK version where you are testing this behavior?

This issue with partial ParameterCondition displaying should be already fixed in the latest 2.12 SDK version (and it's not related to the underscore symbol, the update mechanism simply was bugged in 2.11).

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Recreated the bug copied image v1 and _log1.txt log_1.txt

v1.thumb.PNG.ef3481d53fff52e634fe49b42319279e.PNG

Then figured out the steps to recreated the condition.

Set the value to not default (highlighted in green) same value as default is aloud see image v2.

v2.thumb.PNG.e3c824c05fdd26eab8ed2074c5687f72.PNG
change the condition variable name and (auto)reimport.

The parameter will no longer be hidden.
Change the value back to default using the ccw arow (Normal grey).

RMB reimport and all is ok again.

For v2 _log.txt was not to be found so you get log.txt log.txt

Edited by david.cambre
Link to comment
×
×
  • Create New...