umasteeringgroup / UMA

Unity Multipurpose Avatar
MIT License
727 stars 167 forks source link

[UMA 2.9] Assigning recipe to the Dynamic Character Avatar doesn't load the recipe #303

Closed VergilUa closed 4 years ago

VergilUa commented 4 years ago

Assigning a pre-designed dynamic recipe to the Dynamic Character Avatar doesn't load the recipe, instead it loads the default race w/o any changes.

To Reproduce Steps to reproduce the behavior:

  1. Assign custom made UMA recipe to the Dynamic Character Avatar field.
  2. Enter playmode.
  3. Observe that default race has been loaded instead of the recipe

Expected behavior Custom recipe should be loaded instead.

Additional context This problem is caused by the BuildUsingComponentSettings property in the DynamicCharacterAvatar.

Instead of

        bool BuildUsingComponentSettings
        {
            get
            {
                bool startRecipeEmpty = (loadString == "" && loadFilename == "" && umaRecipe == null);

                if (loadFileOnStart && !startRecipeEmpty)
                    return false;
                else
                    return true;
            }
        }

That should be:

        bool BuildUsingComponentSettings
        {
            get
            {
                bool startRecipeEmpty = (loadString == "" && loadFilename == "" && umaRecipe == null);

                if (loadFileOnStart || !startRecipeEmpty) // OR instead of AND here
                    return false;
                else
                    return true;
            }
        }

Changing that line fixes the issue.

Jaimi commented 4 years ago

Pushed to latest release. Thanks.