Hi,
Got a twisted problem, but hopefully solvable.
I am building a custom interface editor. In there, I want to display only the necessary fields, so I need to check values to know what to show and in which case. The problem is that the target value is an enum taken from a class in another script, and it doesn't let me do comparison with it.
in a script I have:
enum AxisList {xAxis,yAxis,zAxis}
class jf_pivotDrive {
/*
I Use this class to hold the enum because I can't seem
to be able to access the enum from the reference of the component attached
to a RB
*/
static var AxisList: AxisList;
}
in the script target ( linked to the editor)
public var whichAxis = jf_pivotDrive.AxisList.xAxis;
and finally in the editor script
if ( target.whichAxis == jf_pivotDrive.AxisList.xAxis)
I get the following error:
The name 'jf_pivotDrive.AxisList' does not denote a valid type. Did you mean '.AxisList' ?
What should I do to have this work? should I define the class hoding the enum somewhere else without breaking other script using it? Is namespace should be involved if possible?
I know I could get away with this by simply using a string all the way instead of enum, but I am here to learn, and enum if a powerfull, trouble free feature and convenient gui component. Any advice or tips welcome.
thanks,
Jean