How to modify unity inspector for new viewtype?

DankP3

Active member
First, ThirdPersonControl set the inspector for the ThirdPerson ViewTypes. I note that the m_YawLimitLerpSpeed is not displayed and was easily corrected by modifying the Adventure specific section, thus:

Code:
            if (target is Adventure) {
                FieldInspectorView.AddField(unityObject, target, "m_YawLimit", container, onChangeEvent, onValidateChange);
                FieldInspectorView.AddField(unityObject, target, "m_YawLimitLerpSpeed", container, onChangeEvent, onValidateChange);
            }

Where I am struggling is to add my own custom ThirdPerson inherited ViewType to this inspector. "target is MyNewViewType" is not recognised in VisualStudio. I appreciate this is a Unity question rather than UCC, but any pointer would help, thanks.
 
OK, so is having the new ViewType in the opsive folder hierarchy the only way or new assembly def?
 
Last edited:
@Justin so the conclusions/questions from discussion in discord:

1. your ViewType Inspector looks neat, but we are excluded from adding new ViewTypes (even if inheriting old unless we incorporate our scripts in your folders and possibly modify your control scripts for additional variables (there are several reasons to not follow this route).
2. We may be able to direct assembly definitions (I have not tried).
3. Apparently, we can write our own standalone custom inspectors as we used to in v2 and perhaps that is the best way to proceed to isolate our scripts from updates etc.?
4. Is there anyway to open your inspector scripts to custom addons that are not going to be fragile to updates?

Lastly, more trivial, in ThirdPersonControl you have not displayed the Adventure m_YawLimitLerpSpeed as noted in the first post here.
 
Where I am struggling is to add my own custom ThirdPerson inherited ViewType to this inspector. "target is MyNewViewType" is not recognised in VisualStudio. I appreciate this is a Unity question rather than UCC, but any pointer would help, thanks.
This specific issue is related to assembly definitions. This is why placing the view type in the opsive folder allows you to reference it.

You can subclass view type inspectors allowing you to display custom content. In the third person view type I didn't subclass the adventure view type since adventure really doesn't add many parameters. Though as you said I forgot the lerp speed so I may do that when adding it.
 
Top