public void OnEnable() { if (!NeedsReenable()) return; _errorMessage = null; _recipe = new UMAData.UMARecipe(); showBaseEditor = false; try { var umaRecipeBase = target as UMARecipeBase; if (umaRecipeBase != null) { var context = UMAContext.FindInstance() ; if (context == null) { _recipe = null; return; } umaRecipeBase.Load(_recipe, context); _description = umaRecipeBase.GetInfo(); } } catch (UMAResourceNotFoundException e) { _errorMessage = e.Message; } dnaEditor = new DNAMasterEditor(_recipe); slotEditor = new SlotMasterEditor(_recipe); _rebuildOnLayout = true; }
public void OnEnable() { if (!NeedsReenable()) { return; } showBaseEditor = false; _umaData = target as UMAData; _errorMessage = null; _recipe = _umaData.umaRecipe; if (_recipe == null || _recipe.raceData == null) { _errorMessage = "UMA Data not loaded."; } else { DNAMasterEditor.umaGenerator = _umaData.umaGenerator; dnaEditor = new DNAMasterEditor(_recipe); slotEditor = new SlotMasterEditor(_recipe); SetCurrentDnaTypeHashes(); _rebuildOnLayout = true; } }
public override void OnEnable() { if (plugins == null) { AddPlugins(); } base.OnEnable(); foreach (IUMARecipePlugin plugin in plugins) { plugin.OnEnable(); } if (!NeedsReenable()) { return; } _errorMessage = null; _recipe = new UMAData.UMARecipe(); showBaseEditor = false; try { var umaRecipeBase = target as UMARecipeBase; if (umaRecipeBase != null) { var context = UMAContextBase.Instance; //create a virtual UMAContextBase if we dont have one and we have DCS if (context == null || context.gameObject.name == "UMAEditorContext") { context = umaRecipeBase.CreateEditorContext(); //will create or update an UMAEditorContext to the latest version generatedContext = context.gameObject.transform.parent.gameObject; //The UMAContextBase in a UMAEditorContext is that gameobject's child } //legacy checks for context if (context == null) { _errorMessage = "Editing a recipe requires a loaded scene with a valid UMAContextBase."; Debug.LogWarning(_errorMessage); //_recipe = null; //return; } umaRecipeBase.Load(_recipe, context); _description = umaRecipeBase.GetInfo(); } } catch (UMAResourceNotFoundException e) { _errorMessage = e.Message; } dnaEditor = new DNAMasterEditor(_recipe); slotEditor = new SlotMasterEditor(_recipe); _rebuildOnLayout = true; }
public void OnEnable() { showBaseEditor = true; _umaData = target as UMAData; _errorMessage = null; _recipe = _umaData.umaRecipe; if (_recipe == null) { _errorMessage = "UMA Data not loaded."; } else { dnaEditor = new DNAMasterEditor(_recipe); slotEditor = new SlotMasterEditor(_recipe); _rebuildOnLayout = true; } }
public void OnEnable() { if (!NeedsReenable()) return; showBaseEditor = false; _umaData = target as UMAData; _errorMessage = null; _recipe = _umaData.umaRecipe; if (_recipe == null || _recipe.raceData == null) { _errorMessage = "UMA Data not loaded."; } else { DNAMasterEditor.umaGenerator = _umaData.umaGenerator; dnaEditor = new DNAMasterEditor(_recipe); slotEditor = new SlotMasterEditor(_recipe); _rebuildOnLayout = true; } }