This isn't the first time this happened, first time was for unknown reasons but every time I try to make items combinable the action I create is empty and just doesn't work. I followed the tutorial exactly as described in these forums and still doesn't work, probably because of this error. Thanks!
Comments
I apologise for the error - it appears to be a duplicate of this bug and I would like to fix it ASAP.
- What version of Unity are you using?
- Did you begin fresh with the same version, or upgrade mid-project from a different version?
- When was the first time this occured?
Fixing it for your own project should be a simple case should be a simple case of going into your Actions Manager and re-assigning a new default Action. However, it's important to fix it in the code so that this doesn't occur again - for you, or anyone.If you can, please test the following script amendment. In ActionsManager.cs, you should find the Upgrade() method beginning line 93:
private void Upgrade ()
{
if (defaultClass > 0 && EnabledActions.Count > 0 && EnabledActions.Count > defaultClass)
{
defaultClassName = EnabledActions[defaultClass].fileName;
defaultClass = -1;
}
}
Please replace it with the following:
private void Upgrade ()
{
if (defaultClass >= 0 && EnabledActions.Count > 0 && EnabledActions.Count > defaultClass)
{
defaultClassName = EnabledActions[defaultClass].fileName;
defaultClass = -1;
}
if (string.IsNullOrEmpty (defaultClassName))
{
defaultClassName = EnabledActions[0].fileName;
defaultClass = -1;
}
}
Does that cause things to work?
Replying to you on this thread you referred me to.
Here are the answers to your questions:
The code fix you posted does indeed fix the problem. No more errors and I can add actions through the Actionlist editor no problem. Thanks!
@jasong: Was your default Action prior to upgrading ActionList: Check parameter? That's the only condition that I can find that would cause the issue.