Esempio n. 1
0
        void Awake()
        {
            // get the TextMesh
            mTextMesh = GetComponent <TextMesh>();
            if (mTextMesh != null && mTextColorTheme != null)
            {
                mTextMesh.color = mTextColorTheme.GetThemeValue(Interactive.ButtonStateEnum.Default);
            }

            // get the ColorBlender if on self
            if (ColorBlender == null)
            {
                ColorBlender = GetComponent <ColorTransition>();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// set states or start animaitons
        /// </summary>
        /// <param name="state"></param>
        public override void SetState(Interactive.ButtonStateEnum state)
        {
            base.SetState(state);

            if (mColorTheme != null)
            {
                if (ColorBlender != null)
                {
                    ColorBlender.StartTransition(mColorTheme.GetThemeValue(state));
                }
                else if (mMaterial != null)
                {
                    mMaterial.color = mColorTheme.GetThemeValue(state);
                }
            }

            if (mPositionTheme != null)
            {
                if (MovePosition != null)
                {
                    MovePosition.TargetValue = mPositionTheme.GetThemeValue(state);
                    MovePosition.StartRunning();
                }
                else
                {
                    transform.localPosition = mPositionTheme.GetThemeValue(state);
                }
            }

            if (mScaleTheme != null)
            {
                if (ScaleSize != null)
                {
                    ScaleSize.TargetValue = mScaleTheme.GetThemeValue(state);
                    ScaleSize.StartRunning();
                }
                else
                {
                    transform.localScale = mScaleTheme.GetThemeValue(state);
                }
            }
        }
Esempio n. 3
0
        void Awake()
        {
            // get the color blender
            if (ColorBlender == null)
            {
                ColorBlender = GetComponent <ColorTransition>();
            }

            // get the renderer and material
            Renderer renderer = GetComponent <Renderer>();

            if (renderer != null)
            {
                mMaterial = renderer.material;
            }

            if (mMaterial != null && mColorTheme != null)
            {
                mMaterial.color = mColorTheme.GetThemeValue(State);
            }
        }
        void Awake()
        {
            // get the color tweener
            if (ColorBlender == null)
            {
                ColorBlender = GetComponent <ColorTransition>();
            }

            // get the renderer and material
            Renderer renderer = GetComponent <Renderer>();

            if (renderer != null)
            {
                mMaterial = renderer.material;
            }

            if (mMaterial != null && mColorTheme != null)
            {
                mMaterial.color = mColorTheme.GetThemeValue(Interactive.ButtonStateEnum.Default);
            }
        }
        /// <summary>
        /// set the colors
        /// </summary>
        /// <param name="state"></param>
        public override void SetState(Interactive.ButtonStateEnum state)
        {
            base.SetState(state);

            if (mInnerColorTheme != null)
            {
                ColorBlender.StartTransition(mInnerColorTheme.GetThemeValue(state), InnerMaterial.name);
            }

            if (mOuterColorTheme != null)
            {
                ColorBlender.StartTransition(mOuterColorTheme.GetThemeValue(state), OuterMaterial.name);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Set colors, position and label text
        /// </summary>
        /// <param name="state"></param>
        public override void SetState(Interactive.ButtonStateEnum state)
        {
            base.SetState(state);

            if (mText != null)
            {
                if (mColorTheme != null)
                {
                    mText.color = mColorTheme.GetThemeValue(state);
                }

                if (ButtonLabels != null && this.name == "LabelDictation")
                {
                    if (InteractiveHost.IsSelected)
                    {
                        if (ButtonLabels.Selected != "")
                        {
                            mText.text = ButtonLabels.Selected;
                        }
                        else
                        {
                            mText.text = ButtonLabels.Default;
                        }
                    }
                    else
                    {
                        mText.text = ButtonLabels.Default;
                    }
                }
            }

            if (mPositionTheme != null)
            {
                if (MovePosition != null)
                {
                    MovePosition.TargetValue = mPositionTheme.GetThemeValue(state);
                    MovePosition.StartRunning();
                }
                else
                {
                    transform.localPosition = mPositionTheme.GetThemeValue(state);
                }
            }
        }