My class not showing in inspector

I'm using unity Iphone and I have this class that's some kind of a linked list.

class WaypointFlow extends System.Object {
    public var wPointIndex : int;
    public var next1 : WaypointFlow;
    public var next2 : WaypointFlow;
}

Then I have this field on a behaviour script:

var sceneFlow : WaypointFlow;

The problem is that next1 and next2 are not showed in the inspector, and I need to achieve that.

Is there any solution to this?

Thanks.

How would it make sense for those variables to show in the inspector? How would you go about assigning a new "WaypointFlow" reference to those variables if they did show up in the inspector. Given there's not a lot of information to go on, I'm going to make a bit of a guess at what you're trying to do.

If you're trying to define waypoints in your scene, and create links between waypoints using drag & drop references in the editor, you should probably arrange your scene and scripts like this:

  • Make your "WaypointFlow" to inherit from "MonoBehaviour" (rather than System.Object)
  • Create a "Waypoint Prefab" which has your WaypointFlow component attached
  • Create waypoints around your scene by creating instances of your waypoint prefab
  • Now you can link up your waypoints by dragging references of waypoints into the 'next' vars of other waypoints.

The reason this works is that once your script inherits from MonoBehaviour, it's now a 'Component' and component references are the only type that can be set in the editor by dragging and dropping gameobjects from the hierarchy into public script variables.