Skip to content

Commit

Permalink
close #78; Remove 'cutoff' and 'mono' effect in UIEffect component
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai authored and mob-sakai committed Sep 29, 2018
1 parent 7be2f6f commit cd970b0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Assets/Coffee/UIExtensions/UIEffect/Scripts/UIEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,22 @@ protected override void UpgradeIfNeeded()
hsv.hue = hue;
hsv.range = 1;
}

if (m_ToneMode == ToneMode.Cutoff || m_ToneMode == ToneMode.Mono)
{
var go = gameObject;
var factor = m_ToneLevel;
var transitionMode = m_ToneMode == ToneMode.Cutoff
? UITransitionEffect.EffectMode.Cutoff
: UITransitionEffect.EffectMode.Mono;
DestroyImmediate(this, true);
var trans = go.GetComponent<UITransitionEffect>() ?? go.AddComponent<UITransitionEffect>();
trans.effectFactor = factor;

var sp = new SerializedObject(trans).FindProperty("m_EffectMode");
sp.intValue = (int)transitionMode;
sp.serializedObject.ApplyModifiedProperties();
}
}
}
#pragma warning restore 0612
Expand Down

0 comments on commit cd970b0

Please sign in to comment.