Example #1
0
        /// <summary>
        /// Called when the ActiveProfile is changed, whether from script or user-initiated
        /// </summary>
        /// <param name="rUpdatePrefs">Update EditorPrefs?</param>
        private void OnActiveProfileChanged(bool rUpdatePrefs)
        {
            // Destroy the current Editor instance
            mActiveProfileEditor = null;
            if (ActiveProfile == null)
            {
                mHeaderTitle = WindowTitle;
                return;
            }

            ActiveProfile.UpdateRequirements();

            mHeaderTitle = WindowTitle + " - " + ActiveProfile.name;

            //Debug.Log("Active Profile Changed: " + ActiveProfile.name + " ToolMode = " + mToolMode.ToString());

            // Get the Editor for the Active Profile
            mActiveProfileEditor = Editor.CreateEditor(ActiveProfile) as CharacterWizardProfileEditor;
            if (mActiveProfileEditor != null)
            {
                mActiveProfileEditor.IsInjectedView = true;
            }

            if (rUpdatePrefs)
            {
                // Store this profile as the current selection
                ActiveProfile.StorePath(PrefsKey.ActiveProfile);
            }
        }