Ejemplo n.º 1
0
        /// <summary>
        /// Creates the list of theme instances based on all the theme settings
        /// Themes will be created for the current dimension index
        /// </summary>
        protected virtual void SetupThemes()
        {
            activeThemes.Clear();

            // Profiles are one per GameObject/ThemeContainer
            // ThemeContainers are one per dimension
            // ThemeDefinitions are one per desired effect (i.e theme)
            foreach (var profile in Profiles)
            {
                if (profile.Target != null && profile.Themes != null)
                {
                    if (dimensionIndex >= 0 && dimensionIndex < profile.Themes.Count)
                    {
                        var themeContainer = profile.Themes[dimensionIndex];
                        if (themeContainer.States.Equals(States))
                        {
                            foreach (var themeDefinition in themeContainer.Definitions)
                            {
                                activeThemes.Add(InteractableThemeBase.CreateAndInitTheme(themeDefinition, profile.Target));
                            }
                        }
                        else
                        {
                            Debug.LogWarning($"Could not use {themeContainer.name} in Interactable on {gameObject.name} because Theme's States does not match {States.name}");
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create and initialize Theme Engines with the associated Target and Theme property
        /// </summary>
        /// <returns>List of Theme Engine instances</returns>
        public List <InteractableThemeBase> CreateThemeEngines()
        {
            List <InteractableThemeBase> results = new List <InteractableThemeBase>();

            if (Theme != null)
            {
                foreach (var definition in Theme.Definitions)
                {
                    results.Add(InteractableThemeBase.CreateAndInitTheme(definition, Target));
                }
            }

            return(results);
        }