/// <inheritdoc />
        public override void Init(GameObject host, InteractableThemePropertySettings settings)
        {
            base.Init(host, settings);

            shaderProperties = new List <ShaderProperties>();
            for (int i = 0; i < ThemeProperties.Count; i++)
            {
                InteractableThemeProperty prop = ThemeProperties[i];
                if (prop.ShaderOptions.Count > 0)
                {
                    shaderProperties.Add(prop.ShaderOptions[prop.PropId]);
                }
            }

            propertyBlocks = new List <BlocksAndRenderer>();
            Renderer[] list = host.GetComponentsInChildren <Renderer>();
            for (int i = 0; i < list.Length; i++)
            {
                MaterialPropertyBlock block = InteractableThemeShaderUtils.GetMaterialPropertyBlock(list[i].gameObject, shaderProperties.ToArray());
                BlocksAndRenderer     bAndR = new BlocksAndRenderer();
                bAndR.Renderer = list[i];
                bAndR.Block    = block;

                propertyBlocks.Add(bAndR);
            }
        }
예제 #2
0
        public virtual void Init(GameObject host, InteractableThemePropertySettings settings)
        {
            Host = host;

            for (int i = 0; i < settings.Properties.Count; i++)
            {
                InteractableThemeProperty prop = ThemeProperties[i];
                prop.ShaderOptionNames = settings.Properties[i].ShaderOptionNames;
                prop.ShaderOptions     = settings.Properties[i].ShaderOptions;
                prop.PropId            = settings.Properties[i].PropId;
                prop.Values            = settings.Properties[i].Values;

                ThemeProperties[i] = prop;
            }

            for (int i = 0; i < settings.CustomSettings.Count; i++)
            {
                InteractableCustomSetting setting = CustomSettings[i];
                setting.Name      = settings.CustomSettings[i].Name;
                setting.Type      = settings.CustomSettings[i].Type;
                setting.Value     = settings.CustomSettings[i].Value;
                CustomSettings[i] = setting;
            }

            Ease = CopyEase(settings.Easing);
            Ease.Stop();

            Loaded = true;
        }
        public override void Init(GameObject host, InteractableThemePropertySettings settings)
        {
            base.Init(host, settings);

            mesh = Host.GetComponent <TextMesh>();
            text = Host.GetComponent <Text>();
        }
 public override void Init(GameObject host, InteractableThemePropertySettings settings)
 {
     base.Init(host, settings);
     hostTransform = Host.transform;
     startPosition = hostTransform.localPosition;
     startScale    = hostTransform.localScale;
 }
        /// <summary>
        /// Get a new theme instance and load it with settings
        /// </summary>
        /// <param name="settings"></param>
        /// <param name="host"></param>
        /// <param name="lists"></param>
        /// <returns></returns>
        public static InteractableThemeBase GetTheme(InteractableThemePropertySettings settings, GameObject host)
        {
            Type themeType = Type.GetType(settings.AssemblyQualifiedName);
            InteractableThemeBase theme = (InteractableThemeBase)Activator.CreateInstance(themeType);

            theme.Init(host, settings);
            return(theme);
        }
예제 #6
0
        /// <inheritdoc />
        public override void Init(GameObject host, InteractableThemePropertySettings settings)
        {
            base.Init(host, settings);
            if (host != null)
            {
                startScaleValue         = new InteractableThemePropertyValue();
                startScaleValue.Vector3 = host.transform.localScale;
            }

            timer = Ease.LerpTime;
        }
        public override void Init(GameObject host, InteractableThemePropertySettings settings)
        {
            base.Init(host, settings);

            shaderProperties = new List <ShaderProperties>();
            for (int i = 0; i < ThemeProperties.Count; i++)
            {
                InteractableThemeProperty prop = ThemeProperties[i];
                if (prop.ShaderOptions.Count > 0)
                {
                    shaderProperties.Add(prop.ShaderOptions[prop.PropId]);
                }
            }

            propertyBlock = InteractableThemeShaderUtils.GetMaterialPropertyBlock(host, shaderProperties.ToArray());

            renderer = Host.GetComponent <Renderer>();
        }
예제 #8
0
        /// <summary>
        /// Creates the list of theme instances based on all the theme settings
        /// </summary>
        protected virtual void SetupThemes()
        {
            runningThemesList      = new List <InteractableThemeBase>();
            runningProfileSettings = new List <ProfileSettings>();
            for (int i = 0; i < Profiles.Count; i++)
            {
                ProfileSettings      profileSettings   = new ProfileSettings();
                List <ThemeSettings> themeSettingsList = new List <ThemeSettings>();
                for (int j = 0; j < Profiles[i].Themes.Count; j++)
                {
                    Theme         theme         = Profiles[i].Themes[j];
                    ThemeSettings themeSettings = new ThemeSettings();
                    if (Profiles[i].Target != null && theme != null)
                    {
                        List <InteractableThemePropertySettings> tempSettings = new List <InteractableThemePropertySettings>();
                        for (int n = 0; n < theme.Settings.Count; n++)
                        {
                            InteractableThemePropertySettings settings = theme.Settings[n];
                            settings.Theme = InteractableProfileItem.GetTheme(settings, Profiles[i].Target);

                            // add themes to theme list based on dimension
                            if (j == dimensionIndex)
                            {
                                runningThemesList.Add(settings.Theme);
                            }

                            tempSettings.Add(settings);
                        }

                        themeSettings.Settings = tempSettings;
                        themeSettingsList.Add(themeSettings);
                    }
                }

                profileSettings.ThemeSettings = themeSettingsList;
                runningProfileSettings.Add(profileSettings);
            }
        }
예제 #9
0
        public override void Init(GameObject host, InteractableThemePropertySettings settings)
        {
            base.Init(host, settings);

            hostTransform = Host.transform;
        }
예제 #10
0
        public override void Init(GameObject host, InteractableThemePropertySettings settings)
        {
            base.Init(host, settings);

            renderer = Host.GetComponent <Renderer>();
        }
 /// <inheritdoc />
 public override void Init(GameObject host, InteractableThemePropertySettings settings)
 {
     base.Init(host, settings);
     propertyBlock = InteractableThemeShaderUtils.GetMaterialPropertyBlock(host, new ShaderProperties[0]);
     renderer      = Host.GetComponent <Renderer>();
 }
예제 #12
0
 public override void Init(GameObject host, InteractableThemePropertySettings settings)
 {
     base.Init(host, settings);
     audioSource = Host.GetComponentInChildren <AudioSource>();
 }
예제 #13
0
 /// <inheritdoc />
 public override void Init(GameObject host, InteractableThemePropertySettings settings)
 {
     base.Init(host, settings);
     controller = Host.GetComponent <Animator>();
 }
 /// <inheritdoc />
 public override void Init(GameObject host, InteractableThemePropertySettings settings)
 {
     base.Init(host, settings);
 }