diff options
author | chai <chaifix@163.com> | 2021-04-07 21:06:10 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-04-07 21:06:10 +0800 |
commit | c7e2d8f773baa3955f17402b842eb43329c5f3a0 (patch) | |
tree | 5ba3985d20a2908a67fefa89579f6cf3a94b6a5a /Assets/Test/UIEffect/Samples/Demo/UIEffect_Demo_PropertyControl.cs | |
parent | e7dfbec8e8634e767d78959941daf71a96e021cf (diff) |
+UI_Effect
Diffstat (limited to 'Assets/Test/UIEffect/Samples/Demo/UIEffect_Demo_PropertyControl.cs')
-rw-r--r-- | Assets/Test/UIEffect/Samples/Demo/UIEffect_Demo_PropertyControl.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Assets/Test/UIEffect/Samples/Demo/UIEffect_Demo_PropertyControl.cs b/Assets/Test/UIEffect/Samples/Demo/UIEffect_Demo_PropertyControl.cs new file mode 100644 index 0000000..4d6144f --- /dev/null +++ b/Assets/Test/UIEffect/Samples/Demo/UIEffect_Demo_PropertyControl.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.UI; + +public class UIEffect_Demo_PropertyControl : MonoBehaviour +{ + [SerializeField] private string m_PropertyName; + [SerializeField] private Object[] m_Objects; + + public void ChangeValue(int value) + { + foreach (var o in m_Objects) + { + if (!o) continue; + + var p = o.GetType().GetProperty(m_PropertyName); + Debug.LogFormat("{0} {1} {2}", o.GetType(), m_PropertyName, p); + + if (p == null) continue; + p.SetValue(o, value, new object[0]); + } + } +} |