23 lines
		
	
	
		
			620 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			620 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System.Collections.Generic;
 | |
| using UnityEngine;
 | |
| 
 | |
| namespace NEG.UI.UnityUi.Buttons.Settings
 | |
| {
 | |
|     public class ButtonSettings : MonoBehaviour
 | |
|     {
 | |
|         [SerializeField] private List<SettingData> settingDatas = new();
 | |
| 
 | |
|         public void Apply(BaseButton button)
 | |
|         {
 | |
|             foreach (var setting in settingDatas) setting.Apply(button);
 | |
|         }
 | |
| 
 | |
|         [ContextMenu("Refresh")]
 | |
|         public void Refresh()
 | |
|         {
 | |
|             settingDatas.Clear();
 | |
|             var components = GetComponents<SettingData>();
 | |
|             foreach (var data in components) settingDatas.Add(data);
 | |
|         }
 | |
|     }
 | |
| } |