/// <summary> /// Set the Scale /// </summary> /// <param name="state"></param> public override void SetState(Interactive.ButtonStateEnum state) { base.SetState(state); if (mScaleTheme != null) { if (ScaleTweener != null) { ScaleTweener.TargetValue = mScaleTheme.GetThemeValue(state); ScaleTweener.StartRunning(); } else { transform.localScale = mScaleTheme.GetThemeValue(state); } } }
/// <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); } } }